| @@ 22-58 (lines=37) @@ | ||
| 19 | use Kreta\TaskManager\Domain\Model\Organization\OrganizationName; |
|
| 20 | use PhpSpec\ObjectBehavior; |
|
| 21 | ||
| 22 | class OrganizationCreatedSpec extends ObjectBehavior |
|
| 23 | { |
|
| 24 | function let(OrganizationId $organizationId, OrganizationName $name, Slug $slug) |
|
| 25 | { |
|
| 26 | $this->beConstructedWith($organizationId, $name, $slug); |
|
| 27 | } |
|
| 28 | ||
| 29 | function it_is_initializable() |
|
| 30 | { |
|
| 31 | $this->shouldHaveType(OrganizationCreated::class); |
|
| 32 | } |
|
| 33 | ||
| 34 | function it_implements_domain_event() |
|
| 35 | { |
|
| 36 | $this->shouldImplement(DomainEvent::class); |
|
| 37 | } |
|
| 38 | ||
| 39 | function it_get_occurred_on() |
|
| 40 | { |
|
| 41 | $this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class); |
|
| 42 | } |
|
| 43 | ||
| 44 | function it_gets_organization_id(OrganizationId $organizationId) |
|
| 45 | { |
|
| 46 | $this->organizationId()->shouldReturn($organizationId); |
|
| 47 | } |
|
| 48 | ||
| 49 | function it_gets_organization_name(OrganizationName $name) |
|
| 50 | { |
|
| 51 | $this->organizationName()->shouldReturn($name); |
|
| 52 | } |
|
| 53 | ||
| 54 | function it_gets_organization_slug(Slug $slug) |
|
| 55 | { |
|
| 56 | $this->organizationSlug()->shouldReturn($slug); |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| @@ 22-42 (lines=21) @@ | ||
| 19 | use Kreta\TaskManager\Domain\Model\Organization\OrganizationName; |
|
| 20 | use PhpSpec\ObjectBehavior; |
|
| 21 | ||
| 22 | class OrganizationEditedSpec extends ObjectBehavior |
|
| 23 | { |
|
| 24 | function let(OrganizationId $id, OrganizationName $name, Slug $slug) |
|
| 25 | { |
|
| 26 | $this->beConstructedWith($id, $name, $slug); |
|
| 27 | } |
|
| 28 | ||
| 29 | function it_is_initializable() |
|
| 30 | { |
|
| 31 | $this->shouldHaveType(OrganizationEdited::class); |
|
| 32 | $this->shouldImplement(DomainEvent::class); |
|
| 33 | } |
|
| 34 | ||
| 35 | function it_creates_a_organization_edited_event(OrganizationId $id, OrganizationName $name, Slug $slug) |
|
| 36 | { |
|
| 37 | $this->id()->shouldReturn($id); |
|
| 38 | $this->name()->shouldReturn($name); |
|
| 39 | $this->slug()->shouldReturn($slug); |
|
| 40 | $this->occurredOn()->shouldReturnAnInstanceOf(\DateTimeInterface::class); |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||