Browse Source

Check if a generated image url has a timestamp when `Asset.timestamp` = force.

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

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

@@ -343,6 +343,19 @@ class UrlHelperTest extends TestCase
     }
 
     /**
+     * Test image with `Asset.timestamp` = force
+     *
+     * @return void
+     */
+    public function testImageTimestampForce()
+    {
+        Configure::write('Asset.timestamp', 'force');
+
+        $result = $this->Helper->image('cake.icon.png');
+        $this->assertRegExp('/' . preg_quote('img/cake.icon.png?', '/') . '[0-9]+/', $result);
+    }
+
+    /**
      * test css
      *
      * @return void