Example #1
0
 public function testAllowsCombinationOfMockAndStub()
 {
     Mokka::verify($this->_mock)->setBar();
     Mokka::when($this->_mock)->setBar()->thenReturn(TRUE);
     $this->assertTrue($this->_mock->setBar());
 }
Example #2
0
 /**
  * @param MockInterface $mock
  * @param InvokationRule|NULL|int $expectedInvokationCount
  * @throws \InvalidArgumentException
  * @return MockInterface
  */
 public static function verify(MockInterface $mock, $expectedInvokationCount = null)
 {
     $mock->listenForVerification($expectedInvokationCount);
     return $mock;
 }