コード例 #1
0
ファイル: MokkaTest.php プロジェクト: belanur/mokka
 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());
 }
コード例 #2
0
ファイル: MockTest.php プロジェクト: belanur/mokka
 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'));
 }
コード例 #3
0
 public function testVerifiesMethodWithAnythingParam()
 {
     $mock = Mokka::mock('\\Mokka\\Tests\\Integration\\Fixtures\\SampleClass');
     Mokka::verify($mock)->setFoobar(Mokka::anything(), 'foo');
     $this->assertNull($mock->setFoobar('bar', 'foo'));
 }