Skip to content

Commit

Permalink
Fix failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 10, 2012
1 parent 67743c8 commit 81208d1
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions lib/Cake/Test/Case/View/HelperTest.php
Expand Up @@ -193,6 +193,8 @@ class HelperTest extends CakeTestCase {
* @return void
*/
public function setUp() {
parent::setUp();

ClassRegistry::flush();
Router::reload();
$null = null;
Expand All @@ -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();
}

/**
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}

/**
Expand All @@ -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',
Expand Down Expand Up @@ -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),
Expand All @@ -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);
}

/**
Expand Down

0 comments on commit 81208d1

Please sign in to comment.