/** * @test */ public function shouldReturnServiceInfoWhenFindByIDPEntityIDIsCalledWithEntityID() { $expectedProviderID = 'main'; $col = new ServiceInfoCollection(); $ed_1 = $this->createEntityDescriptorStub($expectedEntityID_1 = 'entity_1'); $expectedIdpProvider_1 = $this->createEntityDescriptorProviderStub($ed_1); $expectedServiceInfo_1 = $this->createServiceInfoStub($expectedProviderID, $expectedIdpID_1 = 'idp_1', $expectedSpProvider = null, $expectedIdpProvider_1, null, null); $ed_2 = $this->createEntityDescriptorStub($expectedEntityID_2 = 'entity_2'); $expectedIdpProvider_2 = $this->createEntityDescriptorProviderStub($ed_2); $expectedServiceInfo_2 = $this->createServiceInfoStub($expectedProviderID, $expectedIdpID_2 = 'idp_2', $expectedSpProvider = null, $expectedIdpProvider_2, null, null); $col->add($expectedServiceInfo_1); $col->add($expectedServiceInfo_2); $this->assertEquals($expectedServiceInfo_1, $col->findByIDPEntityID($expectedEntityID_1)); $this->assertEquals($expectedServiceInfo_2, $col->findByIDPEntityID($expectedEntityID_2)); $this->assertNull($col->findByIDPEntityID('foo')); }