protected function createApplication() { $app = new Application(); $app['debug'] = true; $app->register(new AsseticServiceProvider(), ['assetic.read_from' => __DIR__ . '/Resources', 'assetic.write_to' => __DIR__ . '/cache', 'assetic.cache_dir' => __DIR__ . '/cache']); $app->boot(); return $app; }
public function testRegisterServiceTypes() { $app = new Application(); $app->register(new ZendACLServiceProvider()); self::assertInternalType('array', $app['zend.acl.role_hierarchy']); self::assertInternalType('array', $app['zend.acl.resource_hierarchy']); self::assertInternalType('array', $app['zend.acl.access_control.allow']); self::assertInternalType('array', $app['zend.acl.access_control.deny']); self::assertInstanceOf('SilexCMF\\ZendACL\\Acl', $app['zend.acl']); }
public function testRemoveBeforeDispatch() { $service = $this->getMock('SilexCMF\\Core\\Tests\\Service'); $container = new Application(); $container['service.listener'] = Application::share(function () use($service) { return $service; }); $dispatcher = new PimpleAwareEventDispatcher(); $dispatcher->setContainer($container); $dispatcher->addListenerService('onEvent', ['service.listener', 'onEvent']); $dispatcher->removeListener('onEvent', [$container['service.listener'], 'onEvent']); static::assertFalse($dispatcher->hasListeners('onEvent')); }