mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 10:34:34 +00:00
Fix CS
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Authentication\Provider;
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Authentication\Provider\Token\Identity;
|
||||
use Alchemy\Phrasea\Authentication\Provider\Token\Token;
|
||||
use Alchemy\Phrasea\Authentication\Exception\NotAuthenticatedException;
|
||||
@@ -59,7 +58,6 @@ interface ProviderInterface
|
||||
* This method is called on provider callback, whenever the auth was
|
||||
* successful or failure.
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
*
|
||||
* @throws NotAuthenticatedException In case the authentication failed.
|
||||
|
@@ -95,6 +95,7 @@ class API_V1_result
|
||||
/**
|
||||
* API v1 Result constructor
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @param API_V1_adapter $api
|
||||
*
|
||||
|
@@ -49,7 +49,8 @@ class patch_379 implements patchInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param base $databox
|
||||
* @param base $appbox
|
||||
* @param Application $app
|
||||
*/
|
||||
public function apply(base $appbox, Application $app)
|
||||
{
|
||||
|
@@ -40,7 +40,6 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
self::$DI['user']->ACL()->revoke_access_from_bases(array(self::$DI['collection_no_access']->get_base_id()));
|
||||
self::$DI['user']->ACL()->set_masks_on_base(self::$DI['collection_no_access_by_status']->get_base_id(), '0000000000000000000000000000000000000000000000000001000000000000', '0000000000000000000000000000000000000000000000000001000000000000', '0000000000000000000000000000000000000000000000000001000000000000', '0000000000000000000000000000000000000000000000000001000000000000');
|
||||
|
||||
|
||||
parent::tearDownAfterClass();
|
||||
}
|
||||
|
||||
@@ -232,7 +231,6 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
, 'canaddrecord' => true
|
||||
);
|
||||
|
||||
|
||||
foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||
foreach ($databox->get_collections() as $collection) {
|
||||
$base_id = $collection->get_base_id();
|
||||
@@ -276,7 +274,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
foreach ($appbox->get_databoxes() as $databox) {
|
||||
foreach ($databox->get_collections() as $collection) {
|
||||
$bid = $collection->get_base_id();
|
||||
if(!$acl->has_access_to_base($bid)) {
|
||||
if (!$acl->has_access_to_base($bid)) {
|
||||
$acl->give_access_to_base(array($bid));
|
||||
}
|
||||
$acl->set_order_master($collection, true);
|
||||
@@ -344,12 +342,10 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
public function testHas_right()
|
||||
{
|
||||
|
||||
|
||||
$rights = array(
|
||||
'bas_modify_struct' => true
|
||||
);
|
||||
|
||||
|
||||
$this->assertFalse(self::$DI['user']->ACL()->has_right('bas_modify_struct'));
|
||||
$this->assertFalse(self::$DI['user']->ACL()->has_right('bas_modif_th'));
|
||||
|
||||
@@ -380,7 +376,6 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
, 'bas_modif_th' => true
|
||||
);
|
||||
|
||||
|
||||
foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||
self::$DI['user']->ACL()->give_access_to_sbas(array($databox->get_sbas_id()));
|
||||
self::$DI['user']->ACL()->update_rights_to_sbas($databox->get_sbas_id(), $rights_false);
|
||||
@@ -460,7 +455,6 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
$this->assertEquals(count($base_ids), count($bases));
|
||||
|
||||
|
||||
$sql = 'SELECT actif FROM basusr WHERE usr_id = :usr_id AND base_id = :base_id';
|
||||
$stmt = self::$DI['app']['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||
|
||||
@@ -599,7 +593,6 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$this->assertTrue(self::$DI['user']->ACL()->has_access_to_module('thesaurus'));
|
||||
$this->assertFalse(self::$DI['user']->ACL()->has_access_to_module('upload'));
|
||||
|
||||
|
||||
$found = false;
|
||||
foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||
foreach ($databox->get_collections() as $collection) {
|
||||
|
@@ -62,7 +62,6 @@ class Feed_XML_RSSTest extends PhraseanetPHPUnitAbstract
|
||||
$last_build = new DateTime('-2 hours');
|
||||
self::$rss->set_lastBuildDate($last_build);
|
||||
|
||||
|
||||
$xml = self::$rss->render();
|
||||
$sxe = simplexml_load_string($xml);
|
||||
$this->assertInstanceOf('SimpleXMLElement', $sxe);
|
||||
@@ -131,7 +130,6 @@ class Feed_XML_RSSTest extends PhraseanetPHPUnitAbstract
|
||||
$image->set_height($height);
|
||||
$image->set_description($description);
|
||||
|
||||
|
||||
self::$rss->set_image($image);
|
||||
$xml = self::$rss->render();
|
||||
$sxe = simplexml_load_string($xml);
|
||||
|
@@ -125,10 +125,10 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
return $em;
|
||||
}));
|
||||
|
||||
|
||||
$app['browser'] = $app->share($app->extend('browser', function($browser) {
|
||||
|
||||
$browser->setUserAgent(PhraseanetPHPUnitAbstract::USER_AGENT_FIREFOX8MAC);
|
||||
|
||||
return $browser;
|
||||
}));
|
||||
|
||||
@@ -137,14 +137,13 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
->getMock();
|
||||
$app['notification.deliverer']->expects($phpunit->any())
|
||||
->method('deliver')
|
||||
->will($phpunit->returnCallback(function() use ($phpunit){
|
||||
->will($phpunit->returnCallback(function() use ($phpunit) {
|
||||
$phpunit->fail('Notification deliverer must be mocked');
|
||||
}));
|
||||
|
||||
return $app;
|
||||
});
|
||||
|
||||
|
||||
self::$DI['client'] = self::$DI->share(function($DI) {
|
||||
return new Client($DI['app'], array());
|
||||
});
|
||||
@@ -198,7 +197,6 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
$this->assertTrue(false !== stripos($response->getContent(), 'not found'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert fixture contained in the specified fixtureLoader
|
||||
* into sqlLite test temporary database
|
||||
@@ -236,7 +234,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
$app['browser']->setUserAgent($user_agent);
|
||||
$app->register(new \Silex\Provider\TwigServiceProvider());
|
||||
$app->setupTwig();
|
||||
self::$DI['client'] = self::$DI->share(function($DI) use($app) {
|
||||
self::$DI['client'] = self::$DI->share(function($DI) use ($app) {
|
||||
return new Client($app, array());
|
||||
});
|
||||
}
|
||||
@@ -302,7 +300,6 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
|
||||
$loader->addFixture($UsrList);
|
||||
|
||||
|
||||
$this->insertFixtureInDatabase($loader);
|
||||
|
||||
return $UsrList->list;
|
||||
@@ -336,7 +333,6 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
|
||||
$loader->addFixture($UsrEntry);
|
||||
|
||||
|
||||
$this->insertFixtureInDatabase($loader);
|
||||
|
||||
return $UsrEntry->entry;
|
||||
@@ -716,6 +712,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
$DI->extend('user', function ($user, $DI) use ($collection_no_acces) {
|
||||
$user->ACL()->revoke_access_from_bases(array($collection_no_acces->get_base_id()));
|
||||
$DI['client'] = new Client($DI['app'], array());
|
||||
|
||||
return $user;
|
||||
})
|
||||
);
|
||||
@@ -734,6 +731,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
$DI->extend('user', function ($user, $DI) use ($collection_no_acces_by_status) {
|
||||
$user->ACL()->set_masks_on_base($collection_no_acces_by_status->get_base_id(), '0000000000000000000000000000000000000000000000000001000000000000', '0000000000000000000000000000000000000000000000000001000000000000', '0000000000000000000000000000000000000000000000000001000000000000', '0000000000000000000000000000000000000000000000000001000000000000');
|
||||
$DI['client'] = new Client($DI['app'], array());
|
||||
|
||||
return $user;
|
||||
})
|
||||
);
|
||||
@@ -817,6 +815,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
self::$DI->extend('user', function ($user, $DI) use ($app) {
|
||||
PhraseanetPHPUnitAbstract::giveRightsToUser($app, $user);
|
||||
$user->ACL()->set_admin(true);
|
||||
|
||||
return $user;
|
||||
})
|
||||
);
|
||||
@@ -825,6 +824,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
self::$DI->extend('user_notAdmin', function ($user, $DI) use ($app) {
|
||||
PhraseanetPHPUnitAbstract::giveRightsToUser($app, $user);
|
||||
$user->ACL()->set_admin(false);
|
||||
|
||||
return $user;
|
||||
})
|
||||
);
|
||||
|
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
use Silex\WebTestCase;
|
||||
use Symfony\Component\HttpKernel\Client;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
abstract class PhraseanetPHPUnitAuthenticatedAbstract extends PhraseanetPHPUnitAbstract
|
||||
{
|
||||
|
||||
|
@@ -1,9 +1,5 @@
|
||||
<?php
|
||||
|
||||
use Silex\WebTestCase;
|
||||
use Symfony\Component\HttpKernel\Client;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
abstract class PhraseanetWebTestCaseAbstract extends \PhraseanetPHPUnitAbstract
|
||||
{
|
||||
|
||||
|
@@ -110,7 +110,6 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU
|
||||
|
||||
self::$createdDataboxes[] = $databox;
|
||||
|
||||
|
||||
$rights = array(
|
||||
'bas_manage' => '1'
|
||||
, 'bas_modify_struct' => '1'
|
||||
@@ -120,7 +119,6 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU
|
||||
|
||||
self::$DI['app']['authentication']->getUser()->ACL()->update_rights_to_sbas($databox->get_sbas_id(), $rights);
|
||||
|
||||
|
||||
$databox->registerAdmin(self::$DI['app']['authentication']->getUser());
|
||||
|
||||
return $databox;
|
||||
|
@@ -111,7 +111,7 @@ class API_OAuth2_TokenTest extends PhraseanetPHPUnitAbstract
|
||||
|
||||
public function testGenerate_token()
|
||||
{
|
||||
for ($i = 0; $i < 100; $i ++ ) {
|
||||
for ($i = 0; $i < 100; $i ++) {
|
||||
$this->assertMd5(API_OAuth2_Token::generate_token());
|
||||
}
|
||||
}
|
||||
|
@@ -173,7 +173,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
$found = false;
|
||||
foreach ($data['response']['results'] as $retRecord) {
|
||||
if($retRecord['record_id'] == $record->get_record_id() && $retRecord['databox_id'] == $record->get_sbas_id()) {
|
||||
if ($retRecord['record_id'] == $record->get_record_id() && $retRecord['databox_id'] == $record->get_sbas_id()) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
@@ -258,7 +258,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$found = false;
|
||||
|
||||
foreach ($data['response']['results'] as $retStory) {
|
||||
if($retStory['record_id'] == $story->get_record_id() && $retStory['databox_id'] == $story->get_sbas_id()) {
|
||||
if ($retStory['record_id'] == $story->get_record_id() && $retStory['databox_id'] == $story->get_sbas_id()) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
@@ -293,7 +293,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$found = false;
|
||||
|
||||
foreach ($data['response']['results']['stories'] as $retStory) {
|
||||
if($retStory['story_id'] == $story->get_record_id() && $retStory['databox_id'] == $story->get_sbas_id()) {
|
||||
if ($retStory['story_id'] == $story->get_record_id() && $retStory['databox_id'] == $story->get_sbas_id()) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
@@ -324,7 +324,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$found = false;
|
||||
|
||||
foreach ($data['response']['results']['records'] as $retRecord) {
|
||||
if($retRecord['record_id'] == $record->get_record_id() && $retRecord['databox_id'] == $record->get_sbas_id()) {
|
||||
if ($retRecord['record_id'] == $record->get_record_id() && $retRecord['databox_id'] == $record->get_sbas_id()) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
@@ -472,7 +472,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
break;
|
||||
}
|
||||
|
||||
if(null === $statusbit) {
|
||||
if (null === $statusbit) {
|
||||
$this->markTestSkipped('No status bit defined in databox');
|
||||
}
|
||||
|
||||
@@ -700,4 +700,3 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$this->assertInternalType($type, $response['response'][$field]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -132,7 +132,6 @@ class API_V1_resultTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$date_obj2 = new DateTime();
|
||||
$this->assertLessThan(3, abs($date_obj1->format('U') - $date_obj2->format('U')), 'No more than 3sec between now and the query');
|
||||
|
||||
|
||||
$this->assertArrayHasKey("http_code", $response["meta"]);
|
||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $response["meta"]["http_code"]);
|
||||
$this->assertEquals(200, $response["meta"]["http_code"]);
|
||||
|
@@ -24,7 +24,7 @@ class caption_recordTest extends PhraseanetPHPUnitAbstract
|
||||
foreach (self::$DI['record_1']->get_databox()->get_meta_structure() as $databox_field) {
|
||||
$n = $databox_field->is_multi() ? 3 : 1;
|
||||
|
||||
for ($i = 0; $i < $n; $i ++ ) {
|
||||
for ($i = 0; $i < $n; $i ++) {
|
||||
\caption_Field_Value::create(self::$DI['app'], $databox_field, self::$DI['record_1'], \random::generatePassword());
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class caption_recordTest extends PhraseanetPHPUnitAbstract
|
||||
foreach (self::$DI['record_1']->get_databox()->get_meta_structure() as $databox_field) {
|
||||
$n = $databox_field->is_multi() ? 3 : 1;
|
||||
|
||||
for ($i = 0; $i < $n; $i ++ ) {
|
||||
for ($i = 0; $i < $n; $i ++) {
|
||||
\caption_Field_Value::create(self::$DI['app'], $databox_field, self::$DI['record_1'], \random::generatePassword());
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ class caption_recordTest extends PhraseanetPHPUnitAbstract
|
||||
foreach (self::$DI['record_1']->get_databox()->get_meta_structure() as $databox_field) {
|
||||
$n = $databox_field->is_multi() ? 3 : 1;
|
||||
|
||||
for ($i = 0; $i < $n; $i ++ ) {
|
||||
for ($i = 0; $i < $n; $i ++) {
|
||||
\caption_Field_Value::create(self::$DI['app'], $databox_field, self::$DI['record_1'], \random::generatePassword());
|
||||
}
|
||||
}
|
||||
|
@@ -22,10 +22,10 @@ class databox_fieldTest extends PhraseanetPHPUnitAbstract
|
||||
|
||||
$this->object_multi = $this->databox->get_meta_structure()->get_element_by_name($this->name_multi);
|
||||
|
||||
if ( ! $this->object_mono instanceof databox_field) {
|
||||
if (! $this->object_mono instanceof databox_field) {
|
||||
$this->object_mono = databox_field::create(self::$DI['app'], $this->databox, $this->name_mono, false);
|
||||
}
|
||||
if ( ! $this->object_multi instanceof databox_field) {
|
||||
if (! $this->object_multi instanceof databox_field) {
|
||||
$this->object_multi = databox_field::create(self::$DI['app'], $this->databox, $this->name_multi, true);
|
||||
}
|
||||
}
|
||||
|
@@ -5,8 +5,8 @@ class media_Permalink_AdapterTest extends PhraseanetPHPUnitAbstract
|
||||
/**
|
||||
* @var media_Permalink_Adapter
|
||||
*/
|
||||
static $object;
|
||||
static $subdef;
|
||||
public static $object;
|
||||
public static $subdef;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
|
@@ -42,11 +42,11 @@ class media_subdefTest extends \PhraseanetPHPUnitAbstract
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! self::$objectPresent) {
|
||||
if (! self::$objectPresent) {
|
||||
self::$objectPresent = $subdef;
|
||||
continue;
|
||||
}
|
||||
if ( ! self::$objectNotPresent) {
|
||||
if (! self::$objectNotPresent) {
|
||||
self::$objectNotPresent = $subdef;
|
||||
continue;
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ class patch_3803Test extends PhraseanetPHPUnitAbstract
|
||||
$panel = $this->getMock('Alchemy\Phrasea\SearchEngine\ConfigurationPanelInterface');
|
||||
$panel->expects($this->once())
|
||||
->method('saveConfiguration')
|
||||
->will($this->returnCallback(function($json) use (&$catchSEConf){
|
||||
->will($this->returnCallback(function($json) use (&$catchSEConf) {
|
||||
$catchSEConf = $json;
|
||||
}));
|
||||
$panel->expects($this->once())
|
||||
@@ -130,7 +130,7 @@ class patch_3803Test extends PhraseanetPHPUnitAbstract
|
||||
$panel = $this->getMock('Alchemy\Phrasea\SearchEngine\ConfigurationPanelInterface');
|
||||
$panel->expects($this->once())
|
||||
->method('saveConfiguration')
|
||||
->will($this->returnCallback(function($json) use (&$catchSEConf){
|
||||
->will($this->returnCallback(function($json) use (&$catchSEConf) {
|
||||
$catchSEConf = $json;
|
||||
}));
|
||||
$panel->expects($this->once())
|
||||
|
@@ -128,7 +128,6 @@ class randomTest extends PhraseanetPHPUnitAbstract
|
||||
|
||||
}
|
||||
|
||||
|
||||
$expires_on = new DateTime('-5 minutes');
|
||||
$usr_id = self::$DI['user']->get_id();
|
||||
$token = $this->random->getUrlToken(\random::TYPE_PASSWORD, $usr_id, $expires_on, 'some nice datas');
|
||||
|
@@ -397,11 +397,11 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
$this->assertEquals($multi_imploded, implode(' ' . $meta_el->get_separator() . ' ', $initial_values));
|
||||
$this->assertEquals($multi_imploded, $field->get_serialized_values());
|
||||
}
|
||||
else
|
||||
} else {
|
||||
$this->assertEquals('un second jeu de test', $field->get_serialized_values());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function testRebuild_subdefs()
|
||||
{
|
||||
@@ -447,7 +447,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
{
|
||||
$status = '';
|
||||
|
||||
while(strlen($status) < 32) {
|
||||
while (strlen($status) < 32) {
|
||||
$status .= '1';
|
||||
}
|
||||
|
||||
@@ -525,7 +525,6 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( ! $found)
|
||||
$this->fail();
|
||||
}
|
||||
|
@@ -67,7 +67,6 @@ class addReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$this->ColFilter();
|
||||
}
|
||||
|
||||
|
||||
foreach ($this->ret as $sbasid => $collections) {
|
||||
$this->report = new module_report_add(
|
||||
self::$DI['app'],
|
||||
@@ -104,7 +103,6 @@ class addReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
else
|
||||
$this->assertEquals($report['page'] - 1, $report['previous_page']);
|
||||
|
||||
|
||||
if (intval(ceil($nbPage)) == $report['page'] || intval(ceil($nbPage)) == 0)
|
||||
$this->assertFalse($report['next_page']);
|
||||
else
|
||||
@@ -118,7 +116,7 @@ class addReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
else
|
||||
$this->assertEquals(count($this->report->getDisplay()), count($conf));
|
||||
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($this->report->getDisplay() as $col => $colconf) {
|
||||
$this->assertArrayHaskey($col, $conf);
|
||||
$this->assertTrue(is_array($colconf));
|
||||
@@ -140,8 +138,7 @@ class addReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->assertArrayHasKey($groupby, $this->report->getDisplay());
|
||||
$this->assertArrayHasKey('nombre', $this->report->getDisplay());
|
||||
}
|
||||
@@ -149,7 +146,7 @@ class addReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
public function reporttestResult($report, $conf, $groupby = false)
|
||||
{
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($report['result'] as $row) {
|
||||
foreach ($conf as $key => $value) {
|
||||
|
||||
|
@@ -128,7 +128,7 @@ class connexionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
else
|
||||
$this->assertEquals(count($this->report->getDisplay()), count($conf));
|
||||
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($this->report->getDisplay() as $col => $colconf) {
|
||||
$this->assertArrayHaskey($col, $conf);
|
||||
$this->assertTrue(is_array($colconf));
|
||||
@@ -150,8 +150,7 @@ class connexionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->assertArrayHasKey($groupby, $this->report->getDisplay());
|
||||
$this->assertArrayHasKey('nb', $this->report->getDisplay());
|
||||
}
|
||||
@@ -159,7 +158,7 @@ class connexionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
public function reporttestResult($report, $conf, $groupby = false)
|
||||
{
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($report['result'] as $row) {
|
||||
foreach ($conf as $key => $value) {
|
||||
|
||||
|
@@ -15,7 +15,6 @@ class dashboardTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$this->assertGreaterThanOrEqual(1, count($this->dashboard->authorizedCollection));
|
||||
$this->assertEquals($this->dashboard->authorizedCollection, $this->dashboard->authorizedCollection());
|
||||
|
||||
|
||||
foreach ($this->dashboard->authorizedCollection as $coll) {
|
||||
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $coll);
|
||||
$this->assertArrayHasKey('sbas_id', $coll);
|
||||
@@ -66,8 +65,7 @@ class dashboardTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$this->assertLessThanOrEqual($lastvalue, $value['nb']);
|
||||
$lastvalue = $value['nb'];
|
||||
}
|
||||
}
|
||||
elseif (in_array($key, $activity)) {
|
||||
} elseif (in_array($key, $activity)) {
|
||||
if ($key == 'activity') {
|
||||
$this->assertEquals(24, count($dash));
|
||||
} else {
|
||||
|
@@ -165,11 +165,10 @@ class downloadReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
if ($groupby) {
|
||||
if ($groupby != 'record_id')
|
||||
$this->assertEquals(count($this->report->getDisplay()), 2);
|
||||
}
|
||||
else
|
||||
} else
|
||||
$this->assertEquals(count($this->report->getDisplay()), count($conf));
|
||||
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($this->report->getDisplay() as $col => $colconf) {
|
||||
$this->assertArrayHaskey($col, $conf);
|
||||
$this->assertTrue(is_array($colconf));
|
||||
@@ -191,8 +190,7 @@ class downloadReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$this->assertArrayHasKey($groupby, $this->report->getDisplay());
|
||||
}
|
||||
@@ -200,7 +198,7 @@ class downloadReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
public function reporttestResult($report, $conf, $groupby = false)
|
||||
{
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($report['result'] as $row) {
|
||||
foreach ($conf as $key => $value) {
|
||||
|
||||
|
@@ -127,7 +127,7 @@ class editTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
else
|
||||
$this->assertEquals(count($this->report->getDisplay()), count($conf));
|
||||
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($this->report->getDisplay() as $col => $colconf) {
|
||||
$this->assertArrayHaskey($col, $conf);
|
||||
$this->assertTrue(is_array($colconf));
|
||||
@@ -149,8 +149,7 @@ class editTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->assertArrayHasKey($groupby, $this->report->getDisplay());
|
||||
$this->assertArrayHasKey('nombre', $this->report->getDisplay());
|
||||
}
|
||||
@@ -158,7 +157,7 @@ class editTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
public function reporttestResult($report, $conf, $groupby = false)
|
||||
{
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($report['result'] as $row) {
|
||||
foreach ($conf as $key => $value) {
|
||||
|
||||
|
@@ -118,7 +118,7 @@ class pushReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
else
|
||||
$this->assertEquals(count($this->report->getDisplay()), count($conf));
|
||||
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($this->report->getDisplay() as $col => $colconf) {
|
||||
$this->assertArrayHaskey($col, $conf);
|
||||
$this->assertTrue(is_array($colconf));
|
||||
@@ -140,8 +140,7 @@ class pushReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->assertArrayHasKey($groupby, $this->report->getDisplay());
|
||||
$this->assertArrayHasKey('nombre', $this->report->getDisplay());
|
||||
}
|
||||
@@ -149,7 +148,7 @@ class pushReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
public function reporttestResult($report, $conf, $groupby = false)
|
||||
{
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($report['result'] as $row) {
|
||||
foreach ($conf as $key => $value) {
|
||||
|
||||
|
@@ -123,7 +123,7 @@ class questionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
else
|
||||
$this->assertEquals(count($this->report->getDisplay()), count($conf));
|
||||
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($this->report->getDisplay() as $col => $colconf) {
|
||||
$this->assertArrayHaskey($col, $conf);
|
||||
$this->assertTrue(is_array($colconf));
|
||||
@@ -145,8 +145,7 @@ class questionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->assertArrayHasKey($groupby, $this->report->getDisplay());
|
||||
$this->assertArrayHasKey('nb', $this->report->getDisplay());
|
||||
}
|
||||
@@ -154,7 +153,7 @@ class questionReportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
public function reporttestResult($report, $conf, $groupby = false)
|
||||
{
|
||||
if ( ! $groupby) {
|
||||
if (! $groupby) {
|
||||
foreach ($report['result'] as $row) {
|
||||
foreach ($conf as $key => $value) {
|
||||
|
||||
|
@@ -97,8 +97,6 @@ class reportTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
|
||||
public function testGetterSetter()
|
||||
{
|
||||
|
||||
|
||||
$report = new module_report(self::$DI['app'], $this->dmin, $this->dmax, 1, '');
|
||||
$bool = true;
|
||||
$report->setPrettyString($bool);
|
||||
|
@@ -34,7 +34,7 @@ class sqlFilterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
$sbasid,
|
||||
$collections
|
||||
);
|
||||
if ( ! $this->report instanceof module_report) {
|
||||
if (! $this->report instanceof module_report) {
|
||||
$this->report = $report;
|
||||
} elseif ($report->getTotal() > $this->report->getTotal()) {
|
||||
$this->report = $report;
|
||||
|
@@ -496,7 +496,6 @@ class task_period_archiveTest extends \PhraseanetPHPUnitAbstract
|
||||
$sxcaption = simplexml_load_string($xml);
|
||||
$this->assertEquals('10000', self::$object->parseStatusBitTester($sxcaption));
|
||||
|
||||
|
||||
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<record record_id="2">
|
||||
<status/>
|
||||
|
@@ -16,7 +16,7 @@ class uuidTest extends PhraseanetPHPUnitAbstract
|
||||
public function testGenerate_v3()
|
||||
{
|
||||
$datas = array();
|
||||
for ($i = 0; $i < 1000; $i ++ ) {
|
||||
for ($i = 0; $i < 1000; $i ++) {
|
||||
$uuid = uuid::generate_v4();
|
||||
|
||||
if ( ! uuid::is_valid($uuid))
|
||||
@@ -40,7 +40,7 @@ class uuidTest extends PhraseanetPHPUnitAbstract
|
||||
public function testGenerate_v4()
|
||||
{
|
||||
$datas = array();
|
||||
for ($i = 0; $i < 1000; $i ++ ) {
|
||||
for ($i = 0; $i < 1000; $i ++) {
|
||||
$uuid = uuid::generate_v4();
|
||||
|
||||
if ( ! uuid::is_valid($uuid))
|
||||
@@ -60,7 +60,7 @@ class uuidTest extends PhraseanetPHPUnitAbstract
|
||||
public function testGenerate_v5()
|
||||
{
|
||||
$datas = array();
|
||||
for ($i = 0; $i < 1000; $i ++ ) {
|
||||
for ($i = 0; $i < 1000; $i ++) {
|
||||
$uuid = uuid::generate_v4();
|
||||
|
||||
if ( ! uuid::is_valid($uuid))
|
||||
@@ -83,7 +83,7 @@ class uuidTest extends PhraseanetPHPUnitAbstract
|
||||
|
||||
public function testIs_valid()
|
||||
{
|
||||
for ($i = 0; $i < 1000; $i ++ ) {
|
||||
for ($i = 0; $i < 1000; $i ++) {
|
||||
$uuid = uuid::generate_v4();
|
||||
if ( ! uuid::is_valid($uuid))
|
||||
$this->fail('Generation d\'un uuid v4 invalide');
|
||||
@@ -102,7 +102,7 @@ class uuidTest extends PhraseanetPHPUnitAbstract
|
||||
|
||||
public function testCompare()
|
||||
{
|
||||
for ($i = 0; $i < 1000; $i ++ ) {
|
||||
for ($i = 0; $i < 1000; $i ++) {
|
||||
$uuid1 = uuid::generate_v4();
|
||||
$uuid2 = uuid::generate_v4();
|
||||
$this->assertFalse(uuid::compare($uuid1, $uuid2));
|
||||
|
Reference in New Issue
Block a user