mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Fix report tests
This commit is contained in:
@@ -578,16 +578,16 @@ class module_report
|
||||
{
|
||||
switch ($domain) {
|
||||
case 'connexion' :
|
||||
return new module_report_sqlconnexion($this);
|
||||
return new module_report_sqlconnexion($this->app, $this);
|
||||
break;
|
||||
case 'download' :
|
||||
return new module_report_sqldownload($this->app, $this);
|
||||
break;
|
||||
case 'question' :
|
||||
return new module_report_sqlquestion($this);
|
||||
return new module_report_sqlquestion($this->app, $this);
|
||||
break;
|
||||
case 'action' :
|
||||
return new module_report_sqlaction($this);
|
||||
return new module_report_sqlaction($this->app, $this);
|
||||
break;
|
||||
default:
|
||||
return $this->req;
|
||||
|
@@ -9,6 +9,8 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
|
||||
/**
|
||||
*
|
||||
* @package module_report
|
||||
@@ -17,6 +19,7 @@
|
||||
*/
|
||||
class module_report_filter
|
||||
{
|
||||
private $app;
|
||||
private $posting_filter = array();
|
||||
private $cor_query = array();
|
||||
private $active_column = array();
|
||||
@@ -36,8 +39,9 @@ class module_report_filter
|
||||
'search' => 'report:: question',
|
||||
);
|
||||
|
||||
public function __construct($current_filter, $correspondance)
|
||||
public function __construct(Application $app, $current_filter, $correspondance)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->tab_filter = $current_filter;
|
||||
$this->cor_query = $correspondance;
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ class filterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
public function testFilter()
|
||||
{
|
||||
$filter = new module_report_filter(array(), $this->report->getTransQueryString());
|
||||
$filter = new module_report_filter(self::$application, array(), $this->report->getTransQueryString());
|
||||
$this->assertEquals(array(), $filter->getTabFilter());
|
||||
$filter->addFilter('x', 'LIKE', 'y');
|
||||
$filter->addFilter('x', 'LIKE', 'z');
|
||||
|
@@ -47,7 +47,7 @@ class reportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
public function testReport()
|
||||
{
|
||||
foreach ($this->ret as $sbasid => $collections) {
|
||||
$this->report = new module_report($this->dmin, $this->dmax, $sbasid, $collections);
|
||||
$this->report = new module_report(self::$application, $this->dmin, $this->dmax, $sbasid, $collections);
|
||||
$this->report->setUser_id(self::$user->get_id());
|
||||
$this->assertEquals($collections, $this->report->getListCollId());
|
||||
$this->host($this->report);
|
||||
@@ -104,7 +104,7 @@ class reportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
{
|
||||
|
||||
|
||||
$report = new module_report($this->dmin, $this->dmax, 1, '');
|
||||
$report = new module_report(self::$application, $this->dmin, $this->dmax, 1, '');
|
||||
$bool = true;
|
||||
$report->setPrettyString($bool);
|
||||
$this->assertEquals($bool, $report->getPrettyString());
|
||||
@@ -157,6 +157,12 @@ class reportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$report = $this->getMock('module_report', array('buildReq', 'buildResult'), array(), '', FALSE);
|
||||
$report->setSbas_id($sbasid);
|
||||
$this->assertEquals($sbasid, $report->getSbas_id());
|
||||
|
||||
$r = new \ReflectionObject($report);
|
||||
$p = $r->getProperty('app');
|
||||
$p->setAccessible(true);
|
||||
$p->setValue($report, self::$application);
|
||||
|
||||
$report->setRequest('SELECT
|
||||
user,
|
||||
usrid,
|
||||
|
@@ -13,7 +13,7 @@ class sqlActionTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
$this->mock = $this->getMock('module_report', array(), array(), '', false);
|
||||
|
||||
$this->action = new module_report_sqlaction($this->mock);
|
||||
$this->action = new module_report_sqlaction(self::$application, $this->mock);
|
||||
}
|
||||
|
||||
public function testGetAction()
|
||||
|
Reference in New Issue
Block a user