function testBadArgParameter()
 {
     $mock = new MockDummyWithInjectedTestCase();
     $mock->expectArguments("aMethod", "foo");
     $this->assertErrorPattern('/\\$args.*not an array/i');
     $mock->aMethod();
     $mock->tally();
     $mock->atTestEnd('testSomething', $this->test);
 }
Ejemplo n.º 2
0
 function testNonArrayForExpectedParametersGivesError()
 {
     $mock = new MockDummyWithInjectedTestCase();
     $this->expectError(new PatternExpectation('/\\$args.*not an array/i'));
     $mock->expect("aMethod", "foo");
     $mock->aMethod();
     $mock->mock->atTestEnd('testSomething', $this->test);
 }
Ejemplo n.º 3
0
 public function testNonArrayForExpectedParametersGivesError()
 {
     $mock = new MockDummyWithInjectedTestCase();
     $this->expectError(new PatternExpectation('/foo is not an array/i'));
     $mock->expect('aMethod', 'foo');
     $mock->aMethod();
     $mock->mock->atTestEnd('testSomething', $this->test);
 }