Created
May 29, 2012 08:45
-
-
Save hnw/2823345 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Generated by PHPUnit_SkeletonGenerator on 2012-05-29 at 16:47:11. | |
*/ | |
class RecentText extends PHPUnit_Framework_TestCase | |
{ | |
/** | |
* @var Recent | |
*/ | |
protected $object; | |
/** | |
* Sets up the fixture, for example, opens a network connection. | |
* This method is called before a test is executed. | |
*/ | |
protected function setUp() | |
{ | |
/* | |
$this->object = new Recent(new Getter); | |
*/ | |
/* | |
$stub = $this->getMock('Getter'); | |
$stub->expects($this->any()) | |
->method('get') | |
->will($this->returnValue(array('1','2','3'))); | |
*/ | |
$this->getterStub = Phake::partialMock('Getter'); | |
$this->object = new Recent($this->getterStub); | |
} | |
/** | |
* Tears down the fixture, for example, closes a network connection. | |
* This method is called after a test is executed. | |
*/ | |
protected function tearDown() | |
{ | |
} | |
/** | |
* @covers Recent::getList | |
* @todo Implement testGetList(). | |
*/ | |
public function testGetList() | |
{ | |
Phake::when($this->getterStub)->get()->thenReturn(array('1','2','3')); | |
$this->assertCount(3, $this->object->getList()); | |
Phake::verify($this->getterStub)->get(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment