Author: Jan Sorgalla (jan.sorgalla@dotsunited.de)
Exemple #1
0
 public function testEndWithoutSettingDocRootFirstShouldThrowException()
 {
     $this->setExpectedException('\\RuntimeException', 'Please set a document root either with setDocRoot() or via runtime through bundle options.');
     $bundle = new Bundle();
     $bundle->start();
     $bundle->end();
 }
Exemple #2
0
 public function testSetOptions()
 {
     $options = array('name' => 'testbundle', 'doc_root' => '/my/custom/docroot', 'bypass' => true, 'force' => true, 'render_as_xhtml' => true, 'css_filter' => $this->getMock('\\DotsUnited\\BundleFu\\Filter\\FilterInterface'), 'js_filter' => $this->getMock('\\DotsUnited\\BundleFu\\Filter\\FilterInterface'), 'css_cache_path' => 'css/cache/path', 'js_cache_path' => 'js/cache/path', 'css_cache_url' => 'css/cache/url', 'js_cache_url' => 'js/cache/url', 'css_template' => '%s%s', 'js_template' => '%s%s');
     $bundle = new Bundle();
     $bundle->setOptions($options);
     foreach ($options as $key => $val) {
         $method = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
         $this->assertEquals($val, $bundle->{$method}(), ' -> ' . $key);
     }
 }
Exemple #3
0
 public function setUp()
 {
     $this->bundle = new Bundle();
     $this->bundle->setDocRoot(__DIR__ . '/_files');
 }
 protected function writeBundleFile($bundlePath, $data)
 {
     if ($this->hasFsDirectorySupport()) {
         throw new \UnexpectedValueException("This filesystem doesn't support directories.");
     }
     return parent::writeBundleFile($bundlePath, $data);
 }