mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix failing test.
This commit is contained in:
parent
67743c8079
commit
81208d1fa7
1 changed files with 6 additions and 13 deletions
|
@ -193,6 +193,8 @@ class HelperTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
ClassRegistry::flush();
|
||||
Router::reload();
|
||||
$null = null;
|
||||
|
@ -215,9 +217,11 @@ class HelperTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function tearDown() {
|
||||
parent::tearDown();
|
||||
Configure::delete('Asset');
|
||||
|
||||
CakePlugin::unload();
|
||||
unset($this->Helper, $this->View);
|
||||
ClassRegistry::flush();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -565,9 +569,7 @@ class HelperTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testAssetTimestamp() {
|
||||
$_timestamp = Configure::read('Asset.timestamp');
|
||||
$_debug = Configure::read('debug');
|
||||
|
||||
Configure::write('Foo.bar', 'test');
|
||||
Configure::write('Asset.timestamp', false);
|
||||
$result = $this->Helper->assetTimestamp(CSS_URL . 'cake.generic.css');
|
||||
$this->assertEquals(CSS_URL . 'cake.generic.css', $result);
|
||||
|
@ -593,9 +595,6 @@ class HelperTest extends CakeTestCase {
|
|||
$this->Helper->request->webroot = '/some/dir/';
|
||||
$result = $this->Helper->assetTimestamp('/some/dir/' . CSS_URL . 'cake.generic.css');
|
||||
$this->assertRegExp('/' . preg_quote(CSS_URL . 'cake.generic.css?', '/') . '[0-9]+/', $result);
|
||||
|
||||
Configure::write('debug', $_debug);
|
||||
Configure::write('Asset.timestamp', $_timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -605,8 +604,6 @@ class HelperTest extends CakeTestCase {
|
|||
*/
|
||||
public function testAssetUrl() {
|
||||
$this->Helper->webroot = '';
|
||||
$_timestamp = Configure::read('Asset.timestamp');
|
||||
|
||||
$result = $this->Helper->assetUrl(array(
|
||||
'controller' => 'js',
|
||||
'action' => 'post',
|
||||
|
@ -666,7 +663,6 @@ class HelperTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testAssetTimestampPluginsAndThemes() {
|
||||
$timestamp = Configure::read('Asset.timestamp');
|
||||
Configure::write('Asset.timestamp', 'force');
|
||||
App::build(array(
|
||||
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
|
||||
|
@ -684,9 +680,6 @@ class HelperTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Helper->assetTimestamp('/theme/test_theme/js/non_existant.js');
|
||||
$this->assertRegExp('#/theme/test_theme/js/non_existant.js\?$#', $result, 'No error on missing file');
|
||||
|
||||
App::build();
|
||||
Configure::write('Asset.timestamp', $timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue