public function Framework_MockObjectTest::testMockClassDifferentForPartialMocks

File

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

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 testMockClassDifferentForPartialMocks() {
  $mock1 = $this
    ->getMock('PartialMockTestClass');
  $mock2 = $this
    ->getMock('PartialMockTestClass', array(
    'doSomething',
  ));
  $mock3 = $this
    ->getMock('PartialMockTestClass', array(
    'doSomething',
  ));
  $mock4 = $this
    ->getMock('PartialMockTestClass', array(
    'doAnotherThing',
  ));
  $mock5 = $this
    ->getMock('PartialMockTestClass', array(
    'doAnotherThing',
  ));
  $this
    ->assertNotEquals(get_class($mock1), get_class($mock2));
  $this
    ->assertNotEquals(get_class($mock1), get_class($mock3));
  $this
    ->assertNotEquals(get_class($mock1), get_class($mock4));
  $this
    ->assertNotEquals(get_class($mock1), get_class($mock5));
  $this
    ->assertEquals(get_class($mock2), get_class($mock3));
  $this
    ->assertNotEquals(get_class($mock2), get_class($mock4));
  $this
    ->assertNotEquals(get_class($mock2), get_class($mock5));
  $this
    ->assertEquals(get_class($mock4), get_class($mock5));
}