public function testListQueries() { $query = $this->getMockupQuery(); $this->queryManager->save($query); $queryList = $this->queryManager->listQueries(); $count = $queryList != null ? count($queryList) : 0; self::assertGreaterThan(0, $count); $notContainedInListErrorMessage = "The saved Query is not contained by the query list!"; self::assertEquals($query, $queryList[$query->getId()], $notContainedInListErrorMessage); }
/** * @Route("list") * @Method("GET") * @return Response */ public function listStyles() { if ($this->securityContext->isUserAllowedToView($this->user)) { $queries = $this->queryManager->listQueries(); if ($queries != null) { return $this->getSuccessMessage($queries); } else { return $this->getEmptyMessage("all"); } } return $this->getErrorMessage("Get: Current user is not authorized to list styles", HTTPStatusConstants::_UNAUTHORIZED); }