예제 #1
0
 public function testApplication()
 {
     $app = new \Roku\Application("dev");
     $app->setId("dev");
     $app->setName("Test App");
     $app->setVersion("0.1.0");
     $this->assertEquals(new \Roku\Application("dev", "0.1.0", "Test App"), $app);
 }
예제 #2
0
파일: Roku.php 프로젝트: svilborg/php-roku
 /**
  * Launch Application
  *
  * @param Application $app
  *            Application
  * @param array $params
  *            Params
  * @throws Exception
  *
  * @return string
  */
 public function launch(Application $app, $params = array())
 {
     $response = $this->client->post($this->getUri("launch", $app->getId()), $params);
     if ($response->code !== 200) {
         if ($response->code == 204) {
             throw new Exception("Application already launched");
         } elseif ($response->code == 204) {
             throw new Exception("Application Not Found");
         } else {
             throw new Exception("Command Error - launch");
         }
     }
     return $response->raw_body;
 }