supports() public method

public supports ( $object, $graph = 'default' )
Esempio n. 1
0
 public function testSupports()
 {
     $object = $this->getMock('Finite\\StatefulInterface', array(), array(), 'Stateful1');
     $object2 = $this->getMock('Finite\\StatefulInterface', array(), array(), 'Stateful2');
     $this->assertTrue($this->object->supports($object));
     $this->assertFalse($this->object->supports($object2));
 }
Esempio n. 2
0
 public function testSupports()
 {
     $object = $this->getMock('Finite\\StatefulInterface', array(), array(), 'Stateful1');
     $object2 = $this->getMock('Finite\\StatefulInterface', array(), array(), 'Stateful2');
     $this->assertTrue($this->object->supports($object));
     $this->assertFalse($this->object->supports($object2));
     $alternativeLoader = new ArrayLoader(array('class' => 'Stateful1', 'graph' => 'foobar'));
     $this->assertTrue($alternativeLoader->supports($object, 'foobar'));
     $this->assertFalse($alternativeLoader->supports($object));
 }