Allows to pass options as array.
public setOptions ( array $options ) : |
||
$options | array | |
return |
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); } }