You are here

public function Framework_MockObjectTest::testMockClassDifferentForPartialMocks in Zircon Profile 8.0

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

File

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

Class

Framework_MockObjectTest
@since Class available since Release 3.0.0

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