Skip to content

Commit 6b708a2

Browse files
committed
minor fixes
1 parent be5467a commit 6b708a2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

DependencyInjection/MathielenImportEngineExtension.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
namespace Mathielen\ImportEngineBundle\DependencyInjection;
33

4+
use Mathielen\ImportEngine\Exception\InvalidConfigurationException;
45
use Symfony\Component\DependencyInjection\ContainerBuilder;
56
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
67
use Symfony\Component\DependencyInjection\Extension\Extension;
@@ -217,6 +218,8 @@ private function addStorageProviderDef(Definition $storageLocatorDef, $config, $
217218
array($config['queries'])
218219
));
219220
break;
221+
default:
222+
throw new InvalidConfigurationException('Unknown type for storage provider: '.$config['type']);
220223
}
221224

222225
$storageLocatorDef->addMethodCall('register', array(
@@ -256,6 +259,8 @@ private function getStorageDef(array $config, Definition $objectFactoryDef=null)
256259
));
257260

258261
break;
262+
default:
263+
throw new InvalidConfigurationException('Unknown type for storage: '.$config['type']);
259264
}
260265

261266
return $storageDef;

Tests/DependencyInjection/AbstractExtensionTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
namespace Mathielen\ImportEngineBundle\Tests\DependencyInjection;
33

44
use Mathielen\ImportEngineBundle\DependencyInjection\MathielenImportEngineExtension;
5-
use MyProject\Proxies\__CG__\stdClass;
65
use Symfony\Component\DependencyInjection\ContainerBuilder;
76

87
abstract class AbstractExtensionTest extends \PHPUnit_Framework_TestCase
@@ -46,7 +45,7 @@ public function testWithoutConfiguration()
4645

4746
public function testFullConfiguration()
4847
{
49-
$this->container->register('import_service', new \stdClass()); //target service
48+
$this->container->register('import_service', new MyImportService()); //target service
5049
$this->container->register('jms_serializer', $this->getMock('JMS\Serializer\SerializerInterface'));
5150
$this->container->register('validator', $this->getMock('Symfony\Component\Validator\ValidatorInterface'));
5251
$this->container->register('doctrine.orm.entity_manager', $this->getMock('Doctrine\ORM\EntityManagerInterface'));
@@ -64,3 +63,7 @@ public function testMinimumConfiguration()
6463
}
6564

6665
}
66+
67+
class MyImportService
68+
{
69+
}

0 commit comments

Comments
 (0)