public function testFindStatementsByCriteria()
 {
     $verb = VerbFixtures::getTypicalVerb();
     $this->mappedStatementRepository->expects($this->once())->method('findStatements')->with($this->equalTo(array('verb' => $verb->getId()->getValue())))->will($this->returnValue(array()));
     $filter = new StatementsFilter();
     $filter->byVerb($verb);
     $this->statementRepository->findStatementsBy($filter);
 }
예제 #2
0
 /**
  * {@inheritDoc}
  */
 public function getStatements(StatementsFilter $filter = null)
 {
     $urlParameters = array();
     if (null !== $filter) {
         $urlParameters = $filter->getFilter();
     }
     // the Agent must be JSON encoded
     if (isset($urlParameters['agent'])) {
         $urlParameters['agent'] = $this->actorSerializer->serializeActor($urlParameters['agent']);
     }
     return $this->doGetStatements('statements', $urlParameters);
 }
 public function testGetStatementsWithVerbInStatementsFilter()
 {
     $filter = new StatementsFilter();
     $verb = new Verb('http://adlnet.gov/expapi/verbs/attended');
     $filter->byVerb($verb);
     $statementResult = $this->createStatementResult();
     $this->validateRetrieveApiCall('get', 'statements', array('verb' => 'http://adlnet.gov/expapi/verbs/attended'), 200, 'StatementResult', $statementResult);
     $this->assertEquals($statementResult, $this->client->getStatements($filter));
 }
예제 #4
0
 public function testDescending()
 {
     $this->statementsFilter->descending();
     $filter = $this->statementsFilter->getFilter();
     $this->assertEquals('False', $filter['ascending']);
 }