Example #1
0
 /**
  * Finds stored data for specified request. Use it in the reader module
  * @param string $requestId identifier delivered by the profiler in the previous request
  * @param boolean $deleteTemporaryFile whether to remove data from the filesystem after retrieving data
  * @return array raw data
  */
 public function getData($requestId, $deleteTemporaryFile = true)
 {
     $this->storage->setRequestId($requestId);
     $data = $this->storage->read();
     if ($deleteTemporaryFile) {
         $this->storage->delete();
     }
     return $data;
 }
Example #2
0
 public function testStorageFailsToReadNonExistingContent()
 {
     $storage = new Storage();
     try {
         $storage->read();
         $this->fail();
     } catch (\Exception $e) {
         $this->assertInstanceOf('\\Vegas\\Profiler\\Exception\\InvalidRequestException', $e);
     }
 }