Browse Source

Merge pull request #7024 from antograssiot/issue-7015

add  tests for #7021
ADmad 10 years ago
parent
commit
fe1fdc46e1
1 changed files with 13 additions and 0 deletions
  1. 13 0
      tests/TestCase/Network/ResponseTest.php

+ 13 - 0
tests/TestCase/Network/ResponseTest.php

@@ -1159,6 +1159,7 @@ class ResponseTest extends TestCase
      * test file with ..
      *
      * @expectedException \Cake\Network\Exception\NotFoundException
+     * @expectedExceptionMessage The requested file contains `..` and will not be read.
      * @return void
      */
     public function testFileWithPathTraversal()
@@ -1166,6 +1167,18 @@ class ResponseTest extends TestCase
         $response = new Response();
         $response->file('my/../cat.gif');
     }
+    /**
+     * test file with ..
+     *
+     * @expectedException \Cake\Network\Exception\NotFoundException
+     * @expectedExceptionMessage my/ca..t.gif was not found or not readable
+     * @return void
+     */
+    public function testFileWithDotIntheName()
+    {
+        $response = new Response();
+        $response->file('my/ca..t.gif');
+    }
 
     /**
      * testFile method