Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hnw
Created May 29, 2012 08:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hnw/2823345 to your computer and use it in GitHub Desktop.
Save hnw/2823345 to your computer and use it in GitHub Desktop.
<?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