public function testOutput() { $storage = new FileStorage('somewhere'); self::$functions->expects($this->at(0))->method('file_exists')->with($this->equalTo('somewhere' . DIRECTORY_SEPARATOR . 'mykey'))->will($this->returnValue(true)); self::$functions->expects($this->at(1))->method('readfile')->with($this->equalTo('somewhere' . DIRECTORY_SEPARATOR . 'mykey'))->will($this->returnValue('data')); $this->expectOutputString('data'); $storage->output('mykey'); }