예제 #1
0
파일: Client.php 프로젝트: geelweb/litmus
 /**
  * Singleton : return the current instance of the Litmus_RESTful_Client
  *
  * @return Litmus_RESTful_Client
  */
 public static function singleton()
 {
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
예제 #2
0
 /**
  * Implements the versions/poll method to get the state of a version
  */
 public function poll()
 {
     $rc = Litmus_RESTful_Client::singleton();
     $res = $rc->get('tests/' . $this->getTestId() . '/versions/' . $this->version . '/poll.xml');
     $versions = Litmus_Version::load($res, $this->getTestId());
     return array_pop($versions);
 }
예제 #3
0
파일: Report.php 프로젝트: geelweb/litmus
 /**
  * Implements the reports/create method to create a new report
  *
  * @param string $name The name of the report
  * @return Litmus_Report
  */
 public static function create($name)
 {
     $dom = new DomDocument('1.0', null);
     $root = $dom->createElement('report');
     $dom->appendChild($root);
     $nameElement = $dom->createElement('name', $name);
     $root->appendChild($nameElement);
     $request = $dom->saveXML();
     $rc = Litmus_RESTful_Client::singleton();
     $res = $rc->post('reports.xml', $request);
     $tests = Litmus_Report::load($res);
     return array_pop($tests);
 }
예제 #4
0
파일: Result.php 프로젝트: geelweb/litmus
 /**
  * Implement the results/retest method
  *
  */
 public function retest()
 {
     $rc = Litmus_RESTful_Client::singleton();
     return $rc->post('tests/' . $this->getTestId() . '/versions/' . $this->getVersionId() . '/results/' . $this->id . '/retest.xml');
 }
예제 #5
0
파일: Litmus.php 프로젝트: geelweb/litmus
 /**
  * Initialize the RESTful Client with the API credentials
  *
  * @return void
  */
 public static function setAPICredentials($key, $username, $password, $opt = array())
 {
     $rc = Litmus_RESTful_Client::singleton();
     $rc->setCredentials($key, $username, $password, $opt);
 }
예제 #6
0
파일: Test.php 프로젝트: Natronick/Litmus
 /**
  * Implement the pages/clients and emails/clients methods to get the
  * available clients for web pages and email tests
  *
  * @param string the type of clients to retrieve (TYPE_PAGE|TYPE_EMAIL)
  * @return array
  */
 public static function getClients($type)
 {
     $rc = Litmus_RESTful_Client::singleton();
     $res = $rc->get($type . '/clients.xml');
     return Litmus_Test_Client::load($res);
 }