Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions test/Pattern/CaptureCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,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()
Expand All @@ -156,10 +155,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()
Expand All @@ -172,6 +171,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());
}
}

0 comments on commit 4d714f6

Please sign in to comment.