Skip to content

Commit

Permalink
Added unit test to Factory Class
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Jul 19, 2014
1 parent efbdc60 commit efd6b5b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/SlmQueue/Factory/QueueControllerPluginFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class QueueControllerPluginFactory implements FactoryInterface
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
$serviceLocator = $serviceLocator->getServiceLocator();
$queuePluginManager = $serviceLocator->get('SlmQueue\Queue\QueuePluginManager');
$jobPluginManager = $serviceLocator->get('SlmQueue\Job\JobPluginManager');

Expand Down
21 changes: 21 additions & 0 deletions tests/SlmQueueTest/Factory/QueueControllerPluginFactoryTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace SlmQueueTest\Factory;

use PHPUnit_Framework_TestCase as TestCase;
use SlmQueue\Factory\QueueControllerPluginFactory;
use SlmQueueTest\Util\ServiceManagerFactory;

class QueueControllerPluginFactoryTest extends TestCase
{

public function testCreateService()
{
$sm = ServiceManagerFactory::getServiceManager();
$factory = new QueueControllerPluginFactory();
$queueControllerPluginFactory = $factory->createService($sm);

$this->assertInstanceOf('SlmQueue\Controller\Plugin\QueuePlugin', $queueControllerPluginFactory);
}

}

0 comments on commit efd6b5b

Please sign in to comment.