|
18 | 18 | use TinCan\RemoteLRS; |
19 | 19 |
|
20 | 20 | class RemoteLRSTest extends PHPUnit_Framework_TestCase { |
21 | | - static private $endpoint = 'http://cloud.scorm.com/tc/3HYPTQLAI9/sandbox'; |
22 | | - static private $version = '1.0.1'; |
23 | | - static private $username = ''; |
24 | | - static private $password = ''; |
| 21 | + static private $endpoint; |
| 22 | + static private $version; |
| 23 | + static private $username; |
| 24 | + static private $password; |
| 25 | + |
| 26 | + public static function setUpBeforeClass() { |
| 27 | + self::$endpoint = $GLOBALS['LRSs'][0]['endpoint']; |
| 28 | + self::$version = $GLOBALS['LRSs'][0]['version']; |
| 29 | + self::$username = $GLOBALS['LRSs'][0]['username']; |
| 30 | + self::$password = $GLOBALS['LRSs'][0]['password']; |
| 31 | + } |
25 | 32 |
|
26 | 33 | public function testInstantiation() { |
27 | 34 | $lrs = new RemoteLRS(); |
@@ -98,16 +105,20 @@ public function testQueryStatements() { |
98 | 105 |
|
99 | 106 | public function testMoreStatements() { |
100 | 107 | $lrs = new RemoteLRS(self::$endpoint, self::$version, self::$username, self::$password); |
101 | | - $queryResponse = $lrs->queryStatements(['limit' => 4]); |
| 108 | + $queryResponse = $lrs->queryStatements(['limit' => 1]); |
102 | 109 |
|
103 | 110 | if ($queryResponse->success) { |
| 111 | + if (! $queryResponse->content->getMore()) { |
| 112 | + $this->markTestSkipped('No more property in StatementsResult (not enough statements in endpoint?)'); |
| 113 | + } |
| 114 | + |
104 | 115 | $response = $lrs->moreStatements($queryResponse->content); |
105 | 116 |
|
106 | 117 | $this->assertInstanceOf('TinCan\LRSResponse', $response); |
107 | 118 | $this->assertInstanceOf('TinCan\StatementsResult', $response->content); |
108 | 119 | } |
109 | 120 | else { |
110 | | - // TODO: skipped? throw? |
| 121 | + $this->markTestSkipped('Query to get "more" URL failed'); |
111 | 122 | } |
112 | 123 | } |
113 | 124 |
|
|
0 commit comments