Browse Source

Test for overruling `Asset.timestamp` when generating script URLs.

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

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

@@ -328,6 +328,20 @@ class UrlHelperTest extends TestCase
     }
 
     /**
+     * Test script with timestamp option overriding `Asset.timestamp` in Configure
+     *
+     * @return void
+     */
+    public function testScriptTimestampConfigureOverride()
+    {
+        Configure::write('Asset.timestamp', 'force');
+        $timestamp = false;
+
+        $result = $this->Helper->script('script.js', ['timestamp' => $timestamp]);
+        $this->assertEquals(Configure::read('App.jsBaseUrl').'script.js', $result);
+    }
+
+    /**
      * test image()
      *
      * @return void