Ejemplo n.º 1
0
 /**
  * Tests the setCode() method.
  * @covers \ManiaScript\Compressor::setCode
  */
 public function testSetCode()
 {
     $expected = 'abc';
     $compressor = new Compressor();
     $result = $compressor->setCode($expected);
     $this->assertPropertyEquals($expected, $compressor, 'code');
     $this->assertPropertyEquals(strlen($expected), $compressor, 'codeLength');
     $this->assertEquals($compressor, $result);
 }
Ejemplo n.º 2
0
 /**
  * Compresses the code.
  * @param string $code The code to compress.
  * @return string The compressed code.
  */
 protected function compress($code)
 {
     $compressor = new Compressor();
     $result = $compressor->setCode($code)->compress()->getCompressedCode();
     return $result;
 }