Example #1
0
 /**
  * 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.');
 }
Example #2
0
File: Sqon.php Project: sqon/sqon
 /**
  * {@inheritdoc}
  */
 public function setCompression($mode)
 {
     $this->database->setCompression($mode);
     return $this;
 }