public function testInvocationProxyMethods() { $this->assertEquals(new Once(), Mokka::once()); $this->assertEquals(new AtLeast(3), Mokka::atLeast(3)); $this->assertEquals(new Exactly(2), Mokka::exactly(2)); $this->assertEquals(new AnythingArgument(), Mokka::anything()); $this->assertEquals(new Never(), Mokka::never()); }
public function testStubbedMethodWithAnythingParameter() { $mock = Mokka::mock('\\Mokka\\Tests\\Integration\\Fixtures\\SampleClass'); Mokka::when($mock)->setFoobar('foo', Mokka::anything())->thenReturn('bar'); $this->assertEquals('bar', $mock->setFoobar('foo', 'bar')); }
public function testVerifiesMethodWithAnythingParam() { $mock = Mokka::mock('\\Mokka\\Tests\\Integration\\Fixtures\\SampleClass'); Mokka::verify($mock)->setFoobar(Mokka::anything(), 'foo'); $this->assertNull($mock->setFoobar('bar', 'foo')); }