/** * @expectedException \InvalidArgumentException */ public function testSubbedMethodThrowsException() { $mock = Mokka::mock('\\Mokka\\Tests\\Integration\\Fixtures\\SampleClass'); Mokka::when($mock)->setBar()->thenThrow(new \InvalidArgumentException()); $mock->setBar(); }
public function testWhenReturnsMock() { $mock = new MockStub(); $this->assertSame($mock, $this->_mokka->when($mock)); }