예제 #1
0
 /**
  * @test
  *
  * @return null
  */
 public function shouldSetValue()
 {
     $storage = new FileStorage('/');
     $value = "some value";
     $key = "test";
     $storage->set($key, $value);
     $this->assertSame($value, $storage->get($key));
 }
예제 #2
0
 /**
  * @expectedException \Core\ObjectStorage\ObjectStorageException
  */
 public function testGetWithFileNotFound()
 {
     $storage = new FileStorage('somewhere');
     self::$functions->expects($this->at(0))->method('file_exists')->with($this->equalTo('somewhere' . DIRECTORY_SEPARATOR . 'mykey'))->will($this->returnValue(false));
     $this->assertEquals('data', $storage->get('mykey'));
 }