Created
January 11, 2012 08:06
-
-
Save gries/1593659 to your computer and use it in GitHub Desktop.
mocking a doctrine getter the right way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class fooTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testBar() | |
{ | |
$builder = $this->getMockBuilder('SomeDoctrineRecordClass')->disableOriginalConstructor(); | |
$mockObject = $builder->getMock(); | |
$mockObject->expects($this->any()) | |
->method('__call') | |
->with($this->equalTo('getProperty'), $this->anything()) | |
->will($this->returnValue(true)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment