public function Framework_MockObjectTest::testVerificationOfMethodNameFailsWithParameters

File

drupal/core/vendor/phpunit/phpunit-mock-objects/Tests/MockObjectTest.php, line 507

Class

Framework_MockObjectTest
@package PHPUnit_MockObject @author Sebastian Bergmann <sb@sebastian-bergmann.de> @author Patrick Mueller <elias0@gmx.net> @author Frank Kleine <mikey@stubbles.net> @copyright 2010-2013 Sebastian Bergmann…

Code

public function testVerificationOfMethodNameFailsWithParameters() {
  $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.', $e
      ->getMessage());
  }
  $this
    ->resetMockObjects();
}