public function testCreateWhenAssigneeIsNull() { $branch = $this->createBranch(); $reporter = $this->createReporter(); $ticket = new Ticket(new UniqueId('unique_id'), new TicketSequenceNumber(null), self::TICKET_SUBJECT, self::TICKET_DESCRIPTION, $branch, $reporter, null, new Source(Source::PHONE), new Priority(Priority::PRIORITY_LOW), new Status(Status::NEW_ONE)); $this->assertEquals('Subject', $ticket->getSubject()); $this->assertEquals('Description', $ticket->getDescription()); $this->assertEquals($branch, $ticket->getBranch()); $this->assertEquals('new', $ticket->getStatus()->getValue()); $this->assertEquals($reporter, $ticket->getReporter()); $this->assertNull($ticket->getAssignee()); $this->assertEquals(Source::PHONE, $ticket->getSource()->getValue()); }
/** * @param Ticket $ticket * * @return UpdateTicketCommand */ public function createUpdateTicketCommand(Ticket $ticket) { $command = new UpdateTicketCommand(); $command->id = $ticket->getId(); $command->key = (string) $ticket->getKey(); $command->subject = $ticket->getSubject(); $command->description = $ticket->getDescription(); $command->reporter = $ticket->getReporter(); $command->assignee = $ticket->getAssignee(); $command->status = $ticket->getStatus(); $command->priority = $ticket->getPriority(); $command->branch = $ticket->getBranch(); $command->source = $ticket->getSource(); $command->tags = $ticket->getTags(); return $command; }
public function delete() { $this->raise(new CommentWasDeleted($this->ticket->getUniqueId(), $this->ticket->getSubject(), $this->content, $this->private)); }