/**
  * @dataProvider deserializeData
  */
 public function testDeserializeStatementResult($json, StatementResult $expectedStatementResult)
 {
     $statementResult = $this->statementResultSerializer->deserializeStatementResult($json);
     $this->assertInstanceOf('Xabbuh\\XApi\\Model\\StatementResult', $statementResult);
     $expectedStatements = $expectedStatementResult->getStatements();
     $statements = $statementResult->getStatements();
     $this->assertCount(count($expectedStatements), $statements, 'Statement result sets have the same size');
     foreach ($expectedStatements as $key => $expectedStatement) {
         $this->assertTrue($expectedStatement->equals($statements[$key]), 'Statements in result are the same');
     }
     if (null === $expectedStatementResult->getMoreUrlPath()) {
         $this->assertNull($statementResult->getMoreUrlPath(), 'The more URL path is null');
     } else {
         $this->assertTrue($expectedStatementResult->getMoreUrlPath()->equals($statementResult->getMoreUrlPath()), 'More URL paths are equal');
     }
 }
Esempio n. 2
0
 /**
  * {@inheritDoc}
  */
 public function getNextStatements(StatementResult $statementResult)
 {
     return $this->doGetStatements($statementResult->getMoreUrlPath());
 }