PHRAS-2327_report_refacto_41 remove old tests

This commit is contained in:
Filip Vilic
2018-12-11 14:15:48 +01:00
parent 5268fb854b
commit 3fe4247953
4 changed files with 1 additions and 1437 deletions

View File

@@ -45,6 +45,7 @@ $select-height: 26px;
margin: 0; margin: 0;
border: 0 none; border: 0 none;
border-radius: 0; border-radius: 0;
background: transparent;
overflow: hidden; overflow: hidden;
&:first-child a { &:first-child a {
border-top-left-radius: 5px; border-top-left-radius: 5px;

View File

@@ -1,667 +0,0 @@
<?php
namespace Alchemy\Tests\Phrasea\Controller\Report;
/**
* @group functional
* @group legacy
* @group authenticated
* @group web
*/
class ActivityTest extends \PhraseanetAuthenticatedWebTestCase
{
private $dmin;
private $dmax;
public function __construct()
{
$this->dmax = new \DateTime('now');
$this->dmin = new \DateTime('-1 month');
}
public function testDoReportConnexionsByUsers()
{
self::$DI['client']->request('POST', '/report/activity/users/connexions', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportConnexionsByUsersCSV()
{
self::$DI['client']->request('POST', '/report/activity/users/connexions', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'page' => 1,
'limit' => 10,
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDownloadsByUsers()
{
self::$DI['client']->request('POST', '/report/activity/users/downloads', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDownloadsByUsersCSV()
{
self::$DI['client']->request('POST', '/report/activity/users/downloads', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'page' => 1,
'limit' => 10,
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportBestOfQuestions()
{
self::$DI['client']->request('POST', '/report/activity/questions/best-of', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportBestOfQuestionsCSV()
{
self::$DI['client']->request('POST', '/report/activity/questions/best-of', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'limit' => 10,
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportNoBestOfQuestions()
{
self::$DI['client']->request('POST', '/report/activity/questions/no-best-of', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportNoBestOfQuestionsCSV()
{
self::$DI['client']->request('POST', '/report/activity/questions/no-best-of', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'limit' => 10,
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportSiteActiviyPerHours()
{
self::$DI['client']->request('POST', '/report/activity/instance/hours', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportSiteActiviyPerHoursCSV()
{
self::$DI['client']->request('POST', '/report/activity/instance/hours', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportSiteActivityPerDays()
{
self::$DI['client']->request('POST', '/report/activity/instance/days', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportSiteActivityPerDaysCSV()
{
self::$DI['client']->request('POST', '/report/activity/instance/days', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportPushedDocuments()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/pushed', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'order' => 'ASC',
'champ' => 'user',
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportPushedDocumentsPrintCSV()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/pushed', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportPushedDocumentsFilterColumns()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/pushed', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'list_column' => 'user ddate',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportPushedDocumentsFilterResultOnOneColumn()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/pushed', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'filter_column' => 'user',
'filter_value' => 'admin',
'liste' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportPushedDocumentsFilterConf()
{
self::$DI['client']->request('POST', '/report/activity/documents/pushed', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'conf' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportPushedDocumentsGroupBy()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/pushed', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'groupby' => 'user',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportAddedDocuments()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/added', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'order' => 'ASC',
'champ' => 'user',
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportAddedDocumentsPrintCSV()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/added', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportAddedDocumentsFilterColumns()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/added', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'list_column' => 'user ddate',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportAddedDocumentsFilterResultOnOneColumn()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/added', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'filter_column' => 'user',
'filter_value' => 'admin',
'liste' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportAddedDocumentsFilterConf()
{
self::$DI['client']->request('POST', '/report/activity/documents/added', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'conf' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportAddedDocumentsGroupBy()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/added', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'groupby' => 'user',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportEditedDocuments()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/edited', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'order' => 'ASC',
'champ' => 'user',
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportEditedDocumentsPrintCSV()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/edited', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportEditedDocumentsFilterColumns()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/edited', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'list_column' => 'user ddate',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportEditedDocumentsFilterResultOnOneColumn()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/edited', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'filter_column' => 'user',
'filter_value' => 'admin',
'liste' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportEditedDocumentsFilterConf()
{
self::$DI['client']->request('POST', '/report/activity/documents/edited', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'conf' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportEditedDocumentsGroupBy()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/edited', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'groupby' => 'user',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportValidatedDocuments()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/validated', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'order' => 'ASC',
'champ' => 'user',
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportValidatedDocumentsPrintCSV()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/validated', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportValidatedDocumentsFilterColumns()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/validated', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'list_column' => 'user ddate',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportValidatedDocumentsFilterResultOnOneColumn()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/validated', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'filter_column' => 'user',
'filter_value' => 'admin',
'liste' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportValidatedDocumentsFilterConf()
{
self::$DI['client']->request('POST', '/report/activity/documents/validated', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'conf' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportValidatedDocumentsGroupBy()
{
$this->markTestSkipped(
'Report is broken since table "log_colls" is deleted.'
);
self::$DI['client']->request('POST', '/report/activity/documents/validated', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'groupby' => 'user',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
}

View File

@@ -1,339 +0,0 @@
<?php
namespace Alchemy\Tests\Phrasea\Controller\Report;
use Alchemy\Phrasea\Model\Entities\User;
use Symfony\Component\HttpKernel\Client;
/**
* @group functional
* @group legacy
* @group authenticated
* @group web
*/
class InformationsTest extends \PhraseanetAuthenticatedWebTestCase
{
/**
* @var \DateTime
*/
private $dmin;
/**
* @var \DateTime
*/
private $dmax;
/**
* @var Client
*/
private $client;
public function setUp()
{
parent::setUp();
$this->dmax = new \DateTime('now');
$this->dmin = new \DateTime('-1 month');
$this->client = $this->getClient();
}
public function testDoReportUserBadRequest()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
]);
$response = $this->client->getResponse();
$this->assertFalse($response->isOk());
$this->assertEquals(400, $response->getStatusCode());
}
public function testDoReportUser()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'user' => $this->getUser()->getId(),
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportUserFromConnexion()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'user' => $this->getUser()->getId(),
'from' => 'CNX',
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportUserFromQuestion()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'from' => 'ASK',
'user' => $this->getUser()->getId(),
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportUserFromDownload()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'from' => 'GEN',
'user' => $this->getUser()->getId(),
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportUserFromConnexionCSV()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'from' => 'CNX',
'printcsv' => 'on',
'user' => $this->getUser()->getId(),
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportUserFromQuestionCSV()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'from' => 'ASK',
'printcsv' => 'on',
'user' => $this->getUser()->getId(),
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportUserFromDownloadCSV()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'from' => 'GEN',
'printcsv' => 'on',
'user' => $this->getUser()->getId(),
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportUserFromDownloadOnCustomField()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'from' => 'GEN',
'on' => 'email',
'user' => $this->getUser()->getEmail()
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportUserFromConnexionOnCustomField()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'from' => 'CNX',
'on' => 'email',
'user' => $this->getUser()->getEmail()
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportUserFromQuestionOnCustomField()
{
$this->client->request('POST', '/report/informations/user', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'from' => 'ASK',
'on' => 'email',
'user' => $this->getUser()->getEmail()
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportInformationBrowserBadRequest()
{
$this->client->request('POST', '/report/informations/browser', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
]);
$response = $this->client->getResponse();
$this->assertFalse($response->isOk());
$this->assertEquals(400, $response->getStatusCode());
}
public function testDoReportInfomationsBrowser()
{
$this->client->request('POST', '/report/informations/browser', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'user' => 'chrome',
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportInfomationsDocumentsNotFound()
{
$this->client->request('POST', '/report/informations/document', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'sbasid' => 0,
'rid' => 0,
]);
$response = $this->client->getResponse();
$this->assertFalse($response->isOk());
$this->assertEquals(404, $response->getStatusCode());
}
public function testDoReportInfomationsDocuments()
{
$this->client->request('POST', '/report/informations/document', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'sbasid' => $this->getRecord1()->getDataboxId(),
'rid' => $this->getRecord1()->getRecordId(),
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportInfomationsDocumentsFromTool()
{
$this->client->request('POST', '/report/informations/document', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'sbasid' => $this->getRecord1()->getDataboxId(),
'rid' => $this->getRecord1()->getRecordId(),
'from' => 'TOOL'
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportInfomationsDocumentsFromDashboard()
{
$this->client->request('POST', '/report/informations/document', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'sbasid' => $this->getRecord1()->getDataboxId(),
'rid' => $this->getRecord1()->getRecordId(),
'from' => 'DASH'
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportInfomationsDocumentsFromOther()
{
$this->client->request('POST', '/report/informations/document', [
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
'dmax' => $this->dmax->format('Y-m-d H:i:s'),
'sbasid' => $this->getCollection()->get_sbas_id(),
'collection' => $this->getCollection()->get_coll_id(),
'sbasid' => $this->getRecord1()->getDataboxId(),
'rid' => $this->getRecord1()->getRecordId(),
'user' => $this->getUser()->getId()
]);
$response = $this->client->getResponse();
$this->assertTrue($response->isOk());
}
/**
* @return User
*/
private function getUser()
{
return self::$DI['user'];
}
}

View File

@@ -30,434 +30,3 @@ class RootTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertTrue($response->isOk()); $this->assertTrue($response->isOk());
} }
public function testRouteDashboardJson()
{
$this->authenticate(self::$DI['app']);
$response = $this->XMLHTTPRequest('GET', '/report/dashboard', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmin->format('Y-m-d'),
]);
$this->assertTrue($response->isOk());
}
public function testRouteInitReport()
{
self::$DI['client']->request('POST', '/report/init', ['popbases' => ['1_1']]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportConnexions()
{
self::$DI['client']->request('POST', '/report/connexions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'order' => 'ASC',
'champ' => 'user',
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportConnexionsPrintCSV()
{
self::$DI['client']->request('POST', '/report/connexions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportConnexionsFilterColumns()
{
self::$DI['client']->request('POST', '/report/connexions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'list_column' => 'user ddate',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportConnexionsFilterResultOnOneColumn()
{
self::$DI['client']->request('POST', '/report/connexions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'filter_column' => 'user',
'filter_value' => 'admin',
'liste' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportConnexionsFilterConf()
{
self::$DI['client']->request('POST', '/report/connexions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'conf' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportConnexionsGroupBy()
{
self::$DI['client']->request('POST', '/report/connexions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'groupby' => 'user',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportQuestions()
{
self::$DI['client']->request('POST', '/report/questions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'order' => 'ASC',
'champ' => 'user',
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportQuestionsPrintCSV()
{
self::$DI['client']->request('POST', '/report/questions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportQuestionsFilterColumns()
{
self::$DI['client']->request('POST', '/report/questions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'list_column' => 'user ddate',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportQuestionsFilterResultOnOneColumn()
{
self::$DI['client']->request('POST', '/report/questions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'filter_column' => 'user',
'filter_value' => 'admin',
'liste' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportQuestionsFilterConf()
{
self::$DI['client']->request('POST', '/report/questions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'conf' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportQuestionsGroupBy()
{
self::$DI['client']->request('POST', '/report/questions', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'groupby' => 'user',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDownloads()
{
self::$DI['client']->request('POST', '/report/downloads', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'order' => 'ASC',
'champ' => 'user',
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDownloadsPrintCSV()
{
self::$DI['client']->request('POST', '/report/downloads', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDownloadsFilterColumns()
{
self::$DI['client']->request('POST', '/report/downloads', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'list_column' => 'user ddate',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDownloadsFilterResultOnOneColumn()
{
self::$DI['client']->request('POST', '/report/downloads', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'filter_column' => 'user',
'filter_value' => 'admin',
'liste' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDownloadsFilterConf()
{
self::$DI['client']->request('POST', '/report/downloads', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'conf' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDownloadsGroupBy()
{
self::$DI['client']->request('POST', '/report/downloads', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'groupby' => 'user',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDocuments()
{
self::$DI['client']->request('POST', '/report/documents', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'order' => 'ASC',
'champ' => 'final',
'tbl' => 'DOC',
'page' => 1,
'limit' => 10,
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDocumentsPrintCSV()
{
self::$DI['client']->request('POST', '/report/documents', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDocumentsFilterColumns()
{
self::$DI['client']->request('POST', '/report/documents', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'list_column' => 'file mime',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDocumentsFilterResultOnOneColumn()
{
self::$DI['client']->request('POST', '/report/documents', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'filter_column' => 'mime',
'filter_value' => 'pdf',
'liste' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDocumentsFilterConf()
{
self::$DI['client']->request('POST', '/report/documents', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'conf' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportDocumentsGroupBy()
{
self::$DI['client']->request('POST', '/report/documents', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'groupby' => 'mime',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportClients()
{
self::$DI['client']->request('POST', '/report/clients', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
public function testDoReportClientPrintCSV()
{
self::$DI['client']->request('POST', '/report/clients', [
'dmin' => $this->dmin->format('Y-m-d'),
'dmax' => $this->dmax->format('Y-m-d'),
'sbasid' => self::$DI['collection']->get_sbas_id(),
'collection' => self::$DI['collection']->get_coll_id(),
'printcsv' => 'on',
]);
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
}
}