You are here

public function Framework_MockObjectTest::testVerificationOfNeverFailsWithAnyParameters in Zircon Profile 8.0

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

File

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

Class

Framework_MockObjectTest
@since Class available since Release 3.0.0

Code

public function testVerificationOfNeverFailsWithAnyParameters() {
  $mock = $this
    ->getMock('SomeClass', array(
    'right',
    'wrong',
  ), array(), '', true, true, true);
  $mock
    ->expects($this
    ->never())
    ->method('right')
    ->withAnyParameters();
  try {
    $mock
      ->right();
    $this
      ->fail('Expected exception');
  } catch (PHPUnit_Framework_ExpectationFailedException $e) {
    $this
      ->assertSame('SomeClass::right() was not expected to be called.', $e
      ->getMessage());
  }
  $this
    ->resetMockObjects();
}