Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Closes #100.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 5, 2012
1 parent b167e11 commit a0bfade
Show file tree
Hide file tree
Showing 28 changed files with 7 additions and 208 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ PHPUnit_MockObject 1.2

This is the list of changes for the PHPUnit_MockObject 1.2 release series.

PHPUnit_MockObject 1.2.2
------------------------

* Fixed #100: Removed the unique mock object ID introduced in version 1.2.

PHPUnit_MockObject 1.2.1
------------------------

Expand Down
4 changes: 0 additions & 4 deletions PHPUnit/Framework/MockObject/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ protected static function getObject($code, $className, $originalClassName = '',
);
}

if ($object instanceof PHPUnit_Framework_MockObject_MockObject) {
$object->__phpunit_setId();
}

return $object;
}

Expand Down
8 changes: 0 additions & 8 deletions PHPUnit/Framework/MockObject/Generator/mocked_class.tpl.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

{clone}{mocked_methods}
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
Expand Down Expand Up @@ -50,11 +48,5 @@
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}{epilogue}
10 changes: 0 additions & 10 deletions Tests/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ public function testGetMockGeneratorFails()
$mock = PHPUnit_Framework_MockObject_Generator::getMock('StdClass', array('foo', 'foo'));
}

/**
* @covers PHPUnit_Framework_MockObject_Generator::getObject
*/
public function testMockObjectHasUniqueIdSoThatTwoMockObjectsOfTheSameClassAreNotEqual()
{
$mock1 = PHPUnit_Framework_MockObject_Generator::getMock('stdClass');
$mock2 = PHPUnit_Framework_MockObject_Generator::getMock('stdClass');
$this->assertNotEquals($mock1, $mock2);
}

/**
* @covers PHPUnit_Framework_MockObject_Generator::getMockForAbstractClass
*/
Expand Down
8 changes: 0 additions & 8 deletions Tests/MockObject/class.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -126,11 +124,5 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}
8 changes: 0 additions & 8 deletions Tests/MockObject/class_call_parent_clone.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -79,12 +77,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}

8 changes: 0 additions & 8 deletions Tests/MockObject/class_call_parent_constructor.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -78,12 +76,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}

8 changes: 0 additions & 8 deletions Tests/MockObject/class_dont_call_parent_clone.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -78,12 +76,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}

8 changes: 0 additions & 8 deletions Tests/MockObject/class_dont_call_parent_constructor.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -78,12 +76,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -83,12 +81,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -83,12 +81,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}

8 changes: 0 additions & 8 deletions Tests/MockObject/class_partial.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -105,11 +103,5 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}
8 changes: 0 additions & 8 deletions Tests/MockObject/interface.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class MockFoo implements PHPUnit_Framework_MockObject_MockObject, Foo
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -99,11 +97,5 @@ class MockFoo implements PHPUnit_Framework_MockObject_MockObject, Foo
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}
8 changes: 0 additions & 8 deletions Tests/MockObject/invocation_object_clone_object.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -128,11 +126,5 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}
8 changes: 0 additions & 8 deletions Tests/MockObject/invocation_static_clone_object.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -128,11 +126,5 @@ class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}
8 changes: 0 additions & 8 deletions Tests/MockObject/namespaced_class.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -129,11 +127,5 @@ class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}
8 changes: 0 additions & 8 deletions Tests/MockObject/namespaced_class_call_parent_clone.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -81,12 +79,6 @@ class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -80,12 +78,6 @@ class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}

8 changes: 0 additions & 8 deletions Tests/MockObject/namespaced_class_dont_call_parent_clone.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
private $__phpunit_id;
private static $__phpunit_nextId = 0;

public function __clone()
{
Expand Down Expand Up @@ -80,12 +78,6 @@ class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
{
self::$__phpunit_staticInvocationMocker = NULL;
$this->__phpunit_invocationMocker = NULL;
$this->__phpunit_id = NULL;
}

public function __phpunit_setId()
{
$this->__phpunit_id = sprintf('%s#%s', get_class($this), self::$__phpunit_nextId++);
}
}

Loading

0 comments on commit a0bfade

Please sign in to comment.