Skip to content

Commit

Permalink
Mock class that exists
Browse files Browse the repository at this point in the history
This is a workaround for a phpunit mock objects bug.
  • Loading branch information
greg0ire committed Aug 25, 2016
1 parent f6234f2 commit 263a17e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tests/Admin/FieldDescriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function testHasAssociationAdmin()

public function testGetValue()
{
$mockedObject = $this->getMock('MockedTestObject', array('myMethod'));
$mockedObject = $this->getMock('stdClass', array('myMethod'));
$mockedObject->expects($this->once())
->method('myMethod')
->will($this->returnValue('myMethodValue'));
Expand All @@ -206,7 +206,7 @@ public function testGetValue()
*/
public function testGetValueWhenCannotRetrieve()
{
$mockedObject = $this->getMock('MockedTestObject', array('myMethod'));
$mockedObject = $this->getMock('stdClass', array('myMethod'));
$mockedObject->expects($this->never())
->method('myMethod')
->will($this->returnValue('myMethodValue'));
Expand Down Expand Up @@ -333,12 +333,12 @@ public function testGetFieldMapping()

public function testGetValueForEmbeddedObject()
{
$mockedEmbeddedObject = $this->getMock('MockedTestObject', array('myMethod'));
$mockedEmbeddedObject = $this->getMock('stdClass', array('myMethod'));
$mockedEmbeddedObject->expects($this->once())
->method('myMethod')
->will($this->returnValue('myMethodValue'));

$mockedObject = $this->getMock('MockedTestObject', array('getMyEmbeddedObject'));
$mockedObject = $this->getMock('stdClass', array('getMyEmbeddedObject'));
$mockedObject->expects($this->once())
->method('getMyEmbeddedObject')
->will($this->returnValue($mockedEmbeddedObject));
Expand Down

0 comments on commit 263a17e

Please sign in to comment.