diff --git a/test/Pattern/CaptureCacheTest.php b/test/Pattern/CaptureCacheTest.php index d498f3349..8f673f644 100644 --- a/test/Pattern/CaptureCacheTest.php +++ b/test/Pattern/CaptureCacheTest.php @@ -137,18 +137,17 @@ public function testRemoveThrowsLogicExceptionOnMissingPublicDir() public function testGetFilenameWithoutPublicDir() { $captureCache = new Cache\Pattern\CaptureCache(); - - $this->assertEquals('/index.html', $captureCache->getFilename('/')); - $this->assertEquals('/dir1/test', $captureCache->getFilename('/dir1/test')); - $this->assertEquals('/dir1/test.html', $captureCache->getFilename('/dir1/test.html')); - $this->assertEquals('/dir1/dir2/test.html', $captureCache->getFilename('/dir1/dir2/test.html')); + $this->assertEquals(str_replace('/', DIRECTORY_SEPARATOR, '/index.html'), $captureCache->getFilename('/')); + $this->assertEquals(str_replace('/', DIRECTORY_SEPARATOR, '/dir1/test'), $captureCache->getFilename('/dir1/test')); + $this->assertEquals(str_replace('/', DIRECTORY_SEPARATOR, '/dir1/test.html'), $captureCache->getFilename('/dir1/test.html')); + $this->assertEquals(str_replace('/', DIRECTORY_SEPARATOR, '/dir1/dir2/test.html'), $captureCache->getFilename('/dir1/dir2/test.html')); } public function testGetFilenameWithoutPublicDirAndNoPageId() { $_SERVER['REQUEST_URI'] = '/dir1/test.html'; $captureCache = new Cache\Pattern\CaptureCache(); - $this->assertEquals('/dir1/test.html', $captureCache->getFilename()); + $this->assertEquals(str_replace('/', DIRECTORY_SEPARATOR, '/dir1/test.html'), $captureCache->getFilename()); } public function testGetFilenameWithPublicDir() @@ -160,10 +159,10 @@ public function testGetFilenameWithPublicDir() $captureCache = new Cache\Pattern\CaptureCache(); $captureCache->setOptions($options); - $this->assertEquals($this->_tmpCacheDir . '/index.html', $captureCache->getFilename('/')); - $this->assertEquals($this->_tmpCacheDir . '/dir1/test', $captureCache->getFilename('/dir1/test')); - $this->assertEquals($this->_tmpCacheDir . '/dir1/test.html', $captureCache->getFilename('/dir1/test.html')); - $this->assertEquals($this->_tmpCacheDir . '/dir1/dir2/test.html', $captureCache->getFilename('/dir1/dir2/test.html')); + $this->assertEquals($this->_tmpCacheDir . str_replace('/', DIRECTORY_SEPARATOR, '/index.html'), $captureCache->getFilename('/')); + $this->assertEquals($this->_tmpCacheDir . str_replace('/', DIRECTORY_SEPARATOR, '/dir1/test'), $captureCache->getFilename('/dir1/test')); + $this->assertEquals($this->_tmpCacheDir . str_replace('/', DIRECTORY_SEPARATOR, '/dir1/test.html'), $captureCache->getFilename('/dir1/test.html')); + $this->assertEquals($this->_tmpCacheDir . str_replace('/', DIRECTORY_SEPARATOR, '/dir1/dir2/test.html'), $captureCache->getFilename('/dir1/dir2/test.html')); } public function testGetFilenameWithPublicDirAndNoPageId() @@ -176,6 +175,6 @@ public function testGetFilenameWithPublicDirAndNoPageId() $captureCache = new Cache\Pattern\CaptureCache(); $captureCache->setOptions($options); - $this->assertEquals($this->_tmpCacheDir . '/dir1/test.html', $captureCache->getFilename()); + $this->assertEquals($this->_tmpCacheDir . str_replace('/', DIRECTORY_SEPARATOR, '/dir1/test.html'), $captureCache->getFilename()); } }