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 @@