From f3a45274b995891df3496e715d02fdd65a62a8c2 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 11 Jan 2012 20:04:47 +0100 Subject: [PATCH] Syntax Corrections --- lib/unitTest/ACLTest.php | 2 +- .../Phrasea/Application/OverviewTest.php | 2 +- .../Phrasea/Controller/Prod/FeedTest.php | 2 +- .../Api/Auth/Bridge_Api_Auth_AbstractTest.php | 4 +- .../Api/Auth/Bridge_Api_Auth_FlickrTest.php | 4 +- .../Api/Auth/Bridge_Api_Auth_OAuth2Test.php | 4 +- .../Api/Bridge_Api_AbstractCollectionTest.php | 4 +- .../Bridge/Api/Bridge_Api_AbstractTest.php | 4 +- .../Bridge_Api_ContainerCollectionTest.php | 4 +- .../Bridge/Api/Bridge_Api_DailymotionTest.php | 6 +-- .../Api/Bridge_Api_ElementCollectionTest.php | 4 +- .../Bridge/Api/Bridge_Api_FlickrTest.php | 4 +- .../Bridge/Api/Bridge_Api_YoutubeTest.php | 4 +- .../Bridge_Api_Dailymotion_ContainerTest.php | 6 +-- .../Bridge_Api_Dailymotion_ElementTest.php | 6 +-- .../Bridge_Api_Flickr_ContainerTest.php | 4 +- .../Flickr/Bridge_Api_Flickr_ElementTest.php | 4 +- .../Bridge_Api_Youtube_ContainerTest.php | 6 +-- .../Bridge_Api_Youtube_ElementTest.php | 6 +-- lib/unitTest/Bridge/ApplicationTest.php | 6 +-- .../Bridge/Bridge_AccountSettingsTest.php | 4 +- lib/unitTest/Bridge/Bridge_AccountTest.php | 4 +- lib/unitTest/Bridge/Bridge_ApiTest.php | 4 +- lib/unitTest/Bridge/Bridge_ElementTest.php | 4 +- lib/unitTest/Bridge/Bridge_datas.inc | 2 +- lib/unitTest/Doctrine/Repositories/Basket.php | 17 +++++++ .../Feed/Entry/Feed_Entry_AdapterTest.php | 2 +- .../Feed/Entry/Feed_Entry_CollectionTest.php | 2 +- .../Feed/Entry/Feed_Entry_ItemTest.php | 2 +- lib/unitTest/Feed/Feed_AdapterTest.php | 6 +-- lib/unitTest/Feed/Feed_AggregateTest.php | 2 +- lib/unitTest/Feed/Feed_CollectionTest.php | 2 +- lib/unitTest/Feed/Feed_LinkTest.php | 2 +- .../Publisher/Feed_Publisher_AdapterTest.php | 2 +- lib/unitTest/Feed/XML/Feed_XML_AtomTest.php | 2 +- lib/unitTest/Feed/XML/Feed_XML_RSSTest.php | 2 +- .../Feed/XML/RSS/Feed_XML_RSS_ImageTest.php | 2 +- lib/unitTest/Feed/rssfeedsTest.php | 8 ++-- .../PhraseanetPHPUnitAbstract.class.inc | 48 +++++++++---------- ...anetPHPUnitAuthenticatedAbstract.class.inc | 2 +- .../PhraseanetWebTestCaseAbstract.class.inc | 4 +- .../Session_Authentication_GuestTest.php | 2 +- .../Session_Authentication_NativeTest.php | 2 +- ...on_Authentication_PersistentCookieTest.php | 2 +- .../Session_Authentication_TokenTest.php | 2 +- lib/unitTest/Session/Session_HandlerTest.php | 2 +- lib/unitTest/Session/Session_LoggerTest.php | 2 +- lib/unitTest/Session/Session_PhraseaTest.php | 2 +- .../Session_Storage_CommandLineTest.php | 2 +- .../Session_Storage_PHPSessionTest.php | 2 +- lib/unitTest/Setup/Setup_ConstraintTest.php | 2 +- lib/unitTest/Setup/Setup_UpgradeTest.php | 2 +- .../api/oauthv2/API_OAuth2_AuthCodeTest.php | 2 +- .../oauthv2/API_OAuth2_RefreshTokenTest.php | 2 +- .../api/oauthv2/api_oauthv2_AccountTest.php | 2 +- .../oauthv2/api_oauthv2_ApplicationTest.php | 2 +- .../api/oauthv2/api_oauthv2_TokenTest.php | 2 +- lib/unitTest/api/oauthv2/applicationTest.php | 2 +- lib/unitTest/api/v1/api_v1_adapterTest.php | 2 +- lib/unitTest/api/v1/api_v1_resultTest.php | 6 +-- lib/unitTest/api/v1/aplicationTest.php | 22 ++++----- lib/unitTest/api/v1/aplicationYamlTest.php | 22 ++++----- lib/unitTest/collectionTest.php | 10 ++-- .../databox_Field_DCES_ContributorTest.php | 2 +- .../DCES/databox_Field_DCES_CoverageTest.php | 2 +- .../DCES/databox_Field_DCES_CreatorTest.php | 2 +- .../DCES/databox_Field_DCES_DateTest.php | 2 +- .../databox_Field_DCES_DescriptionTest.php | 2 +- .../DCES/databox_Field_DCES_FormatTest.php | 2 +- .../databox_Field_DCES_IdentifierTest.php | 2 +- .../DCES/databox_Field_DCES_LanguageTest.php | 2 +- .../DCES/databox_Field_DCES_PublisherTest.php | 2 +- .../DCES/databox_Field_DCES_RelationTest.php | 2 +- .../DCES/databox_Field_DCES_RightsTest.php | 2 +- .../DCES/databox_Field_DCES_SourceTest.php | 2 +- .../DCES/databox_Field_DCES_SubjectTest.php | 2 +- .../DCES/databox_Field_DCES_TitleTest.php | 2 +- .../DCES/databox_Field_DCES_TypeTest.php | 2 +- .../Field/databox_Field_DCESAbstractTest.php | 2 +- lib/unitTest/databox/databox_cguTest.php | 2 +- .../databox_descriptionStructureTest.php | 2 +- lib/unitTest/databox/databox_fieldTest.php | 2 +- .../databox/databox_fieldUnknownTest.php | 2 +- lib/unitTest/databox/databox_statusTest.php | 2 +- .../databox/databox_subdefAbstractTest.php | 2 +- .../databox/databox_subdefsStructureTest.php | 2 +- .../subdef/databox_subdef_audioTest.php | 2 +- .../subdef/databox_subdef_documentTest.php | 2 +- .../subdef/databox_subdef_flashTest.php | 2 +- .../subdef/databox_subdef_imageTest.php | 2 +- .../databox_subdef_mediatypeAbstractTest.php | 2 +- .../subdef/databox_subdef_videoTest.php | 2 +- .../databox_subdef_mediatype_audioTest.php | 2 +- ...databox_subdef_mediatype_flexpaperTest.php | 2 +- .../databox_subdef_mediatype_gifTest.php | 2 +- .../databox_subdef_mediatype_imageTest.php | 2 +- .../databox_subdef_mediatype_videoTest.php | 2 +- lib/unitTest/formatTest.php | 2 +- lib/unitTest/geonamesTest.php | 2 +- lib/unitTest/http/http_requestTest.php | 2 +- lib/unitTest/lazaretFileTest.php | 2 +- lib/unitTest/lazaretTest.php | 2 +- lib/unitTest/listeTest.php | 2 +- lib/unitTest/loginTest.php | 2 +- lib/unitTest/logsTest.php | 2 +- lib/unitTest/mailTest.php | 2 +- .../Permalink/media_Permalink_AdapterTest.php | 2 +- .../metadata/description/descriptionTest.php | 2 +- .../module_console_aboutAuthorsTest.php | 4 +- .../module_console_aboutLicenseTest.php | 4 +- .../module_console_schedulerStartTest.php | 2 +- .../module_console_schedulerStateTest.php | 2 +- ...le_console_systemTemplateGeneratorTest.php | 2 +- .../module_console_systemUpgradeTest.php | 2 +- .../console/module_console_tasklistTest.php | 2 +- .../console/module_console_taskrunTest.php | 2 +- lib/unitTest/p4fieldTest.php | 2 +- lib/unitTest/p4fileTest.php | 2 +- lib/unitTest/p4stringTest.php | 2 +- lib/unitTest/phraseaTest.php | 2 +- lib/unitTest/phraseadateTest.php | 2 +- lib/unitTest/queriesTest.php | 2 +- lib/unitTest/randomTest.php | 2 +- lib/unitTest/record/adapterTest.php | 6 +-- lib/unitTest/recordutilsTest.php | 2 +- lib/unitTest/registryTest.php | 2 +- lib/unitTest/registry_setupTest.php | 2 +- lib/unitTest/report/activityTest.php | 2 +- lib/unitTest/report/addTest.php | 2 +- lib/unitTest/report/connexionReportTest.php | 2 +- lib/unitTest/report/dashboardTest.php | 2 +- lib/unitTest/report/downloadReportTest.php | 2 +- lib/unitTest/report/editTest.php | 2 +- lib/unitTest/report/filterTest.php | 2 +- lib/unitTest/report/pushTest.php | 2 +- lib/unitTest/report/questionReportTest.php | 2 +- lib/unitTest/report/reportTest.php | 2 +- lib/unitTest/report/sqlActionTest.php | 2 +- lib/unitTest/report/sqlFilterTest.php | 2 +- lib/unitTest/report/sqlTest.php | 2 +- lib/unitTest/searchEngine_optionsTest.php | 2 +- lib/unitTest/setupTest.php | 2 +- lib/unitTest/sphinxrtTest.php | 2 +- lib/unitTest/supertwigTest.php | 2 +- lib/unitTest/system/system_fileTest.php | 22 ++++----- lib/unitTest/system/system_serverTest.php | 2 +- lib/unitTest/system/system_urlTest.php | 2 +- lib/unitTest/task/task_abstractTest.php | 2 +- lib/unitTest/thesaurusTest.php | 2 +- lib/unitTest/unicodeTest.php | 2 +- lib/unitTest/unitTestsTest.php | 4 +- lib/unitTest/userTest.php | 2 +- lib/unitTest/uuidTest.php | 2 +- 153 files changed, 266 insertions(+), 249 deletions(-) create mode 100644 lib/unitTest/Doctrine/Repositories/Basket.php diff --git a/lib/unitTest/ACLTest.php b/lib/unitTest/ACLTest.php index 4f0c802b59..612b51ad0b 100644 --- a/lib/unitTest/ACLTest.php +++ b/lib/unitTest/ACLTest.php @@ -1,7 +1,7 @@ assertEquals('/skins/icons/rss32.gif', self::$object->get_icon_url()); - $file = new system_file(dirname(__FILE__) . '/../testfiles/p4logo.jpg'); + $file = new system_file(__DIR__ . '/../testfiles/p4logo.jpg'); self::$object->set_icon($file); try { - $file = new system_file(dirname(__FILE__) . '/../testfiles/iphone_pic.jpg'); + $file = new system_file(__DIR__ . '/../testfiles/iphone_pic.jpg'); self::$object->set_icon($file); $this->fail('Should fail'); } diff --git a/lib/unitTest/Feed/Feed_AggregateTest.php b/lib/unitTest/Feed/Feed_AggregateTest.php index dcac32d0da..d1a5ada5ab 100644 --- a/lib/unitTest/Feed/Feed_AggregateTest.php +++ b/lib/unitTest/Feed/Feed_AggregateTest.php @@ -1,6 +1,6 @@ set_public(false); - self::$feed_1_private->set_icon(new system_file(dirname(__FILE__) . '/../testfiles/logocoll.gif')); + self::$feed_1_private->set_icon(new system_file(__DIR__ . '/../testfiles/logocoll.gif')); self::$feed_2_private = Feed_Adapter::create($appbox, self::$user, self::$feed_2_private_title, self::$feed_2_private_subtitle); self::$feed_2_private->set_public(false); self::$feed_3_public = Feed_Adapter::create($appbox, self::$user, self::$feed_3_public_title, self::$feed_3_public_subtitle); self::$feed_3_public->set_public(true); - self::$feed_3_public->set_icon(new system_file(dirname(__FILE__) . '/../testfiles/logocoll.gif')); + self::$feed_3_public->set_icon(new system_file(__DIR__ . '/../testfiles/logocoll.gif')); self::$feed_4_public = Feed_Adapter::create($appbox, self::$user, self::$feed_4_public_title, self::$feed_4_public_subtitle); self::$feed_4_public->set_public(true); @@ -165,7 +165,7 @@ class Feed_rssfeedsTest extends PhraseanetWebTestCaseAbstract public function createApplication() { - return require dirname(__FILE__) . '/../../../lib/Alchemy/Phrasea/Application/Root.php'; + return require __DIR__ . '/../../../lib/Alchemy/Phrasea/Application/Root.php'; } //$app->get('/feeds/aggregated/{format}/', function($format) use ($app, $appbox, $display_feed) diff --git a/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc b/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc index 6c43afb2d0..24465dd90b 100644 --- a/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc +++ b/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc @@ -921,7 +921,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase { self::$story_1 = \record_adapter::create( self::$collection - , new system_file(dirname(__FILE__) . '/testfiles/test001.CR2') + , new system_file(__DIR__ . '/testfiles/test001.CR2') , false , true ); @@ -1093,139 +1093,139 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase if ((static::$need_records === true || static::$need_records >= 1) && !self::$record_1 instanceof record_adapter) { echo "generate record 1\n"; - self::$record_sf_1 = new system_file(dirname(__FILE__) . '/testfiles/test001.CR2'); + self::$record_sf_1 = new system_file(__DIR__ . '/testfiles/test001.CR2'); self::$record_1 = record_adapter::create(self::$collection, self::$record_sf_1); } if ((static::$need_records === true || static::$need_records >= 2) && !self::$record_2 instanceof record_adapter) { echo "generate record 2\n"; - self::$record_sf_2 = new system_file(dirname(__FILE__) . '/testfiles/test002.CR2'); + self::$record_sf_2 = new system_file(__DIR__ . '/testfiles/test002.CR2'); self::$record_2 = record_adapter::create(self::$collection, self::$record_sf_2); } if ((static::$need_records === true || static::$need_records >= 3) && !self::$record_3 instanceof record_adapter) { echo "generate record 3\n"; - self::$record_sf_3 = new system_file(dirname(__FILE__) . '/testfiles/test003.CR2'); + self::$record_sf_3 = new system_file(__DIR__ . '/testfiles/test003.CR2'); self::$record_3 = record_adapter::create(self::$collection, self::$record_sf_3); } if ((static::$need_records === true || static::$need_records >= 4) && !self::$record_4 instanceof record_adapter) { echo "generate record 4\n"; - self::$record_sf_4 = new system_file(dirname(__FILE__) . '/testfiles/test004.CR2'); + self::$record_sf_4 = new system_file(__DIR__ . '/testfiles/test004.CR2'); self::$record_4 = record_adapter::create(self::$collection, self::$record_sf_4); } if ((static::$need_records === true || static::$need_records >= 5) && !self::$record_5 instanceof record_adapter) { echo "generate record 5\n"; - self::$record_sf_5 = new system_file(dirname(__FILE__) . '/testfiles/test005.CR2'); + self::$record_sf_5 = new system_file(__DIR__ . '/testfiles/test005.CR2'); self::$record_5 = record_adapter::create(self::$collection, self::$record_sf_5); } if ((static::$need_records === true || static::$need_records >= 6) && !self::$record_6 instanceof record_adapter) { echo "generate record 6\n"; - self::$record_sf_6 = new system_file(dirname(__FILE__) . '/testfiles/test006.wav'); + self::$record_sf_6 = new system_file(__DIR__ . '/testfiles/test006.wav'); self::$record_6 = record_adapter::create(self::$collection, self::$record_sf_6); } if ((static::$need_records === true || static::$need_records >= 7) && !self::$record_7 instanceof record_adapter) { echo "generate record 7\n"; - self::$record_sf_7 = new system_file(dirname(__FILE__) . '/testfiles/test007.ppt'); + self::$record_sf_7 = new system_file(__DIR__ . '/testfiles/test007.ppt'); self::$record_7 = record_adapter::create(self::$collection, self::$record_sf_7); } if ((static::$need_records === true || static::$need_records >= 8) && !self::$record_8 instanceof record_adapter) { echo "generate record 8\n"; - self::$record_sf_8 = new system_file(dirname(__FILE__) . '/testfiles/test008.ai'); + self::$record_sf_8 = new system_file(__DIR__ . '/testfiles/test008.ai'); self::$record_8 = record_adapter::create(self::$collection, self::$record_sf_8); } if ((static::$need_records === true || static::$need_records >= 9) && !self::$record_9 instanceof record_adapter) { echo "generate record 9\n"; - self::$record_sf_9 = new system_file(dirname(__FILE__) . '/testfiles/test009.TIFF'); + self::$record_sf_9 = new system_file(__DIR__ . '/testfiles/test009.TIFF'); self::$record_9 = record_adapter::create(self::$collection, self::$record_sf_9); } if ((static::$need_records === true || static::$need_records >= 10) && !self::$record_10 instanceof record_adapter) { - self::$record_sf_10 = new system_file(dirname(__FILE__) . '/testfiles/test010.fla'); + self::$record_sf_10 = new system_file(__DIR__ . '/testfiles/test010.fla'); echo "generate record 10\n"; self::$record_10 = record_adapter::create(self::$collection, self::$record_sf_10); } if ((static::$need_records === true || static::$need_records >= 11) && !self::$record_11 instanceof record_adapter) { - self::$record_sf_11 = new system_file(dirname(__FILE__) . '/testfiles/test011.swf'); + self::$record_sf_11 = new system_file(__DIR__ . '/testfiles/test011.swf'); echo "generate record 11\n"; self::$record_11 = record_adapter::create(self::$collection, self::$record_sf_11); } if ((static::$need_records === true || static::$need_records >= 12) && !self::$record_12 instanceof record_adapter) { - self::$record_sf_12 = new system_file(dirname(__FILE__) . '/testfiles/test012.wav'); + self::$record_sf_12 = new system_file(__DIR__ . '/testfiles/test012.wav'); echo "generate record 12\n"; self::$record_12 = record_adapter::create(self::$collection, self::$record_sf_12); } if ((static::$need_records === true || static::$need_records >= 13) && !self::$record_13 instanceof record_adapter) { - self::$record_sf_13 = new system_file(dirname(__FILE__) . '/testfiles/test013.ai'); + self::$record_sf_13 = new system_file(__DIR__ . '/testfiles/test013.ai'); echo "generate record 13\n"; self::$record_13 = record_adapter::create(self::$collection, self::$record_sf_13); } if ((static::$need_records === true || static::$need_records >= 14) && !self::$record_14 instanceof record_adapter) { echo "generate record 14\n"; - self::$record_sf_14 = new system_file(dirname(__FILE__) . '/testfiles/test014.swf'); + self::$record_sf_14 = new system_file(__DIR__ . '/testfiles/test014.swf'); self::$record_14 = record_adapter::create(self::$collection, self::$record_sf_14); } if ((static::$need_records === true || static::$need_records >= 15) && !self::$record_15 instanceof record_adapter) { echo "generate record 15\n"; - self::$record_sf_15 = new system_file(dirname(__FILE__) . '/testfiles/test015.eps'); + self::$record_sf_15 = new system_file(__DIR__ . '/testfiles/test015.eps'); self::$record_15 = record_adapter::create(self::$collection, self::$record_sf_15); } if ((static::$need_records === true || static::$need_records >= 16) && !self::$record_16 instanceof record_adapter) { echo "generate record 16\n"; - self::$record_sf_16 = new system_file(dirname(__FILE__) . '/testfiles/test016.ai'); + self::$record_sf_16 = new system_file(__DIR__ . '/testfiles/test016.ai'); self::$record_16 = record_adapter::create(self::$collection, self::$record_sf_16); } if ((static::$need_records === true || static::$need_records >= 17) && !self::$record_17 instanceof record_adapter) { echo "generate record 17\n"; - self::$record_sf_17 = new system_file(dirname(__FILE__) . '/testfiles/test017.wav'); + self::$record_sf_17 = new system_file(__DIR__ . '/testfiles/test017.wav'); self::$record_17 = record_adapter::create(self::$collection, self::$record_sf_17); } if ((static::$need_records === true || static::$need_records >= 18) && !self::$record_18 instanceof record_adapter) { echo "generate record 18\n"; - self::$record_sf_18 = new system_file(dirname(__FILE__) . '/testfiles/test018.TIFF'); + self::$record_sf_18 = new system_file(__DIR__ . '/testfiles/test018.TIFF'); self::$record_18 = record_adapter::create(self::$collection, self::$record_sf_18); } if ((static::$need_records === true || static::$need_records >= 19) && !self::$record_19 instanceof record_adapter) { echo "generate record 19\n"; - self::$record_sf_19 = new system_file(dirname(__FILE__) . '/testfiles/test019.mp3'); + self::$record_sf_19 = new system_file(__DIR__ . '/testfiles/test019.mp3'); self::$record_19 = record_adapter::create(self::$collection, self::$record_sf_19); } if ((static::$need_records === true || static::$need_records >= 20) && !self::$record_20 instanceof record_adapter) { echo "generate record 20\n"; - self::$record_sf_20 = new system_file(dirname(__FILE__) . '/testfiles/test020.mp3'); + self::$record_sf_20 = new system_file(__DIR__ . '/testfiles/test020.mp3'); self::$record_20 = record_adapter::create(self::$collection, self::$record_sf_20); } if ((static::$need_records === true || static::$need_records >= 21) && !self::$record_21 instanceof record_adapter) { echo "generate record 21\n"; - self::$record_sf_21 = new system_file(dirname(__FILE__) . '/testfiles/test021.fla'); + self::$record_sf_21 = new system_file(__DIR__ . '/testfiles/test021.fla'); self::$record_21 = record_adapter::create(self::$collection, self::$record_sf_21); } if ((static::$need_records === true || static::$need_records >= 22) && !self::$record_22 instanceof record_adapter) { echo "generate record 22\n"; - self::$record_sf_22 = new system_file(dirname(__FILE__) . '/testfiles/test022.swf'); + self::$record_sf_22 = new system_file(__DIR__ . '/testfiles/test022.swf'); self::$record_22 = record_adapter::create(self::$collection, self::$record_sf_22); } if ((static::$need_records === true || static::$need_records >= 23) && !self::$record_23 instanceof record_adapter) { echo "generate record 23\n"; - self::$record_sf_23 = new system_file(dirname(__FILE__) . '/testfiles/test023.mp4'); + self::$record_sf_23 = new system_file(__DIR__ . '/testfiles/test023.mp4'); self::$record_23 = record_adapter::create(self::$collection, self::$record_sf_23); } } diff --git a/lib/unitTest/PhraseanetPHPUnitAuthenticatedAbstract.class.inc b/lib/unitTest/PhraseanetPHPUnitAuthenticatedAbstract.class.inc index 96fcd94f14..6134b4d7e8 100644 --- a/lib/unitTest/PhraseanetPHPUnitAuthenticatedAbstract.class.inc +++ b/lib/unitTest/PhraseanetPHPUnitAuthenticatedAbstract.class.inc @@ -15,7 +15,7 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -require_once dirname(__FILE__) . '/PhraseanetPHPUnitAbstract.class.inc'; +require_once __DIR__ . '/PhraseanetPHPUnitAbstract.class.inc'; use Silex\WebTestCase; use Symfony\Component\HttpKernel\Client; diff --git a/lib/unitTest/PhraseanetWebTestCaseAbstract.class.inc b/lib/unitTest/PhraseanetWebTestCaseAbstract.class.inc index 1f16747e80..6f3ab7ec47 100644 --- a/lib/unitTest/PhraseanetWebTestCaseAbstract.class.inc +++ b/lib/unitTest/PhraseanetWebTestCaseAbstract.class.inc @@ -15,13 +15,13 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -require_once dirname(__FILE__) . '/PhraseanetPHPUnitAbstract.class.inc'; +require_once __DIR__ . '/PhraseanetPHPUnitAbstract.class.inc'; use Silex\WebTestCase; use Symfony\Component\HttpKernel\Client; use Symfony\Component\HttpFoundation\Response; -abstract class PhraseanetWebTestCaseAbstract extends PhraseanetPHPUnitAbstract +abstract class PhraseanetWebTestCaseAbstract extends \PhraseanetPHPUnitAbstract { } \ No newline at end of file diff --git a/lib/unitTest/Session/Authentication/Session_Authentication_GuestTest.php b/lib/unitTest/Session/Authentication/Session_Authentication_GuestTest.php index 2efe5049e4..778d9df541 100644 --- a/lib/unitTest/Session/Authentication/Session_Authentication_GuestTest.php +++ b/lib/unitTest/Session/Authentication/Session_Authentication_GuestTest.php @@ -1,6 +1,6 @@ get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); $record_id = $record->get_record_id(); @@ -368,7 +368,7 @@ class API_V1_test_adapter extends PhraseanetWebTestCaseAbstract $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -400,7 +400,7 @@ class API_V1_test_adapter extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -432,7 +432,7 @@ class API_V1_test_adapter extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -553,7 +553,7 @@ class API_V1_test_adapter extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -589,7 +589,7 @@ class API_V1_test_adapter extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -659,7 +659,7 @@ class API_V1_test_adapter extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -723,7 +723,7 @@ class API_V1_test_adapter extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); diff --git a/lib/unitTest/api/v1/aplicationYamlTest.php b/lib/unitTest/api/v1/aplicationYamlTest.php index 045d530fb6..efc231b877 100644 --- a/lib/unitTest/api/v1/aplicationYamlTest.php +++ b/lib/unitTest/api/v1/aplicationYamlTest.php @@ -1,7 +1,7 @@ get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); $record_id = $record->get_record_id(); @@ -376,7 +376,7 @@ class API_V1_test_adapterYaml extends PhraseanetWebTestCaseAbstract $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -408,7 +408,7 @@ class API_V1_test_adapterYaml extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -440,7 +440,7 @@ class API_V1_test_adapterYaml extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -562,7 +562,7 @@ class API_V1_test_adapterYaml extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -598,7 +598,7 @@ class API_V1_test_adapterYaml extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -668,7 +668,7 @@ class API_V1_test_adapterYaml extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); @@ -732,7 +732,7 @@ class API_V1_test_adapterYaml extends PhraseanetWebTestCaseAbstract { $databox = databox::get_instance($databox_id); $collection = array_shift($databox->get_collections()); - $system_file = new system_file(dirname(__FILE__) . '/../../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../../testfiles/cestlafete.jpg'); $record = record_adapter::create($collection, $system_file); diff --git a/lib/unitTest/collectionTest.php b/lib/unitTest/collectionTest.php index 421553d387..043d021722 100644 --- a/lib/unitTest/collectionTest.php +++ b/lib/unitTest/collectionTest.php @@ -1,6 +1,6 @@ assertTrue(self::$object->get_record_amount() > 0); self::$object->empty_collection(); $this->assertTrue(self::$object->get_record_amount() === 0); @@ -136,7 +136,7 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGet_record_amount() { self::$object->empty_collection(); - $record = record_adapter::create(self::$object, new system_file(dirname(__FILE__) . '/testfiles/cestlafete.jpg')); + $record = record_adapter::create(self::$object, new system_file(__DIR__ . '/testfiles/cestlafete.jpg')); $this->assertTrue(self::$object->get_record_amount() === 1); self::$object->empty_collection(); $this->assertTrue(self::$object->get_record_amount() === 0); @@ -144,7 +144,7 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGet_record_details() { - $record = record_adapter::create(self::$object, new system_file(dirname(__FILE__) . '/testfiles/cestlafete.jpg')); + $record = record_adapter::create(self::$object, new system_file(__DIR__ . '/testfiles/cestlafete.jpg')); $details = self::$object->get_record_details(); $this->assertTrue(is_array($details)); @@ -164,7 +164,7 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testUpdate_logo() { - $pathfile = new system_file(dirname(__FILE__) . '/testfiles/logocoll.gif'); + $pathfile = new system_file(__DIR__ . '/testfiles/logocoll.gif'); self::$object->update_logo($pathfile); $this->assertEquals(file_get_contents($pathfile->getPathname()), self::$object->get_binary_minilogos()); } diff --git a/lib/unitTest/databox/Field/DCES/databox_Field_DCES_ContributorTest.php b/lib/unitTest/databox/Field/DCES/databox_Field_DCES_ContributorTest.php index 4892fd3b11..46f3cba24c 100644 --- a/lib/unitTest/databox/Field/DCES/databox_Field_DCES_ContributorTest.php +++ b/lib/unitTest/databox/Field/DCES/databox_Field_DCES_ContributorTest.php @@ -1,6 +1,6 @@ execute(array('command' => $command->getName())); $this->assertEquals( - trim(file_get_contents(dirname(__FILE__) . '/../../../../AUTHORS')) + trim(file_get_contents(__DIR__ . '/../../../../AUTHORS')) , trim($commandTester->getDisplay()) ); } diff --git a/lib/unitTest/module/console/module_console_aboutLicenseTest.php b/lib/unitTest/module/console/module_console_aboutLicenseTest.php index 8a4bb23dc0..c6b4e080af 100644 --- a/lib/unitTest/module/console/module_console_aboutLicenseTest.php +++ b/lib/unitTest/module/console/module_console_aboutLicenseTest.php @@ -1,6 +1,6 @@ execute(array('command' => $command->getName())); $this->assertEquals( - trim(file_get_contents(dirname(__FILE__) . '/../../../../LICENSE')) + trim(file_get_contents(__DIR__ . '/../../../../LICENSE')) , trim($commandTester->getDisplay()) ); } diff --git a/lib/unitTest/module/console/module_console_schedulerStartTest.php b/lib/unitTest/module/console/module_console_schedulerStartTest.php index 4cdc6aa828..e116e13552 100644 --- a/lib/unitTest/module/console/module_console_schedulerStartTest.php +++ b/lib/unitTest/module/console/module_console_schedulerStartTest.php @@ -1,6 +1,6 @@ extract_metadatas($databox->get_meta_structure()); static::$record_23->set_metadatas($metadatas['metadatas']); - $system_file = new system_file(dirname(__FILE__) . '/../testfiles/cestlafete.jpg'); + $system_file = new system_file(__DIR__ . '/../testfiles/cestlafete.jpg'); } public static function tearDownAfterClass() @@ -195,7 +195,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract if (!($coll instanceof collection)) $this->fail('Unable to find a collection'); - $record = record_adapter::create($coll, new system_file(dirname(__FILE__) . '/../testfiles/cestlafete.jpg')); + $record = record_adapter::create($coll, new system_file(__DIR__ . '/../testfiles/cestlafete.jpg')); $this->assertEquals('image/jpeg', $record->get_mime()); $record->delete(); diff --git a/lib/unitTest/recordutilsTest.php b/lib/unitTest/recordutilsTest.php index d3e080f8b8..501f48e203 100644 --- a/lib/unitTest/recordutilsTest.php +++ b/lib/unitTest/recordutilsTest.php @@ -1,6 +1,6 @@ objects['indd'] = new system_file(dirname(__FILE__) . '/../../vendor/exiftool/t/images/InDesign.indd'); - $this->objects['wav'] = new system_file(dirname(__FILE__) . '/../testfiles/test012.wav'); - $this->objects['jpg'] = new system_file(dirname(__FILE__) . '/../../vendor/exiftool/t/images/Casio.jpg'); + $this->objects['indd'] = new system_file(__DIR__ . '/../../vendor/exiftool/t/images/InDesign.indd'); + $this->objects['wav'] = new system_file(__DIR__ . '/../testfiles/test012.wav'); + $this->objects['jpg'] = new system_file(__DIR__ . '/../../vendor/exiftool/t/images/Casio.jpg'); } public function testGet_mime() @@ -83,7 +83,7 @@ class system_fileTest extends PhraseanetPHPUnitAbstract public function testGetPath() { - $supposed = dirname(__FILE__) . '/../../vendor/exiftool/t/images/'; + $supposed = __DIR__ . '/../../vendor/exiftool/t/images/'; $this->assertEquals($supposed, $this->objects['indd']->getPath()); } @@ -155,7 +155,7 @@ class system_fileTest extends PhraseanetPHPUnitAbstract public function testMkdir() { - $path = dirname(__FILE__) . '/test/dir/to/create/'; + $path = __DIR__ . '/test/dir/to/create/'; if (is_dir($path)) { $this->fail('unable to create directory : directory already extists'); @@ -168,14 +168,14 @@ class system_fileTest extends PhraseanetPHPUnitAbstract $path = dirname($path); rmdir($path); $path = dirname($path); - rmdir(dirname(__FILE__) . '/test'); + rmdir(__DIR__ . '/test'); $path = dirname($path); } public function testChmod() { - $file = dirname(__FILE__) . '/../testfiles/cestlafete.jpg'; - $dir = dirname(__FILE__) . '/testchmod'; + $file = __DIR__ . '/../testfiles/cestlafete.jpg'; + $dir = __DIR__ . '/testchmod'; system_file::mkdir($dir); chmod($file, 0700); @@ -192,8 +192,8 @@ class system_fileTest extends PhraseanetPHPUnitAbstract public function testEmpty_directory() { - $file = dirname(__FILE__) . '/../testfiles/cestlafete.jpg'; - $dir = dirname(__FILE__) . '/testchmod'; + $file = __DIR__ . '/../testfiles/cestlafete.jpg'; + $dir = __DIR__ . '/testchmod'; system_file::mkdir($dir); copy($file, $dir . '/v1.test'); diff --git a/lib/unitTest/system/system_serverTest.php b/lib/unitTest/system/system_serverTest.php index 908ff8266c..f45d6c05b2 100644 --- a/lib/unitTest/system/system_serverTest.php +++ b/lib/unitTest/system/system_serverTest.php @@ -1,6 +1,6 @@