Ejemplo n.º 1
0
 /**
  * Testing the getValue method.
  *
  * @since 1.0
  */
 public function testGetValue()
 {
     $enum = new Enum();
     $enum->setOptions(array('a', 'b', 'c'));
     try {
         $enum->setValue('b');
     } catch (IllegalArguementException $e) {
         $this->fail('testing the getValue method');
     }
     $this->assertEquals('b', $enum->getValue(), 'testing the getValue method');
 }
Ejemplo n.º 2
0
 /**
  * Caches the image to the cache directory.
  *
  * @param image $image the binary GD image stream to save
  *
  * @since 1.0
  */
 private function cache($image)
 {
     $config = ConfigProvider::getInstance();
     if ($this->sourceType->getValue() == 'png' && $config->get('cms.images.perserve.png')) {
         imagepng($image, $this->filename);
     } else {
         imagejpeg($image, $this->filename, 100 * $this->quality->getValue());
     }
 }