Skip to content

Instantly share code, notes, and snippets.

@gries
Created January 11, 2012 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gries/1593636 to your computer and use it in GitHub Desktop.
Save gries/1593636 to your computer and use it in GitHub Desktop.
mocking a doctrine getter the wrong way
<?php
class fooTest extends PHPUnit_Framework_TestCase
{
public function testBar()
{
$builder = $this->getMockBuilder('SomeDoctrineRecordClass')->disableOriginalConstructor();
$mockObject = $builder->getMock();
$mockObject->expects($this->any())
->method('getProperty')
->will($this->returnValue(true));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment