Permalink
Browse files

Fix failing test.

  • Loading branch information...
1 parent 67743c8 commit 81208d1fa71f10865a7742d5d3bf46badb298f13 @markstory markstory committed Apr 10, 2012
Showing with 6 additions and 13 deletions.
  1. +6 −13 lib/Cake/Test/Case/View/HelperTest.php
@@ -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 @@ public function setUp() {
* @return void
*/
public function tearDown() {
+ parent::tearDown();
+ Configure::delete('Asset');
+
CakePlugin::unload();
unset($this->Helper, $this->View);
- ClassRegistry::flush();
}
/**
@@ -565,9 +569,7 @@ public function testUrlConversion() {
* @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 @@ public function testAssetTimestamp() {
$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 @@ public function testAssetTimestamp() {
*/
public function testAssetUrl() {
$this->Helper->webroot = '';
- $_timestamp = Configure::read('Asset.timestamp');
-
$result = $this->Helper->assetUrl(array(
'controller' => 'js',
'action' => 'post',
@@ -666,7 +663,6 @@ public function testAssetUrlTimestampForce() {
* @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 @@ public function testAssetTimestampPluginsAndThemes() {
$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);
}
/**

0 comments on commit 81208d1

Please sign in to comment.