@@ -79,7 +79,7 @@ public function testCreateDynamic()
7979 {
8080 $ tar = new Tar ();
8181
82- $ dir = dirname ( __FILE__ ) . '/tar ' ;
82+ $ dir = __DIR__ . '/tar ' ;
8383 $ tdir = ltrim ($ dir , '/ ' );
8484
8585 $ tar ->create ();
@@ -117,7 +117,7 @@ public function testCreateFile()
117117 {
118118 $ tar = new Tar ();
119119
120- $ dir = dirname ( __FILE__ ) . '/tar ' ;
120+ $ dir = __DIR__ . '/tar ' ;
121121 $ tdir = ltrim ($ dir , '/ ' );
122122 $ tmp = vfsStream::url ('home_root_path/test.tar ' );
123123
@@ -153,7 +153,7 @@ public function testCreateFile()
153153 */
154154 public function testTarcontent ()
155155 {
156- $ dir = dirname ( __FILE__ ) . '/tar ' ;
156+ $ dir = __DIR__ . '/tar ' ;
157157
158158 foreach ($ this ->extensions as $ ext ) {
159159 $ tar = new Tar ();
@@ -178,7 +178,7 @@ public function testTarcontent()
178178 public function testDogfood ()
179179 {
180180 foreach ($ this ->extensions as $ ext ) {
181- $ input = glob (dirname ( __FILE__ ) . '/../src/* ' );
181+ $ input = glob (__DIR__ . '/../src/* ' );
182182 $ archive = sys_get_temp_dir () . '/dwtartest ' . md5 (time ()) . '. ' . $ ext ;
183183 $ extract = sys_get_temp_dir () . '/dwtartest ' . md5 (time () + 1 );
184184
@@ -250,7 +250,7 @@ protected function nativeCheck($archive, $ext)
250250 */
251251 public function testTarExtract ()
252252 {
253- $ dir = dirname ( __FILE__ ) . '/tar ' ;
253+ $ dir = __DIR__ . '/tar ' ;
254254 $ out = sys_get_temp_dir () . '/dwtartest ' . md5 (time ());
255255
256256 foreach ($ this ->extensions as $ ext ) {
@@ -277,7 +277,7 @@ public function testTarExtract()
277277 */
278278 public function testCompStripExtract ()
279279 {
280- $ dir = dirname ( __FILE__ ) . '/tar ' ;
280+ $ dir = __DIR__ . '/tar ' ;
281281 $ out = sys_get_temp_dir () . '/dwtartest ' . md5 (time ());
282282
283283 foreach ($ this ->extensions as $ ext ) {
@@ -304,7 +304,7 @@ public function testCompStripExtract()
304304 */
305305 public function testPrefixStripExtract ()
306306 {
307- $ dir = dirname ( __FILE__ ) . '/tar ' ;
307+ $ dir = __DIR__ . '/tar ' ;
308308 $ out = sys_get_temp_dir () . '/dwtartest ' . md5 (time ());
309309
310310 foreach ($ this ->extensions as $ ext ) {
@@ -331,7 +331,7 @@ public function testPrefixStripExtract()
331331 */
332332 public function testIncludeExtract ()
333333 {
334- $ dir = dirname ( __FILE__ ) . '/tar ' ;
334+ $ dir = __DIR__ . '/tar ' ;
335335 $ out = sys_get_temp_dir () . '/dwtartest ' . md5 (time ());
336336
337337 foreach ($ this ->extensions as $ ext ) {
@@ -357,7 +357,7 @@ public function testIncludeExtract()
357357 */
358358 public function testExcludeExtract ()
359359 {
360- $ dir = dirname ( __FILE__ ) . '/tar ' ;
360+ $ dir = __DIR__ . '/tar ' ;
361361 $ out = sys_get_temp_dir () . '/dwtartest ' . md5 (time ());
362362
363363 foreach ($ this ->extensions as $ ext ) {
@@ -394,7 +394,7 @@ public function testFileType()
394394 $ this ->assertEquals (Tar::COMPRESS_BZIP , $ tar ->filetype ('foo.tar.BZ2 ' ));
395395 $ this ->assertEquals (Tar::COMPRESS_BZIP , $ tar ->filetype ('foo.tar.bz2 ' ));
396396
397- $ dir = dirname ( __FILE__ ) . '/tar ' ;
397+ $ dir = __DIR__ . '/tar ' ;
398398 $ this ->assertEquals (Tar::COMPRESS_NONE , $ tar ->filetype ("$ dir/test.tar " ));
399399 $ this ->assertEquals (Tar::COMPRESS_GZIP , $ tar ->filetype ("$ dir/test.tgz " ));
400400 $ this ->assertEquals (Tar::COMPRESS_BZIP , $ tar ->filetype ("$ dir/test.tbz " ));
@@ -408,7 +408,7 @@ public function testFileType()
408408 */
409409 public function testLongPathExtract ()
410410 {
411- $ dir = dirname ( __FILE__ ) . '/tar ' ;
411+ $ dir = __DIR__ . '/tar ' ;
412412 $ out = vfsStream::url ('home_root_path/dwtartest ' . md5 (time ()));
413413
414414 foreach (array ('ustar ' , 'gnu ' ) as $ format ) {
@@ -504,7 +504,7 @@ public function testCreateLongPathGnu()
504504 */
505505 public function testTarBomb ()
506506 {
507- $ dir = dirname ( __FILE__ ) . '/tar ' ;
507+ $ dir = __DIR__ . '/tar ' ;
508508 $ out = vfsStream::url ('home_root_path/dwtartest ' . md5 (time ()));
509509
510510 $ tar = new Tar ();
@@ -524,7 +524,7 @@ public function testTarBomb()
524524 */
525525 public function testZeroFile ()
526526 {
527- $ dir = dirname ( __FILE__ ) . '/tar ' ;
527+ $ dir = __DIR__ . '/tar ' ;
528528 $ tar = new Tar ();
529529 $ tar ->setCompression (0 );
530530 $ tar ->create ();
@@ -582,7 +582,7 @@ public function testZeroByteFile() {
582582 */
583583 public function testBlockFile ()
584584 {
585- $ dir = dirname ( __FILE__ ) . '/tar ' ;
585+ $ dir = __DIR__ . '/tar ' ;
586586 $ tar = new Tar ();
587587 $ tar ->setCompression (0 );
588588 $ tar ->create ();
@@ -609,7 +609,7 @@ public function testBlockData()
609609 public function testGzipIsValid ()
610610 {
611611 foreach (['tgz ' , 'tar.gz ' ] as $ ext ) {
612- $ input = glob (dirname ( __FILE__ ) . '/../src/* ' );
612+ $ input = glob (__DIR__ . '/../src/* ' );
613613 $ archive = sys_get_temp_dir () . '/dwtartest ' . md5 (time ()) . '. ' . $ ext ;
614614 $ extract = sys_get_temp_dir () . '/dwtartest ' . md5 (time () + 1 );
615615
@@ -649,7 +649,7 @@ public function testContentsWithInvalidArchiveStream()
649649 public function testExtractWithInvalidOutDir ()
650650 {
651651 $ this ->expectException (ArchiveIOException::class);
652- $ dir = dirname ( __FILE__ ) . '/tar ' ;
652+ $ dir = __DIR__ . '/tar ' ;
653653 $ out = '/root/invalid_out_dir ' ;
654654
655655 $ tar = new Tar ();
@@ -661,7 +661,7 @@ public function testExtractWithInvalidOutDir()
661661 public function testExtractWithArchiveStreamIsClosed ()
662662 {
663663 $ this ->expectException (ArchiveIOException::class);
664- $ dir = dirname ( __FILE__ ) . '/tar ' ;
664+ $ dir = __DIR__ . '/tar ' ;
665665 $ out = '/root/invalid_out_dir ' ;
666666
667667 $ tar = new Tar ();
@@ -674,7 +674,7 @@ public function testExtractWithArchiveStreamIsClosed()
674674 public function testCreateWithInvalidFile ()
675675 {
676676 $ this ->expectException (ArchiveIOException::class);
677- $ dir = dirname ( __FILE__ ) . '/tar ' ;
677+ $ dir = __DIR__ . '/tar ' ;
678678 $ tar = new Tar ();
679679
680680 $ tar ->open ("$ dir/tarbomb.tgz " );
@@ -730,7 +730,7 @@ public function testCloseHasBeenClosed()
730730 */
731731 public function testGetArchiveWithBzipCompress ()
732732 {
733- $ dir = dirname ( __FILE__ ) . '/tar ' ;
733+ $ dir = __DIR__ . '/tar ' ;
734734 $ tar = new Tar ();
735735 $ tar ->setCompression (9 , Tar::COMPRESS_BZIP );
736736 $ tar ->create ();
@@ -742,7 +742,7 @@ public function testGetArchiveWithBzipCompress()
742742
743743 public function testSaveWithCompressionAuto ()
744744 {
745- $ dir = dirname ( __FILE__ ) . '/tar ' ;
745+ $ dir = __DIR__ . '/tar ' ;
746746 $ tar = new Tar ();
747747 $ tar ->setCompression (-1 );
748748 $ tar ->create ();
@@ -755,7 +755,7 @@ public function testSaveWithCompressionAuto()
755755 public function testSaveWithInvalidDestinationFile ()
756756 {
757757 $ this ->expectException (ArchiveIOException::class);
758- $ dir = dirname ( __FILE__ ) . '/tar ' ;
758+ $ dir = __DIR__ . '/tar ' ;
759759 $ tar = new Tar ();
760760 $ tar ->setCompression ();
761761 $ tar ->create ();
0 commit comments