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(); }
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); } }
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); }