function it_transform_organization_to_plain_dto(MemberDataTransformer $memberDataTransformer)
 {
     $userId = UserId::generate('user-id');
     $organization = new Organization(OrganizationId::generate('organization-id'), new OrganizationName('Organization name'), new Slug('Organization name'), $userId);
     $this->write($organization);
     $memberDataTransformer->write($organization->owner($userId))->shouldBeCalled();
     $memberDataTransformer->read()->shouldBeCalled()->willReturn(['id' => 'owner-id', 'created_on' => '2016-10-24', 'updated_on' => '2016-10-24', 'user_id' => 'user-id', 'organization' => [['id' => 'organization-id', 'name' => 'Organization name', 'slug' => 'organization-name', 'created_on' => '2016-10-24', 'updated_on' => '2016-10-24']]]);
     $this->read()->shouldReturn(['id' => 'organization-id', 'name' => 'Organization name', 'slug' => 'organization-name', 'created_on' => (new \DateTimeImmutable())->format('Y-m-d'), 'updated_on' => (new \DateTimeImmutable())->format('Y-m-d'), 'owners' => [['id' => 'owner-id', 'created_on' => '2016-10-24', 'updated_on' => '2016-10-24', 'user_id' => 'user-id', 'organization' => [['id' => 'organization-id', 'name' => 'Organization name', 'slug' => 'organization-name', 'created_on' => '2016-10-24', 'updated_on' => '2016-10-24']]]], 'organizationMembers' => []]);
 }
 function it_serializes_organization_member(OrganizationMemberOfIdQuery $query, OrganizationRepository $repository, Organization $organization, MemberDataTransformer $dataTransformer, OrganizationMember $organizationMember)
 {
     $query->organizationId()->shouldBeCalled()->willReturn('organization-id');
     $repository->organizationOfId(OrganizationId::generate('organization-id'))->shouldBeCalled()->willReturn($organization);
     $query->userId()->shouldBeCalled()->willReturn('user-id');
     $organization->isOrganizationMember(UserId::generate('user-id'))->shouldBeCalled()->willReturn(true);
     $organization->organizationMember(UserId::generate('user-id'))->shouldBeCalled()->willReturn($organizationMember);
     $dataTransformer->write($organizationMember)->shouldBeCalled();
     $dataTransformer->read()->shouldBeCalled();
     $this->__invoke($query);
 }