コード例 #1
0
ファイル: MokkaTest.php プロジェクト: belanur/mokka
 public function testVerifyLetsMockListen()
 {
     $mock = $this->getMock('\\Mokka\\Mock\\MockInterface');
     $mock->expects($this->once())->method('listenForVerification');
     $this->_mokka->verify($mock);
 }
コード例 #2
0
ファイル: MockTest.php プロジェクト: belanur/mokka
 /**
  * @expectedException \Mokka\VerificationException
  */
 public function testThrowsExceptionIfCombinedMockAndStubWasNotCalled()
 {
     Mokka::verify($this->_mock)->setBar();
     Mokka::when($this->_mock)->setBar()->thenReturn(TRUE);
     unset($this->_mock);
 }
コード例 #3
0
 /**
  * @expectedException \Mokka\VerificationException
  */
 public function testVerifiesThatMethodWasNotCalled()
 {
     $mock = Mokka::mock('\\Mokka\\Tests\\Integration\\Fixtures\\SampleClass');
     Mokka::verify($mock, new Never())->setBar();
     $mock->setBar();
 }