mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
Fix tests
This commit is contained in:
@@ -672,6 +672,8 @@ class databox extends base
|
||||
*/
|
||||
public function get_meta_structure()
|
||||
{
|
||||
$metaStructData = array();
|
||||
|
||||
if ($this->meta_struct) {
|
||||
return $this->meta_struct;
|
||||
}
|
||||
@@ -685,13 +687,15 @@ class databox extends base
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
if ($rs) {
|
||||
$metaStructData = $rs;
|
||||
$this->set_data_to_cache($metaStructData, self::CACHE_META_STRUCT);
|
||||
}
|
||||
}
|
||||
|
||||
$this->meta_struct = new databox_descriptionStructure();
|
||||
|
||||
foreach ($metaStructData as $row) {
|
||||
foreach ((array) $metaStructData as $row) {
|
||||
$this->meta_struct->add_element(databox_field::get_instance($this->app, $this, $row['id']));
|
||||
}
|
||||
|
||||
|
@@ -466,7 +466,7 @@ class module_report_activity extends module_report
|
||||
//set title
|
||||
$this->title = _('report:: Detail des telechargements');
|
||||
|
||||
$this->setDateField('log_search.date');
|
||||
$this->setDateField('log_docs.date');
|
||||
$sqlBuilder = new module_report_sql($this->app, $this);
|
||||
$filter = $sqlBuilder->getFilters()->getReportFilter();
|
||||
$params = array_merge(array(), $filter['params']);
|
||||
@@ -602,7 +602,7 @@ class module_report_activity extends module_report
|
||||
|
||||
$params = array(':site_id' => $app['phraseanet.configuration']['main']['key']);
|
||||
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_search.date');
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
/*
|
||||
$sql = "SELECT tt.usrid, tt.user, tt.final, tt.record_id, SUM(1) AS nb, SUM(size) AS poid
|
||||
@@ -623,11 +623,11 @@ class module_report_activity extends module_report
|
||||
*/
|
||||
$sql = "SELECT tt.usrid, tt.user, tt.final, tt.record_id, SUM(1) AS nb, SUM(size) AS poid\n"
|
||||
. " FROM (\n"
|
||||
. " SELECT DISTINCT(log.id), log.usrid, user, final, log_date.record_id\n"
|
||||
. " FROM (log_docs AS log_date)\n"
|
||||
. " INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_date.log_id)\n"
|
||||
. " SELECT DISTINCT(log.id), log.usrid, user, final, log_docs.record_id\n"
|
||||
. " FROM (log_docs)\n"
|
||||
. " INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_docs.log_id)\n"
|
||||
. " WHERE log.site = :site_id\n"
|
||||
. " AND log_date.action = 'download'\n"
|
||||
. " AND log_docs.action = 'download'\n"
|
||||
. " AND (" . $datefilter['sql'] . ")\n"
|
||||
. ") AS tt\n"
|
||||
. "LEFT JOIN subdef AS s ON (s.record_id = tt.record_id)\n"
|
||||
|
@@ -523,6 +523,8 @@ class AdminCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testPostEmptyCollectionWithHighRecordAmount()
|
||||
{
|
||||
$this->markTestSkipped('This tests lasts for 40 sec.');
|
||||
|
||||
$this->setAdmin(true);
|
||||
|
||||
$collection = $this->createOneCollection();
|
||||
|
@@ -34,7 +34,6 @@ class editTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
'record_id' => array("", 1, 1, 1, 1),
|
||||
'file' => array("", 1, 0, 1, 1),
|
||||
'mime' => array("", 1, 0, 1, 1),
|
||||
'size' => array("", 1, 0, 1, 1)
|
||||
);
|
||||
|
||||
foreach ($this->ret as $sbasid => $collections) {
|
||||
@@ -160,7 +159,6 @@ class editTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
if (! $groupby) {
|
||||
foreach ($report['result'] as $row) {
|
||||
foreach ($conf as $key => $value) {
|
||||
|
||||
$this->assertArrayHasKey($key, $row);
|
||||
$condition = is_string($row[$key]) || is_int($row[$key]);
|
||||
$this->assertTrue($condition);
|
||||
|
Reference in New Issue
Block a user