has() public méthode

public has ( Nelmio\Alice\FixtureIdInterface $fixture ) : boolean
$fixture Nelmio\Alice\FixtureIdInterface
Résultat boolean
Exemple #1
0
 public function testReadAccessorsReturnPropertiesValues()
 {
     $bag = new ObjectBag(['user1' => new \stdClass(), 'group1' => new \stdClass()]);
     $user1Fixture = $this->createFixture('user1', \stdClass::class);
     $group1Fixture = $this->createFixture('group1', \stdClass::class);
     $inexistingReference = $this->createFixture('unknown', 'Dummy');
     $this->assertTrue($bag->has($user1Fixture));
     $this->assertEquals(new CompleteObject(new SimpleObject('user1', new \stdClass())), $bag->get($user1Fixture));
     $this->assertTrue($bag->has($group1Fixture));
     $this->assertEquals(new CompleteObject(new SimpleObject('group1', new \stdClass())), $bag->get($group1Fixture));
     $this->assertFalse($bag->has($inexistingReference));
 }