Example #1
0
 public static function createFromModel(Verb $verb)
 {
     $mappedVerb = new MappedVerb();
     $mappedVerb->id = $verb->getId();
     $mappedVerb->display = $verb->getDisplay();
     return $mappedVerb;
 }
Example #2
0
 public static function fromModel(VerbModel $model)
 {
     $verb = new self();
     $verb->id = $model->getId()->getValue();
     if (null !== ($display = $model->getDisplay())) {
         $verb->display = array();
         foreach ($display->languageTags() as $languageTag) {
             $verb->display[$languageTag] = $display[$languageTag];
         }
     }
     return $verb;
 }
 public function testVoidStatement()
 {
     $voidedStatementId = '12345678-1234-5678-1234-567812345679';
     $voidingStatementId = '12345678-1234-5678-1234-567812345678';
     $agent = new Agent('mailto:john.doe@example.com');
     $statementReference = new StatementReference($voidedStatementId);
     $voidingStatement = new Statement(null, $agent, Verb::createVoidVerb(), $statementReference);
     $voidedStatement = $this->createStatement($voidedStatementId);
     $this->validateStoreApiCall('post', 'statements', array(), 200, '["' . $voidingStatementId . '"]', $voidingStatement);
     $returnedVoidingStatement = $this->client->voidStatement($voidedStatement, $agent);
     $expectedVoidingStatement = new Statement($voidingStatementId, $agent, Verb::createVoidVerb(), $statementReference);
     $this->assertEquals($expectedVoidingStatement, $returnedVoidingStatement);
 }
 /**
  * Loads a void statement.
  *
  * @param string $id The id of the new Statement
  *
  * @return Statement
  */
 public static function getVoidStatement($id = self::DEFAULT_STATEMENT_ID)
 {
     $actor = new Agent('mailto:xapi@adlnet.gov');
     $verb = Verb::createVoidVerb();
     $object = new StatementReference('e05aa883-acaf-40ad-bf54-02c8ce485fb0');
     return new Statement($id, $actor, $verb, $object);
 }
Example #5
0
 public function testCreateVoidVerb()
 {
     $this->assertEquals('http://adlnet.gov/expapi/verbs/voided', Verb::createVoidVerb()->getId());
 }