/** * Boots the Bundle. */ public function boot() { // load core classes ClassCollectionLoader::load($this->container->getParameter('kernel.compiled_classes'), $this->container->getParameter('kernel.cache_dir'), 'classes', $this->container->getParameter('kernel.debug'), true); if ($this->container->has('error_handler')) { $this->container->get('error_handler'); } if ($this->container->hasParameter('document_root')) { File::setDocumentRoot($this->container->getParameter('document_root')); } if (file_exists($this->container->getParameter('kernel.cache_dir') . '/autoload.php')) { $classloader = new MapFileClassLoader($this->container->getParameter('kernel.cache_dir') . '/autoload.php'); $classloader->register(true); } }
public function testGetWebPathReturnsEmptyPathIfOutsideDocumentRoot() { File::setDocumentRoot(__DIR__ . '/Fixtures/directory'); $this->assertEquals('', $this->file->getWebPath()); }
public function testSetDocumentRootThrowsLogicExceptionWhenNotExists() { $this->setExpectedException('LogicException'); File::setDocumentRoot(__DIR__ . '/Fixtures/not_here'); }