Esempio n. 1
0
 /**
  * Setting a default output format.
  *
  * This will be used if the client does not request any specific format.
  *
  * @param string $mime_type Default format
  * @return bool Setting of default format was successful
  */
 public function setDefaultFormat($mime_type)
 {
     if (Format::isMimeTypeSupported($mime_type)) {
         $this->default_format = $mime_type;
         return true;
     } else {
         return false;
     }
 }
Esempio n. 2
0
 /**
  * @covers JK\RestServer\Format::isMimeTypeSupported
  */
 public function testIsMimeTypeNotSupported()
 {
     $result = Format::isMimeTypeSupported('non/existent');
     $this->assertFalse($result);
 }