memberships = new class implements MembershipsAttributInterface{ use MembershipsAttribut; }; } public function testConstructor():void { $this->expectException(\TypeError::class); $this->memberships->getMemberships(); } public function testAccessors():void { $membership = $this->createMock(MemberCollectionSourceInterface::class); $this->assertNull($this->memberships->setMemberships(new ArrayCollection([$membership]))); $this->assertEquals($this->memberships->getMemberships()->get(0), $membership); } }