public function testVerifyLetsMockListen() { $mock = $this->getMock('\\Mokka\\Mock\\MockInterface'); $mock->expects($this->once())->method('listenForVerification'); $this->_mokka->verify($mock); }
/** * @expectedException \Mokka\VerificationException */ public function testThrowsExceptionIfCombinedMockAndStubWasNotCalled() { Mokka::verify($this->_mock)->setBar(); Mokka::when($this->_mock)->setBar()->thenReturn(TRUE); unset($this->_mock); }
/** * @expectedException \Mokka\VerificationException */ public function testVerifiesThatMethodWasNotCalled() { $mock = Mokka::mock('\\Mokka\\Tests\\Integration\\Fixtures\\SampleClass'); Mokka::verify($mock, new Never())->setBar(); $mock->setBar(); }