Created
December 10, 2012 11:47
-
-
Save trq/4250165 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
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