Commit 7c0c15ee authored by François Agneray's avatar François Agneray
Browse files

Fixed test DatasetListByInstanceActionTest

parent fe7a4e5b
......@@ -71,7 +71,7 @@ final class DatasetListByInstanceAction extends AbstractAction
->from('App\Entity\Dataset', 'd')
->join('d.datasetFamily', 'f')
->where($qb->expr()->eq('IDENTITY(f.instance)', ':instanceName'));
if (boolval($this->settings['enabled'])) {
if (!$token) {
// If user is not connected return public datasets
......@@ -91,7 +91,7 @@ final class DatasetListByInstanceAction extends AbstractAction
}
}
}
$qb->setParameter('instanceName', $instance->getName());
$datasets = $qb->getQuery()->getResult();
$payload = json_encode($datasets);
......
......@@ -36,7 +36,7 @@ final class SearchAction extends AbstractAction
{
private $connectionFactory;
private $operatorFactory;
/**
* Contains settings to handle Json Web Token
*
......
......@@ -31,8 +31,12 @@ final class DatasetListByInstanceActionTest extends TestCase
protected function setUp(): void
{
$settings = array(
'enabled' => '0',
'admin_role' => 'anis_admin'
);
$this->entityManager = EntityManagerBuilder::getInstance();
$this->action = new \App\Action\DatasetListByInstanceAction($this->entityManager);
$this->action = new \App\Action\DatasetListByInstanceAction($this->entityManager, $settings);
}
public function testOptionsHttpMethod(): void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment