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); }
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); }
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); }