コード例 #1
0
ファイル: Sqon.php プロジェクト: sqon/sqon
 /**
  * {@inheritdoc}
  */
 public function getPath($path)
 {
     try {
         return $this->database->getPath($path);
         // @codeCoverageIgnoreStart
     } catch (DatabaseException $exception) {
         throw new SqonException("The path information for \"{$path}\" could not be retrieved.", $exception);
     }
     // @codeCoverageIgnoreEnd
 }
コード例 #2
0
ファイル: DatabaseTest.php プロジェクト: sqon/sqon
 /**
  * Verify that contents can be compressed using gzip.
  */
 public function testSetAPathUsingGzipCompression()
 {
     $this->manager->setCompression(Database::GZIP);
     $this->manager->setPath($this->values['path'], new Memory($this->values['contents'], $this->values['type'], $this->values['modified'], $this->values['permissions']));
     $query = $this->pdo->query("SELECT * FROM paths WHERE path = '{$this->values['path']}'");
     $records = $query->fetchAll();
     $query->closeCursor();
     self::assertEquals(array_merge($this->values, ['compression' => Database::GZIP, 'contents' => gzencode($this->values['contents'])]), $records[0], 'The contents were not compressed using gzip.');
     $path = $this->manager->getPath($this->values['path']);
     self::assertEquals($this->values['contents'], $path->getContents(), 'The contents were not decompressed after selection.');
 }