Example #1
0
 public function testResultsRetestMethod()
 {
     $test = Litmus::getTests(1);
     $version = $test->getVersions(1);
     $result = $version->getResults(1);
     $res = $result->retest();
     $this->assertTrue($res);
 }
 /**
  * Test the versions/poll RESTFul method
  *
  */
 public function testVersionsPollMethod()
 {
     $test = Litmus::getTests(1);
     $version = $test->getVersions(1);
     $version = $version->poll();
     $this->assertEquals($version->version, 1);
     $this->assertTrue(is_array($version->results));
     $this->assertTrue(1 == count($version->results));
     $this->assertTrue($version->results[0] instanceof Litmus_Result);
     $result = $version->results[0];
     $this->assertEquals($result->id, 1);
     $this->assertEquals($result->test_code, 'ie7');
     $this->assertEquals($result->state, 'pending');
 }
Example #3
0
 /**
  * Test the tests/update RESTFul method
  *
  */
 public function testTestsUpdateMethod()
 {
     $test = Litmus::getTests(1);
     $updated_test = $test->update(array('name' => 'new Name'));
     $this->assertTrue($updated_test instanceof Litmus_Test);
     $this->assertEquals($updated_test->id, 1);
 }
Example #4
0
<?php

/**
 *
 * @package Litmus_UnitTest
 * @author Guillaume <*****@*****.**>
 * @copyright Copyright (c) 2010, Guillaume Luchet
 * @license http://opensource.org/licenses/bsd-license.php BSD License
 */
ob_start();
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 'on');
ini_set('memory_limit', -1);
define('BASE_PATH', realpath(dirname(__FILE__)) . '/..');
set_include_path(BASE_PATH . '/library' . PATH_SEPARATOR . BASE_PATH . '/tests' . PATH_SEPARATOR . get_include_path());
require_once __DIR__ . '/../library/Litmus.php';
Litmus::setAPICredentials('geelweb', 'gluchet', 'xxxxxx', array('enable_fake_server' => true));
Example #5
0
<?php

Route::post('queue/receive', function () {
    return Queue::marshal();
});
Route::get('test', function () {
    $img = 'https://www.google.com/images/srpr/logo11w.png';
    return Litmus::average_color($img);
});