<?php $app = new Silex\Application(); $app['debug'] = true; $app['app_path'] = __DIR__ . '/..'; $app->register(new Herrera\Wise\WiseServiceProvider(), ['wise.cache_dir' => __DIR__ . '/../App/Config/Cache', 'wise.path' => __DIR__ . '/../App/Config', 'wise.options' => ['parameters' => $app, 'mode' => 'prod', 'type' => 'yml', 'config' => ['services' => 'services']]]); \Herrera\Wise\WiseServiceProvider::registerServices($app); $app['twig']->addExtension(new \Entea\Twig\Extension\AssetExtension($app)); $app->mount('/', new App\Controller\MainController()); return $app;
public function testRegisterServicesNull() { file_put_contents('services.json', json_encode(array('parameters' => array('test_parameter' => 123), 'test_1' => array('class' => 'Herrera\\Wise\\Test\\Service', 'parameters' => array('test.parameter' => '%test_parameter%')), 'test_2' => array('class' => 'Herrera\\Wise\\Test\\Service')))); file_put_contents('services_test.json', json_encode(array('imports' => array(array('resource' => 'services.json')), 'test_1' => null))); /** @var $wise \Herrera\Wise\Wise */ $wise = $this->app['wise']; $wise->setGlobalParameters($this->app); $this->app['wise.options']['mode'] = 'test'; WiseServiceProvider::registerServices($this->app); $this->assertSame(1, $this->app['test.service']); $this->assertFalse(isset($this->app['test.parameter'])); }