/** * @test * * @return null */ public function shouldSetValue() { $storage = new FileStorage('/'); $value = "some value"; $key = "test"; $storage->set($key, $value); $this->assertSame($value, $storage->get($key)); }
/** * @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')); }