You are here

public function Framework_MockObjectTest::testVerificationOfMethodNameFailsWithoutParameters in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php \Framework_MockObjectTest::testVerificationOfMethodNameFailsWithoutParameters()

File

vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php, line 527

Class

Framework_MockObjectTest
@since Class available since Release 3.0.0

Code

public function testVerificationOfMethodNameFailsWithoutParameters() {
  $mock = $this
    ->getMock('SomeClass', array(
    'right',
    'wrong',
  ), array(), '', true, true, true);
  $mock
    ->expects($this
    ->once())
    ->method('right');
  $mock
    ->wrong();
  try {
    $mock
      ->__phpunit_verify();
    $this
      ->fail('Expected exception');
  } catch (PHPUnit_Framework_ExpectationFailedException $e) {
    $this
      ->assertSame("Expectation failed for method name is equal to <string:right> when invoked 1 time(s).\n" . "Method was expected to be called 1 times, actually called 0 times.\n", $e
      ->getMessage());
  }
  $this
    ->resetMockObjects();
}