Permalink
Browse files

Initial clean up of Proem class.

  • Loading branch information...
1 parent 1db7538 commit 1bec82d1f1a02a2d4834c7e0b787f4869c91b79d @trq trq committed Feb 7, 2013
Showing with 12 additions and 21 deletions.
  1. +0 −7 lib/Proem/Proem.php
  2. +12 −14 tests/ProemTest.php
View
@@ -71,13 +71,6 @@ public function __construct(AssetManagerInterface $assetManager = null)
public function getEventManager()
{
-
- var_dump($this->assetManager);
- var_dump($this->assetManager->resolve('eventManager') === $this->assetManager->resolve('eventManager'));
- //$this->assetManager->resolve('eventManager');
- var_dump($this->assetManager);
- var_dump($this->assetManager->resolve('eventManager') === $this->assetManager->resolve('eventManager'));
- var_dump($this->assetManager);
return $this->assetManager->resolve('eventManager');
}
View
@@ -35,14 +35,13 @@ public function testCanInstantiateProem()
{
$assetManager = m::mock('\Proem\Service\AssetManagerInterface');
$assetManager
- ->shouldReceive('alias')
+ ->shouldReceive('singleton')
->once()
- ->with([
- 'Proem\Signal\EventManagerInterface' => 'Proem\Signal\EventManager',
- 'eventManager' => 'Proem\Signal\EventManagerInterface',
- 'Proem\Filter\ChainManagerInterface' => 'Proem\Filter\ChainManager',
- 'chainManager' => 'Proem\Filter\ChainManagerInterface'
- ]);
+ ->with(['eventManager' => '\Proem\Signal\EventManager'])
+
+ ->shouldReceive('singleton')
+ ->once()
+ ->with(['chainManager' => '\Proem\Filter\ChainManager']);
$this->assertInstanceOf('Proem\Proem', new Proem($assetManager));
}
@@ -70,14 +69,13 @@ public function testLoadsDefaultEventManager()
$assetManager = m::mock('\Proem\Service\AssetManagerInterface');
$assetManager
- ->shouldReceive('alias')
+ ->shouldReceive('singleton')
+ ->once()
+ ->with(['eventManager' => '\Proem\Signal\EventManager'])
+
+ ->shouldReceive('singleton')
->once()
- ->with([
- 'Proem\Signal\EventManagerInterface' => 'Proem\Signal\EventManager',
- 'eventManager' => 'Proem\Signal\EventManagerInterface',
- 'Proem\Filter\ChainManagerInterface' => 'Proem\Filter\ChainManager',
- 'chainManager' => 'Proem\Filter\ChainManagerInterface'
- ])
+ ->with(['chainManager' => '\Proem\Filter\ChainManager'])
->shouldReceive('resolve')
->once()

0 comments on commit 1bec82d

Please sign in to comment.