/** * 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); }
/** * 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); }
/** * 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'); }
/** * 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); }
/** * 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); }