Browse Source

Test for overruling `Asset.timestamp` when generating assetUrls.

Joshua Lückers 8 years ago
parent
commit
2cf26fa555
1 changed files with 10 additions and 0 deletions
  1. 10 0
      tests/TestCase/View/Helper/UrlHelperTest.php

+ 10 - 0
tests/TestCase/View/Helper/UrlHelperTest.php

@@ -254,6 +254,16 @@ class UrlHelperTest extends TestCase
         $this->assertRegExp('/' . preg_quote(Configure::read('App.cssBaseUrl') . 'cake.generic.css?', '/') . '[0-9]+/', $result);
     }
 
+    public function testAssetTimestampConfigureOverride()
+    {
+        $this->Helper->webroot = '';
+        Configure::write('Asset.timestamp', 'force');
+        $timestamp = false;
+
+        $result = $this->Helper->assetTimestamp(Configure::read('App.cssBaseUrl') . 'cake.generic.css', $timestamp);
+        $this->assertEquals(Configure::read('App.cssBaseUrl') . 'cake.generic.css', $result);
+    }
+
     /**
      * test assetTimestamp with plugins and themes
      *