Changeset 1143

Show
Ignore:
Timestamp:
12/13/07 18:35:52 (7 months ago)
Author:
mikey
Message:

stubbles_vfs: initial release

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/test/php/net/stubbles/util/cache/stubFileCacheContainerTestCase.php

    r982 r1143  
    99stubClassLoader::load('net.stubbles.util.cache.stubFileCacheContainer'); 
    1010Mock::generate('stubCacheStrategy'); 
    11 require_once TEST_SRC_PATH . '/../main/php/org/simpletest/extensions/streamwrapper/stream_wrapper.php'; 
     11require_once TEST_SRC_PATH . '/../main/php/org/stubbles/vfs/vfsStreamWrapper.php'; 
    1212/** 
    1313 * Tests for net.stubbles.util.cache.stubFileCacheContainer. 
     
    4242    public function setUp() 
    4343    { 
    44         SimpleTestStreamWrapper::register(); 
    45         SimpleTestStreamWrapper::setRoot(new SimpleTestStreamDirectory('cache')); 
     44        vfsStreamWrapper::register(); 
     45        vfsStreamWrapper::setRoot(new vfsStreamDirectory('cache')); 
    4646        $this->mockCacheStrategy = new MockstubCacheStrategy(); 
    4747        $this->cacheContainer    = new stubFileCacheContainer('id'); 
    4848        $this->cacheContainer->setStrategy($this->mockCacheStrategy); 
    49         $this->cacheContainer->setCacheDirectory(SimpleTestStreamWrapper::PROTOCOL . '://cache'); 
    50         $this->cacheDirectory    = SimpleTestStreamWrapper::getRoot()->getChild('id'); 
     49        $this->cacheContainer->setCacheDirectory(vfsStreamWrapper::PROTOCOL . '://cache'); 
     50        $this->cacheDirectory    = vfsStreamWrapper::getRoot()->getChild('id'); 
    5151    } 
    5252 
     
    7676    public function testHas() 
    7777    { 
    78         $foo = new SimpleTestStreamFile('foo.cache'); 
     78        $foo = new vfsStreamFile('foo.cache'); 
    7979        $foo->setContent('bar'); 
    8080        $this->cacheDirectory->addChild($foo); 
     
    9292    public function testGet() 
    9393    { 
    94         $foo = new SimpleTestStreamFile('foo.cache'); 
     94        $foo = new vfsStreamFile('foo.cache'); 
    9595        $foo->setContent('bar'); 
    9696        $this->cacheDirectory->addChild($foo); 
     
    108108    public function testGetSize() 
    109109    { 
    110         $foo = new SimpleTestStreamFile('foo.cache'); 
     110        $foo = new vfsStreamFile('foo.cache'); 
    111111        $foo->setContent('bar'); 
    112112        $this->cacheDirectory->addChild($foo); 
     
    124124    public function testGetUsedSpace() 
    125125    { 
    126         $foo = new SimpleTestStreamFile('foo.cache'); 
     126        $foo = new vfsStreamFile('foo.cache'); 
    127127        $foo->setContent('bar'); 
    128128        $this->cacheDirectory->addChild($foo); 
     
    138138    public function testGetKeys() 
    139139    { 
    140         $foo = new SimpleTestStreamFile('foo.cache'); 
     140        $foo = new vfsStreamFile('foo.cache'); 
    141141        $foo->setContent('bar'); 
    142142        $this->cacheDirectory->addChild($foo); 
     
    158158    public function testGc() 
    159159    { 
    160         $foo = new SimpleTestStreamFile('foo.cache'); 
     160        $foo = new vfsStreamFile('foo.cache'); 
    161161        $foo->setContent('bar'); 
    162162        $this->cacheDirectory->addChild($foo); 
     
    207207    public function testtestKeyContainingDirectorySeperatorAndExistingCacheFile() 
    208208    { 
    209         $foo = new SimpleTestStreamFile('barfoo.cache'); 
     209        $foo = new vfsStreamFile('barfoo.cache'); 
    210210        $foo->setContent('bar'); 
    211211        $this->cacheDirectory->addChild($foo);