コード例 #1
0
 function testSpecificSequence()
 {
     $mock = new MockDummyWithInjectedTestCase();
     $mock->expectArgumentsAt(1, "aMethod", array(1, 2, 3));
     $mock->expectArgumentsAt(2, "aMethod", array("Hello"));
     $mock->aMethod();
     $mock->aMethod(1, 2, 3);
     $mock->aMethod("Hello");
     $mock->aMethod();
     $mock->atTestEnd('testSomething', $this->test);
 }
コード例 #2
0
ファイル: mock_objects_test.php プロジェクト: Zunair/xataface
 function testFailedSequence()
 {
     $this->test->expectArguments("assertTrue", array(false, "*"));
     $this->test->expectCallCount("assertTrue", 2);
     $mock = new MockDummyWithInjectedTestCase();
     $mock->expectArgumentsAt(0, "aMethod", array(1, 2, 3));
     $mock->expectArgumentsAt(1, "aMethod", array("Hello"));
     $mock->aMethod(1, 2);
     $mock->aMethod("Goodbye");
     $mock->atTestEnd('testSomething');
 }