Example #1
0
 /**
  * Tests setting a stub on a method in the stubbable object
  */
 public function testIsCalledOn()
 {
     $mock = $this->getMock('Phake_IMock');
     $this->obj->recordCall(new Phake_CallRecorder_Call($mock, '__call', array('foo', array()), new Phake_MockReader()));
     $verifier = $this->proxy->isCalledOn($mock);
     $this->assertEquals(1, count($verifier));
 }
 public function testStaticIsCalledOn()
 {
     $matcher1 = new Phake_Matchers_EqualsMatcher('foo', new \SebastianBergmann\Comparator\Factory());
     $matcher2 = new Phake_Matchers_EqualsMatcher(array(), new \SebastianBergmann\Comparator\Factory());
     $matcher1->setNextMatcher($matcher2);
     $this->proxy = new Phake_Proxies_CallVerifierProxy($matcher1, $this->client, true);
     $mock = Phake::mock('PhakeTest_MagicClass');
     $mock::foo();
     $verifier = $this->proxy->isCalledOn($mock);
     $this->assertEquals(1, count($verifier));
 }