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); }
/** * {@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)); }
public function testDescending() { $this->statementsFilter->descending(); $filter = $this->statementsFilter->getFilter(); $this->assertEquals('False', $filter['ascending']); }