Skip to content

Instantly share code, notes, and snippets.

@trq
Created December 10, 2012 11:47
Show Gist options
  • Save trq/4250165 to your computer and use it in GitHub Desktop.
Save trq/4250165 to your computer and use it in GitHub Desktop.
use \Mockery as m;
class ChainEventTest extends \PHPUnit_Framework_TestCase
{
public function testCanInstantiate()
{
$this->assertInstanceOf('Proem\Filter\ChainEventInterface', m::mock('Proem\Filter\ChainEventInterface'));
}
public function testInAndOutAreCalledOnInit()
{
$chainEvent = m::mock('Proem\Filter\ChainEventAbstract');
$chainEvent
->shouldReceive('in')
->with('Proem\Service\AssetManagerInterface')
->once();
$chainEvent
->shouldReceive('out')
->with(m::mock('Proem\Service\AssetManagerInterface'))
->once();
$chainManager = m::mock('Proem\Filter\ChainManagerInterface');
$chainManager
->shouldReceive('getAssetManager')
->once()
->andReturn(m::mock('Proem\Service\AssetManagerInterface'));
$chainEvent->init($chainManager);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment