Check that the directory cache exists

This commit is contained in:
Francis Besset
2011-09-10 18:51:04 +02:00
parent 5dc84ef088
commit d0cc3e8bd2
5 changed files with 66 additions and 5 deletions

View File

@ -36,11 +36,19 @@ class SoapRequestTest extends \PHPUnit_Framework_TestCase
public function testSetDirectory()
{
Cache::setDirectory('/foo');
$this->assertEquals('/foo', Cache::getDirectory());
\vfsStream::setup('Fixtures');
Cache::setDirectory('/bar');
$this->assertEquals('/bar', Cache::getDirectory());
$this->assertFalse(\vfsStreamWrapper::getRoot()->hasChild('foo'));
$dir = \vfsStream::url('Fixtures/foo');
Cache::setDirectory($dir);
$this->assertEquals($dir, Cache::getDirectory());
$this->assertTrue(\vfsStreamWrapper::getRoot()->hasChild('foo'));
$this->assertFalse(\vfsStreamWrapper::getRoot()->hasChild('bar'));
$dir = \vfsStream::url('Fixtures/bar');
Cache::setDirectory($dir);
$this->assertEquals($dir, Cache::getDirectory());
$this->assertTrue(\vfsStreamWrapper::getRoot()->hasChild('bar'));
}
public function testSetLifetime()