public function setUp() { parent::setUp(); $this->_pluginPath = App::pluginPath('AssetCompress'); $this->testConfig = $this->_pluginPath . 'Test' . DS . 'test_files' . DS . 'Config' . DS . 'integration.ini'; $map = array( 'TEST_FILES/' => $this->_pluginPath . 'Test' . DS . 'test_files' . DS ); App::build(array( 'Plugin' => array($map['TEST_FILES/'] . 'Plugin' . DS ) )); CakePlugin::load('TestAssetIni'); AssetConfig::clearAllCachedKeys(); $config = AssetConfig::buildFromIniFile($this->testConfig, $map); $config->filters('js', null, array()); $this->Compressor = $this->getMock('AssetCompressor', array('_getConfig')); $this->Compressor->expects($this->atLeastOnce()) ->method('_getConfig') ->will($this->returnValue($config)); $this->request = new CakeRequest(null, false); $this->response = $this->getMock('CakeResponse', array('checkNotModified', 'type', 'send')); Configure::write('debug', 2); }
/** * start a test * * @return void */ public function setUp() { parent::setUp(); $this->_pluginPath = App::pluginPath('AssetCompress'); $this->_testFiles = $this->_pluginPath . 'Test' . DS . 'test_files' . DS; $testFile = $this->_testFiles . 'Config' . DS . 'config.ini'; AssetConfig::clearAllCachedKeys(); Cache::drop(AssetConfig::CACHE_CONFIG); Cache::config(AssetConfig::CACHE_CONFIG, array( 'path' => TMP, 'prefix' => 'asset_compress_test_', 'engine' => 'File' )); $controller = null; $request = new CakeRequest(null, false); $request->webroot = ''; $view = new View($controller); $view->request = $request; $this->Helper = new AssetCompressHelper($view, array('noconfig' => true)); $Config = AssetConfig::buildFromIniFile($testFile); $this->Helper->config($Config); $this->Helper->Html = new HtmlHelper($view); Router::reload(); Configure::write('debug', 2); }
/** * Create the configuration object used in other classes. * */ public function startup() { parent::startup(); AssetConfig::clearAllCachedKeys(); $this->_Config = AssetConfig::buildFromIniFile($this->params['config']); $this->AssetBuild->setThemes($this->_findThemes()); $this->out(); }
function setUp() { Cache::drop(AssetConfig::CACHE_CONFIG); Cache::config(AssetConfig::CACHE_CONFIG, array('engine' => 'File')); $this->_pluginPath = App::pluginPath('AssetCompress'); $this->testConfig = $this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'config' . DS . 'config.ini'; AssetConfig::clearAllCachedKeys(); $this->config = AssetConfig::buildFromIniFile($this->testConfig); }
function setUp() { $this->_pluginPath = App::pluginPath('AssetCompress'); $testFile = $this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'config' . DS . 'config.ini'; AssetConfig::clearAllCachedKeys(); $this->config = AssetConfig::buildFromIniFile($testFile); $this->config->paths('js', array($this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'js' . DS, $this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'js' . DS . '*')); $this->config->paths('css', array($this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'css' . DS, $this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'css' . DS . '*')); $this->Compiler = new AssetCompiler($this->config); }
/** * Create the configuration object used in other classes. * */ public function startup() { parent::startup(); $config = null; if (isset($this->params['config'])) { $config = $this->params['config']; } AssetConfig::clearAllCachedKeys(); $this->_Config = AssetConfig::buildFromIniFile($config); }
public function setUp() { parent::setUp(); Cache::drop(AssetConfig::CACHE_CONFIG); Cache::config(AssetConfig::CACHE_CONFIG, array('engine' => 'File')); $this->_pluginPath = App::pluginPath('AssetCompress'); $this->_testFiles = App::pluginPath('AssetCompress') . 'Test' . DS . 'test_files' . DS; $this->testConfig = $this->_testFiles . 'Config' . DS . 'config.ini'; $this->_themeConfig = $this->_testFiles . 'Config' . DS . 'themed.ini'; AssetConfig::clearAllCachedKeys(); $this->config = AssetConfig::buildFromIniFile($this->testConfig); }
/** * start a test * * @return void **/ function startTest() { $this->_pluginPath = App::pluginPath('AssetCompress'); $testFile = $this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'config' . DS . 'config.ini'; AssetConfig::clearAllCachedKeys(); $this->Helper = new AssetCompressHelper(array('noconfig' => true)); $Config = AssetConfig::buildFromIniFile($testFile); $this->Helper->config($Config); $this->Helper->Html = new HtmlHelper(); Router::reload(); Configure::write('debug', 2); }
public function setUp() { parent::setUp(); $out = $this->getMock('ConsoleOutput', array(), array(), '', false); $in = $this->getMock('ConsoleInput', array(), array(), '', false); $this->Task = $this->getMock('AssetBuildTask', array('in', 'err', 'createFile', '_stop', 'clear'), array($out, $out, $in)); $this->_pluginPath = App::pluginPath('AssetCompress'); $this->testFilePath = $this->_pluginPath . 'Test/test_files/View/Parse/'; $this->testConfig = $this->_pluginPath . 'Test' . DS . 'test_files' . DS . 'Config' . DS . 'config.ini'; AssetConfig::clearAllCachedKeys(); $this->config = AssetConfig::buildFromIniFile($this->testConfig); $this->Task->setConfig($this->config); }
function setUp() { parent::setUp(); $this->Dispatcher =& new TestAssetBuildTaskMockShellDispatcher(); $this->Task =& new MockAssetBuildTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Dispatch->shellPaths = App::path('shells'); $this->_pluginPath = App::pluginPath('AssetCompress'); $this->testFilePath = $this->_pluginPath . 'tests/test_files/views/'; $this->testConfig = $this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'config' . DS . 'config.ini'; AssetConfig::clearAllCachedKeys(); $this->config = AssetConfig::buildFromIniFile($this->testConfig); $this->Task->setConfig($this->config); }
public function setUp() { parent::setUp(); $this->_pluginPath = App::pluginPath('AssetCompress'); $this->_testFiles = App::pluginPath('AssetCompress') . 'Test' . DS . 'test_files' . DS; $this->_themeConfig = $this->_testFiles . 'Config' . DS . 'themed.ini'; $this->_pluginConfig = $this->_testFiles . 'Config' . DS . 'plugins.ini'; $testFile = $this->_testFiles . 'Config' . DS . 'config.ini'; AssetConfig::clearAllCachedKeys(); $this->config = AssetConfig::buildFromIniFile($testFile); $this->config->paths('js', null, array($this->_testFiles . 'js' . DS, $this->_testFiles . 'js' . DS . '*')); $this->config->paths('css', null, array($this->_testFiles . 'css' . DS, $this->_testFiles . 'css' . DS . '*')); $this->Compiler = new AssetCompiler($this->config); }
function setUp() { parent::setUp(); $this->_pluginPath = App::pluginPath('AssetCompress'); $this->testConfig = $this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'config' . DS . 'integration.ini'; $map = array('TEST_FILES/' => $this->_pluginPath . 'tests' . DS . 'test_files' . DS); AssetConfig::clearAllCachedKeys(); $config = AssetConfig::buildFromIniFile($this->testConfig, $map); $config->filters('js', null, array()); $this->Controller = new TestAssetsController(); $this->Controller->constructClasses(); $this->Controller->_Config = $config; $this->_debug = Configure::read('debug'); }
function setUp() { parent::setUp(); $this->_pluginPath = App::pluginPath('AssetCompress'); $this->testConfig = $this->_pluginPath . 'Test' . DS . 'test_files' . DS . 'Config' . DS . 'integration.ini'; $map = array('TEST_FILES/' => $this->_pluginPath . 'Test' . DS . 'test_files' . DS); AssetConfig::clearAllCachedKeys(); $config = AssetConfig::buildFromIniFile($this->testConfig, $map); $config->filters('js', null, array()); $this->Controller = $this->getMock('AssetsController', array('render'), array(new CakeRequest(null, false), new CakeResponse())); $this->Controller->constructClasses(); $this->Controller->response = $this->getMock('CakeResponse'); $this->Controller->_Config = $config; $this->_debug = Configure::read('debug'); }