|
@@ 33-51 (lines=19) @@
|
| 30 |
|
parent::setUp(); |
| 31 |
|
$this->statementResultSerializer = new StatementResultSerializer($this->serializer); |
| 32 |
|
} |
| 33 |
|
public function testDeserializeStatementResult() |
| 34 |
|
{ |
| 35 |
|
/** @var \Xabbuh\XApi\Model\StatementResult $statementResult */ |
| 36 |
|
$statementResult = $this->statementResultSerializer->deserializeStatementResult( |
| 37 |
|
StatementResultJsonFixtures::getStatementResult() |
| 38 |
|
); |
| 39 |
|
$statements = $statementResult->getStatements(); |
| 40 |
|
|
| 41 |
|
$this->assertEquals(2, count($statements)); |
| 42 |
|
$this->assertEquals( |
| 43 |
|
'12345678-1234-5678-8234-567812345678', |
| 44 |
|
$statements[0]->getId() |
| 45 |
|
); |
| 46 |
|
$this->assertEquals( |
| 47 |
|
'12345678-1234-5678-8234-567812345679', |
| 48 |
|
$statements[1]->getId() |
| 49 |
|
); |
| 50 |
|
$this->assertNull($statementResult->getMoreUrlPath()); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function testSerializeMinimalStatement() |
| 54 |
|
{ |
|
@@ 63-84 (lines=22) @@
|
| 60 |
|
); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
public function testDeserializeStatementResultWithMore() |
| 64 |
|
{ |
| 65 |
|
/** @var \Xabbuh\XApi\Model\StatementResult $statementResult */ |
| 66 |
|
$statementResult = $this->statementResultSerializer->deserializeStatementResult( |
| 67 |
|
StatementResultJsonFixtures::getStatementResultWithMore() |
| 68 |
|
); |
| 69 |
|
$statements = $statementResult->getStatements(); |
| 70 |
|
|
| 71 |
|
$this->assertEquals(2, count($statements)); |
| 72 |
|
$this->assertEquals( |
| 73 |
|
'12345678-1234-5678-8234-567812345678', |
| 74 |
|
$statements[0]->getId() |
| 75 |
|
); |
| 76 |
|
$this->assertEquals( |
| 77 |
|
'12345678-1234-5678-8234-567812345679', |
| 78 |
|
$statements[1]->getId() |
| 79 |
|
); |
| 80 |
|
$this->assertEquals( |
| 81 |
|
'/xapi/statements/more/b381d8eca64a61a42c7b9b4ecc2fabb6', |
| 82 |
|
$statementResult->getMoreUrlPath() |
| 83 |
|
); |
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
public function testSerializeMinimalStatementWithMore() |
| 87 |
|
{ |