コード例 #1
0
ファイル: ResultTest.php プロジェクト: nagyistoce/TinCanPHP
 public function testAsVersion()
 {
     $args = ['success' => true, 'completion' => true, 'duration' => 'PT15S', 'response' => 'a', 'score' => ['raw' => 100, 'scaled' => 1, 'min' => 0, 'max' => 100]];
     $obj = new Result($args);
     $versioned = $obj->asVersion('1.0.0');
     $this->assertEquals($versioned, $args, "success only: 1.0.0");
 }
コード例 #2
0
ファイル: ResultTest.php プロジェクト: socialweb/tincan_xapi
 public function testAsVersion()
 {
     $args = ['success' => true];
     $obj = new Result($args);
     $versioned = $obj->asVersion('1.0.0');
     $this->assertEquals($versioned, $args, "success only: 1.0.0");
 }
コード例 #3
0
ファイル: ResultTest.php プロジェクト: WillSkates/TinCanPHP
 public function testAsVersionScoreZeroRaw()
 {
     $args = ['score' => ['raw' => 0]];
     $obj = Result::fromJSON(json_encode($args, JSON_UNESCAPED_SLASHES));
     $versioned = $obj->asVersion('1.0.0');
     $this->assertEquals($versioned, $args, "serialized version matches original");
 }