summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorFabien Villepinte <fabien.villepinte@gmail.com>2019-03-15 22:55:30 +0100
committerPeter Kokot <peterkokot@gmail.com>2019-03-15 22:55:30 +0100
commit26dfce7f36d1c6f737ac241df1315a1b42b932c7 (patch)
tree570279b2f4d66a3de7f6ff7f7c865654ad04cea4 /ext/gd
parent63802a8446691869371bb37078d55b99cae7eb95 (diff)
downloadphp-git-26dfce7f36d1c6f737ac241df1315a1b42b932c7.tar.gz
Replace dirname(__FILE__) by __DIR__ in tests
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/tests/001-mb.phpt2
-rw-r--r--ext/gd/tests/001.phpt2
-rw-r--r--ext/gd/tests/bug36697-mb.phpt2
-rw-r--r--ext/gd/tests/bug36697.phpt2
-rw-r--r--ext/gd/tests/bug37346-mb.phpt2
-rw-r--r--ext/gd/tests/bug37346.phpt2
-rw-r--r--ext/gd/tests/bug37360.phpt2
-rw-r--r--ext/gd/tests/bug38112.phpt2
-rw-r--r--ext/gd/tests/bug38212-mb.phpt2
-rw-r--r--ext/gd/tests/bug38212.phpt2
-rw-r--r--ext/gd/tests/bug39780.phpt2
-rw-r--r--ext/gd/tests/bug39780_extern.phpt2
-rw-r--r--ext/gd/tests/bug41442.phpt4
-rw-r--r--ext/gd/tests/bug43073.phpt4
-rw-r--r--ext/gd/tests/bug43121.phpt2
-rw-r--r--ext/gd/tests/bug48555.phpt2
-rw-r--r--ext/gd/tests/bug48732-mb.phpt4
-rw-r--r--ext/gd/tests/bug48732.phpt4
-rw-r--r--ext/gd/tests/bug48801-mb.phpt2
-rw-r--r--ext/gd/tests/bug48801.phpt2
-rw-r--r--ext/gd/tests/bug49600.phpt2
-rw-r--r--ext/gd/tests/bug51263.phpt2
-rw-r--r--ext/gd/tests/bug53504.phpt4
-rw-r--r--ext/gd/tests/bug72339.phpt2
-rw-r--r--ext/gd/tests/colorat.phpt2
-rw-r--r--ext/gd/tests/crafted_gd2.phpt2
-rw-r--r--ext/gd/tests/createfromgd2.phpt2
-rw-r--r--ext/gd/tests/createfromstring.phpt6
-rw-r--r--ext/gd/tests/createfromwbmp-mb.phpt2
-rw-r--r--ext/gd/tests/createfromwbmp.phpt2
-rw-r--r--ext/gd/tests/createfromwbmp2.phpt2
-rw-r--r--ext/gd/tests/createfromwbmp2_extern.phpt2
-rw-r--r--ext/gd/tests/gif.phpt4
-rw-r--r--ext/gd/tests/gif2gd.phpt2
-rw-r--r--ext/gd/tests/gif2jpg.phpt2
-rw-r--r--ext/gd/tests/gif2png.phpt2
-rw-r--r--ext/gd/tests/imagecolorstotal_basic.phpt2
-rw-r--r--ext/gd/tests/imagefilter.phpt2
-rw-r--r--ext/gd/tests/imagefttext.phpt2
-rw-r--r--ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt2
-rw-r--r--ext/gd/tests/imageloadfont_invalid.phpt2
-rw-r--r--ext/gd/tests/imagewbmp-mb.phpt2
-rw-r--r--ext/gd/tests/imagewbmp.phpt2
-rw-r--r--ext/gd/tests/jpeg2png.phpt2
-rw-r--r--ext/gd/tests/jpeg2wbmp_error1.phpt8
-rw-r--r--ext/gd/tests/jpeg2wbmp_error2-mb.phpt4
-rw-r--r--ext/gd/tests/jpeg2wbmp_error2.phpt4
-rw-r--r--ext/gd/tests/jpeg2wbmp_error3.phpt4
-rw-r--r--ext/gd/tests/jpg2gd-mb.phpt2
-rw-r--r--ext/gd/tests/jpg2gd.phpt2
-rw-r--r--ext/gd/tests/libgd00086.phpt2
-rw-r--r--ext/gd/tests/libgd00086_extern.phpt2
-rw-r--r--ext/gd/tests/libgd00094-mb.phpt2
-rw-r--r--ext/gd/tests/libgd00094.phpt2
-rw-r--r--ext/gd/tests/libgd00101.phpt2
-rw-r--r--ext/gd/tests/png2gd.phpt2
-rw-r--r--ext/gd/tests/png2wbmp_error1-mb.phpt8
-rw-r--r--ext/gd/tests/png2wbmp_error1.phpt8
-rw-r--r--ext/gd/tests/png2wbmp_error2.phpt4
-rw-r--r--ext/gd/tests/png2wbmp_error3.phpt4
-rw-r--r--ext/gd/tests/pngcomp.phpt2
-rw-r--r--ext/gd/tests/xbm2png.phpt2
-rw-r--r--ext/gd/tests/xpm2gd.phpt2
-rw-r--r--ext/gd/tests/xpm2jpg.phpt2
-rw-r--r--ext/gd/tests/xpm2png.phpt2
65 files changed, 87 insertions, 87 deletions
diff --git a/ext/gd/tests/001-mb.phpt b/ext/gd/tests/001-mb.phpt
index 9307450f5b..8ee2e9a415 100644
--- a/ext/gd/tests/001-mb.phpt
+++ b/ext/gd/tests/001-mb.phpt
@@ -5,7 +5,7 @@ imagecreatefrompng() and empty/missing file
--FILE--
<?php
-$file = dirname(__FILE__)."/001私はガラスを食べられます.test";
+$file = __DIR__."/001私はガラスを食べられます.test";
@unlink($file);
var_dump(imagecreatefrompng($file));
diff --git a/ext/gd/tests/001.phpt b/ext/gd/tests/001.phpt
index 039511a558..b820ac1cc0 100644
--- a/ext/gd/tests/001.phpt
+++ b/ext/gd/tests/001.phpt
@@ -5,7 +5,7 @@ imagecreatefrompng() and empty/missing file
--FILE--
<?php
-$file = dirname(__FILE__)."/001.test";
+$file = __DIR__."/001.test";
@unlink($file);
var_dump(imagecreatefrompng($file));
diff --git a/ext/gd/tests/bug36697-mb.phpt b/ext/gd/tests/bug36697-mb.phpt
index b0b69a394f..371c8e48be 100644
--- a/ext/gd/tests/bug36697-mb.phpt
+++ b/ext/gd/tests/bug36697-mb.phpt
@@ -8,7 +8,7 @@ Bug #36697 (TrueColor transparency with GIF palette output).
?>
--FILE--
<?php
-$dest = dirname(__FILE__) . "/36697私はガラスを食べられます.gif";
+$dest = __DIR__ . "/36697私はガラスを食べられます.gif";
$im = imagecreatetruecolor(192, 36);
$trans_color = imagecolorallocate($im, 255, 0, 0);
diff --git a/ext/gd/tests/bug36697.phpt b/ext/gd/tests/bug36697.phpt
index 9335e5f58d..262b881ca0 100644
--- a/ext/gd/tests/bug36697.phpt
+++ b/ext/gd/tests/bug36697.phpt
@@ -8,7 +8,7 @@ Bug #36697 (TrueColor transparency with GIF palette output).
?>
--FILE--
<?php
-$dest = dirname(__FILE__) . "/36697.gif";
+$dest = __DIR__ . "/36697.gif";
$im = imagecreatetruecolor(192, 36);
$trans_color = imagecolorallocate($im, 255, 0, 0);
diff --git a/ext/gd/tests/bug37346-mb.phpt b/ext/gd/tests/bug37346-mb.phpt
index 90efc6391b..4ec5734fc7 100644
--- a/ext/gd/tests/bug37346-mb.phpt
+++ b/ext/gd/tests/bug37346-mb.phpt
@@ -6,7 +6,7 @@ Bug #37346 (gdimagecreatefromgif, bad colormap)
?>
--FILE--
<?php
-$im = imagecreatefromgif(dirname(__FILE__) . '/bug37346私はガラスを食べられます.gif');
+$im = imagecreatefromgif(__DIR__ . '/bug37346私はガラスを食べられます.gif');
?>
--EXPECTF--
Warning: imagecreatefromgif(): '%sbug37346私はガラスを食べられます.gif' is not a valid GIF file in %sbug37346-mb.php on line %d
diff --git a/ext/gd/tests/bug37346.phpt b/ext/gd/tests/bug37346.phpt
index 36d9c0a04a..57701a7ad7 100644
--- a/ext/gd/tests/bug37346.phpt
+++ b/ext/gd/tests/bug37346.phpt
@@ -6,7 +6,7 @@ Bug #37346 (gdimagecreatefromgif, bad colormap)
?>
--FILE--
<?php
-$im = imagecreatefromgif(dirname(__FILE__) . '/bug37346.gif');
+$im = imagecreatefromgif(__DIR__ . '/bug37346.gif');
?>
--EXPECTF--
Warning: imagecreatefromgif(): '%sbug37346.gif' is not a valid GIF file in %sbug37346.php on line %d
diff --git a/ext/gd/tests/bug37360.phpt b/ext/gd/tests/bug37360.phpt
index 44bbd96b88..c2b8b9592d 100644
--- a/ext/gd/tests/bug37360.phpt
+++ b/ext/gd/tests/bug37360.phpt
@@ -6,7 +6,7 @@ Bug #37360 (gdimagecreatefromgif, bad image sizes)
?>
--FILE--
<?php
-$im = imagecreatefromgif(dirname(__FILE__) . '/bug37360.gif');
+$im = imagecreatefromgif(__DIR__ . '/bug37360.gif');
var_dump($im);
?>
--EXPECTF--
diff --git a/ext/gd/tests/bug38112.phpt b/ext/gd/tests/bug38112.phpt
index 0e4b8afd3f..8a6911ad9d 100644
--- a/ext/gd/tests/bug38112.phpt
+++ b/ext/gd/tests/bug38112.phpt
@@ -8,7 +8,7 @@ Bug #38112 (GIF Invalid Code size ).
?>
--FILE--
<?php
-$im = imagecreatefromgif(dirname(__FILE__) . '/bug38112.gif');
+$im = imagecreatefromgif(__DIR__ . '/bug38112.gif');
?>
--EXPECTF--
Warning: imagecreatefromgif(): '%sbug38112.gif' is not a valid GIF file in %sbug38112.php on line %d
diff --git a/ext/gd/tests/bug38212-mb.phpt b/ext/gd/tests/bug38212-mb.phpt
index 266e470de0..a7a3d65f13 100644
--- a/ext/gd/tests/bug38212-mb.phpt
+++ b/ext/gd/tests/bug38212-mb.phpt
@@ -6,7 +6,7 @@ Bug #38212 (Seg Fault on invalid imagecreatefromgd2part() parameters)
?>
--FILE--
<?php
-$file = dirname(__FILE__) . '/bug38212私はガラスを食べられます.gd2';
+$file = __DIR__ . '/bug38212私はガラスを食べられます.gd2';
$im1 = imagecreatetruecolor(10,100);
imagefill($im1, 0,0, 0xffffff);
imagegd2($im1, $file);
diff --git a/ext/gd/tests/bug38212.phpt b/ext/gd/tests/bug38212.phpt
index 1459bb000d..039c6f971b 100644
--- a/ext/gd/tests/bug38212.phpt
+++ b/ext/gd/tests/bug38212.phpt
@@ -6,7 +6,7 @@ Bug #38212 (Seg Fault on invalid imagecreatefromgd2part() parameters)
?>
--FILE--
<?php
-$file = dirname(__FILE__) . '/bug38212.gd2';
+$file = __DIR__ . '/bug38212.gd2';
$im1 = imagecreatetruecolor(10,100);
imagefill($im1, 0,0, 0xffffff);
imagegd2($im1, $file);
diff --git a/ext/gd/tests/bug39780.phpt b/ext/gd/tests/bug39780.phpt
index 7bf9f56cb0..2a7af3e0f4 100644
--- a/ext/gd/tests/bug39780.phpt
+++ b/ext/gd/tests/bug39780.phpt
@@ -8,7 +8,7 @@ Bug #39780 (PNG image with CRC/data error raises a fatal error)
--FILE--
<?php
-$im = imagecreatefrompng(dirname(__FILE__) . '/bug39780.png');
+$im = imagecreatefrompng(__DIR__ . '/bug39780.png');
var_dump($im);
?>
--EXPECTF--
diff --git a/ext/gd/tests/bug39780_extern.phpt b/ext/gd/tests/bug39780_extern.phpt
index 65c3859c6a..0656e52fc7 100644
--- a/ext/gd/tests/bug39780_extern.phpt
+++ b/ext/gd/tests/bug39780_extern.phpt
@@ -8,7 +8,7 @@ Bug #39780 (PNG image with CRC/data error raises a fatal error)
--FILE--
<?php
-$im = imagecreatefrompng(dirname(__FILE__) . '/bug39780.png');
+$im = imagecreatefrompng(__DIR__ . '/bug39780.png');
var_dump($im);
?>
--EXPECTF--
diff --git a/ext/gd/tests/bug41442.phpt b/ext/gd/tests/bug41442.phpt
index ba5950dd15..5c590deb77 100644
--- a/ext/gd/tests/bug41442.phpt
+++ b/ext/gd/tests/bug41442.phpt
@@ -12,7 +12,7 @@ Bug #41442 (imagegd2() under output control)
--FILE--
<?php
-$str = file_get_contents(dirname(__FILE__).'/src.gd2');
+$str = file_get_contents(__DIR__.'/src.gd2');
$res = imagecreatefromstring($str);
/* string */
@@ -22,7 +22,7 @@ $str2 = ob_get_clean();
var_dump(imagecreatefromstring($str2));
/* file */
-$file = dirname(__FILE__)."/bug41442.gd2";
+$file = __DIR__."/bug41442.gd2";
imagegd2($res, $file);
$str2 = file_get_contents($file);
var_dump(imagecreatefromstring($str2));
diff --git a/ext/gd/tests/bug43073.phpt b/ext/gd/tests/bug43073.phpt
index 8b58e511cc..a8027338ef 100644
--- a/ext/gd/tests/bug43073.phpt
+++ b/ext/gd/tests/bug43073.phpt
@@ -25,7 +25,7 @@ $exp = [
[470,470, 548,549, 566,532, 488,453],
[492,439, 595,481, 604,458, 502,416]
];
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$font = "$cwd/Tuffy.ttf";
$delta_t = 360.0 / 16; # Make 16 steps around
$g = imagecreate(800, 800);
@@ -55,7 +55,7 @@ for ($angle = 0.0, $i = 0; $angle < 360.0; $angle += $delta_t, $i++) {
imagepng($g, "$cwd/bug43073.png");
?>
--CLEAN--
-<?php @unlink(dirname(__FILE__) . '/bug43073.png'); ?>
+<?php @unlink(__DIR__ . '/bug43073.png'); ?>
--EXPECT--
0: ........
1: ........
diff --git a/ext/gd/tests/bug43121.phpt b/ext/gd/tests/bug43121.phpt
index 08348d0012..1c3a7e5bc7 100644
--- a/ext/gd/tests/bug43121.phpt
+++ b/ext/gd/tests/bug43121.phpt
@@ -12,7 +12,7 @@ Bug #43121 (gdImageFill with IMG_COLOR_TILED crashes httpd)
$im = ImageCreate( 200, 100 );
$black = ImageColorAllocate( $im, 0, 0, 0 );
-$im_tile = ImageCreateFromGif(dirname(__FILE__) . "/bug43121.gif" );
+$im_tile = ImageCreateFromGif(__DIR__ . "/bug43121.gif" );
ImageSetTile( $im, $im_tile );
ImageFill( $im, 0, 0, IMG_COLOR_TILED );
diff --git a/ext/gd/tests/bug48555.phpt b/ext/gd/tests/bug48555.phpt
index 43e14db05f..03ee5a2b94 100644
--- a/ext/gd/tests/bug48555.phpt
+++ b/ext/gd/tests/bug48555.phpt
@@ -7,7 +7,7 @@ Bug #48555 (ImageFTBBox() differs from previous versions for texts with new line
?>
--FILE--
<?php
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$font = "$cwd/Tuffy.ttf";
$box = ImageFTBBox(14, 0, $font, "Text without line-break");
//echo 'Top without line-break: ' . $box[7] . "\n";
diff --git a/ext/gd/tests/bug48732-mb.phpt b/ext/gd/tests/bug48732-mb.phpt
index 8e937bfe8e..437731bb4b 100644
--- a/ext/gd/tests/bug48732-mb.phpt
+++ b/ext/gd/tests/bug48732-mb.phpt
@@ -8,7 +8,7 @@ Bug #48732 (TTF Bounding box wrong for letters below baseline)
?>
--FILE--
<?php
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$font = "$cwd/Tuffy私はガラスを食べられます.ttf";
$g = imagecreate(100, 50);
$bgnd = imagecolorallocate($g, 255, 255, 255);
@@ -18,6 +18,6 @@ imagepng($g, "$cwd/bug48732私はガラスを食べられます.png");
echo 'Left Bottom: (' . $bbox[0] . ', ' . $bbox[1] . ')';
?>
--CLEAN--
-<?php @unlink(dirname(__FILE__) . '/bug48732私はガラスを食べられます.png'); ?>
+<?php @unlink(__DIR__ . '/bug48732私はガラスを食べられます.png'); ?>
--EXPECT--
Left Bottom: (0, 46)
diff --git a/ext/gd/tests/bug48732.phpt b/ext/gd/tests/bug48732.phpt
index 5e77e06103..b2be6a47f1 100644
--- a/ext/gd/tests/bug48732.phpt
+++ b/ext/gd/tests/bug48732.phpt
@@ -7,7 +7,7 @@ Bug #48732 (TTF Bounding box wrong for letters below baseline)
?>
--FILE--
<?php
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$font = "$cwd/Tuffy.ttf";
$g = imagecreate(100, 50);
$bgnd = imagecolorallocate($g, 255, 255, 255);
@@ -17,6 +17,6 @@ imagepng($g, "$cwd/bug48732.png");
echo 'Left Bottom: (' . $bbox[0] . ', ' . $bbox[1] . ')';
?>
--CLEAN--
-<?php @unlink(dirname(__FILE__) . '/bug48732.png'); ?>
+<?php @unlink(__DIR__ . '/bug48732.png'); ?>
--EXPECT--
Left Bottom: (0, 46)
diff --git a/ext/gd/tests/bug48801-mb.phpt b/ext/gd/tests/bug48801-mb.phpt
index a2f6d28a82..1793ac3386 100644
--- a/ext/gd/tests/bug48801-mb.phpt
+++ b/ext/gd/tests/bug48801-mb.phpt
@@ -8,7 +8,7 @@ Bug #48801 (Problem with imagettfbbox)
?>
--FILE--
<?php
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$font = "$cwd/Tuffy私はガラスを食べられます.ttf";
$bbox = imageftbbox(50, 0, $font, "image");
echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n";
diff --git a/ext/gd/tests/bug48801.phpt b/ext/gd/tests/bug48801.phpt
index f55ed55844..b5e32af480 100644
--- a/ext/gd/tests/bug48801.phpt
+++ b/ext/gd/tests/bug48801.phpt
@@ -7,7 +7,7 @@ Bug #48801 (Problem with imagettfbbox)
?>
--FILE--
<?php
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$font = "$cwd/Tuffy.ttf";
$bbox = imageftbbox(50, 0, $font, "image");
echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n";
diff --git a/ext/gd/tests/bug49600.phpt b/ext/gd/tests/bug49600.phpt
index 1fb84f28bd..25fae3ca37 100644
--- a/ext/gd/tests/bug49600.phpt
+++ b/ext/gd/tests/bug49600.phpt
@@ -8,7 +8,7 @@ Bug #49600 (imageTTFText text shifted right)
?>
--FILE--
<?php
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$font = "$cwd/Tuffy.ttf";
$image = imagecreatetruecolor(50, 50);
$color = imagecolorallocate($image, 255, 255, 255);
diff --git a/ext/gd/tests/bug51263.phpt b/ext/gd/tests/bug51263.phpt
index 69496e011b..6f14cd3c98 100644
--- a/ext/gd/tests/bug51263.phpt
+++ b/ext/gd/tests/bug51263.phpt
@@ -7,7 +7,7 @@ Bug #51263 (imagettftext and rotated text uses wrong baseline)
?>
--FILE--
<?php
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$ttf = "$cwd/Tuffy.ttf";
$w = 23;
$h = 70;
diff --git a/ext/gd/tests/bug53504.phpt b/ext/gd/tests/bug53504.phpt
index bb6cc7a93f..3b2ce4c7eb 100644
--- a/ext/gd/tests/bug53504.phpt
+++ b/ext/gd/tests/bug53504.phpt
@@ -7,7 +7,7 @@ Bug #53504 imagettfbbox/imageftbbox gives incorrect values for bounding box
?>
--FILE--
<?php
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$font = "$cwd/Tuffy.ttf";
$g = imagecreate(800, 800);
@@ -84,7 +84,7 @@ foreach ($tests as $testnum => $test) {
imagepng($g, "$cwd/bug53504.png");
?>
--CLEAN--
-<?php @unlink(dirname(__FILE__) . '/bug53504.png'); ?>
+<?php @unlink(__DIR__ . '/bug53504.png'); ?>
--EXPECT--
0: ........
1: ........
diff --git a/ext/gd/tests/bug72339.phpt b/ext/gd/tests/bug72339.phpt
index eac5b630b2..d63ce67c55 100644
--- a/ext/gd/tests/bug72339.phpt
+++ b/ext/gd/tests/bug72339.phpt
@@ -9,7 +9,7 @@ if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
?>
--FILE--
<?php
-$fname = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug72339.gd";
+$fname = __DIR__ . DIRECTORY_SEPARATOR . "bug72339.gd";
$fh = fopen($fname, "w");
fwrite($fh, "gd2\x00");
diff --git a/ext/gd/tests/colorat.phpt b/ext/gd/tests/colorat.phpt
index be14873886..e8c1a5fb46 100644
--- a/ext/gd/tests/colorat.phpt
+++ b/ext/gd/tests/colorat.phpt
@@ -6,7 +6,7 @@ imagecolorat
?>
--FILE--
<?php
-$file = dirname(__FILE__) . '/im.wbmp';
+$file = __DIR__ . '/im.wbmp';
$im = imagecreatetruecolor(6,6);
imagefill($im, 0,0, 0xffffff);
diff --git a/ext/gd/tests/crafted_gd2.phpt b/ext/gd/tests/crafted_gd2.phpt
index 3fb7c2e004..60687dfa3c 100644
--- a/ext/gd/tests/crafted_gd2.phpt
+++ b/ext/gd/tests/crafted_gd2.phpt
@@ -8,7 +8,7 @@ Test max colors for a gd image.
?>
--FILE--
<?php
-imagecreatefromgd(dirname(__FILE__) . '/crafted.gd2');
+imagecreatefromgd(__DIR__ . '/crafted.gd2');
?>
--EXPECTF--
Warning: imagecreatefromgd(): '%scrafted.gd2' is not a valid GD file in %s on line %d
diff --git a/ext/gd/tests/createfromgd2.phpt b/ext/gd/tests/createfromgd2.phpt
index e43d1b865b..d6229d4f7e 100644
--- a/ext/gd/tests/createfromgd2.phpt
+++ b/ext/gd/tests/createfromgd2.phpt
@@ -6,7 +6,7 @@ imagecreatefromgd2
?>
--FILE--
<?php
-$file = dirname(__FILE__) . '/src.gd2';
+$file = __DIR__ . '/src.gd2';
$im2 = imagecreatefromgd2($file);
echo 'test create from gd2: ';
diff --git a/ext/gd/tests/createfromstring.phpt b/ext/gd/tests/createfromstring.phpt
index 7828725db5..6a4b1a7e11 100644
--- a/ext/gd/tests/createfromstring.phpt
+++ b/ext/gd/tests/createfromstring.phpt
@@ -7,14 +7,14 @@ imagecreatefromstring
?>
--FILE--
<?php
-$dir = dirname(__FILE__);
+$dir = __DIR__;
$im = imagecreatetruecolor(5,5);
imagefill($im, 0,0, 0xffffff);
imagesetpixel($im, 3,3, 0x0);
imagepng($im, $dir . '/tc.png');
-$im_string = file_get_contents(dirname(__FILE__) . '/tc.png');
+$im_string = file_get_contents(__DIR__ . '/tc.png');
$im = imagecreatefromstring($im_string);
echo 'createfromstring truecolor png: ';
if (imagecolorat($im, 3,3) != 0x0) {
@@ -34,7 +34,7 @@ imagefill($im, 0,0, $c1);
imagesetpixel($im, 3,3, $c2);
imagepng($im, $dir . '/p.png');
-$im_string = file_get_contents(dirname(__FILE__) . '/p.png');
+$im_string = file_get_contents(__DIR__ . '/p.png');
$im = imagecreatefromstring($im_string);
echo'createfromstring palette png: ';
diff --git a/ext/gd/tests/createfromwbmp-mb.phpt b/ext/gd/tests/createfromwbmp-mb.phpt
index 50e8a18780..f9dc9fe8bf 100644
--- a/ext/gd/tests/createfromwbmp-mb.phpt
+++ b/ext/gd/tests/createfromwbmp-mb.phpt
@@ -6,7 +6,7 @@ imagecreatefromwbmp
?>
--FILE--
<?php
-$file = dirname(__FILE__) . '/src私はガラスを食べられます.wbmp';
+$file = __DIR__ . '/src私はガラスを食べられます.wbmp';
$im2 = imagecreatefromwbmp($file);
echo 'test create from wbmp: ';
diff --git a/ext/gd/tests/createfromwbmp.phpt b/ext/gd/tests/createfromwbmp.phpt
index 589bbaf855..d58188b801 100644
--- a/ext/gd/tests/createfromwbmp.phpt
+++ b/ext/gd/tests/createfromwbmp.phpt
@@ -6,7 +6,7 @@ imagecreatefromwbmp
?>
--FILE--
<?php
-$file = dirname(__FILE__) . '/src.wbmp';
+$file = __DIR__ . '/src.wbmp';
$im2 = imagecreatefromwbmp($file);
echo 'test create from wbmp: ';
diff --git a/ext/gd/tests/createfromwbmp2.phpt b/ext/gd/tests/createfromwbmp2.phpt
index bbb475c423..e083b74c19 100644
--- a/ext/gd/tests/createfromwbmp2.phpt
+++ b/ext/gd/tests/createfromwbmp2.phpt
@@ -7,7 +7,7 @@ imagecreatefromwbmp with invalid wbmp
?>
--FILE--
<?php
-$filename = dirname(__FILE__) . '/_tmp.wbmp';
+$filename = __DIR__ . '/_tmp.wbmp';
$fp = fopen($filename,"wb");
if (!$fp) {
exit("Failed to create <$filename>");
diff --git a/ext/gd/tests/createfromwbmp2_extern.phpt b/ext/gd/tests/createfromwbmp2_extern.phpt
index 7be46f78f1..ed739461c4 100644
--- a/ext/gd/tests/createfromwbmp2_extern.phpt
+++ b/ext/gd/tests/createfromwbmp2_extern.phpt
@@ -7,7 +7,7 @@ imagecreatefromwbmp with invalid wbmp
?>
--FILE--
<?php
-$filename = dirname(__FILE__) . '/_tmp.wbmp';
+$filename = __DIR__ . '/_tmp.wbmp';
$fp = fopen($filename,"wb");
if (!$fp) {
exit("Failed to create <$filename>");
diff --git a/ext/gd/tests/gif.phpt b/ext/gd/tests/gif.phpt
index a28fadf9a8..218ef50fa4 100644
--- a/ext/gd/tests/gif.phpt
+++ b/ext/gd/tests/gif.phpt
@@ -13,7 +13,7 @@ gif in/out
<?php
function check_box($r,$g,$b, $error=0) {
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
$im2 = imagecreatefromgif($cwd . '/test_gif.gif');
$c = imagecolorsforindex($im2, imagecolorat($im2, 8,8));
@@ -42,7 +42,7 @@ function check_box($r,$g,$b, $error=0) {
}
}
}
-$cwd = dirname(__FILE__);
+$cwd = __DIR__;
$im = imagecreate(10,10);
$c = imagecolorallocate($im, 255,255,255);
diff --git a/ext/gd/tests/gif2gd.phpt b/ext/gd/tests/gif2gd.phpt
index 54a9601fb5..3fe9397fb6 100644
--- a/ext/gd/tests/gif2gd.phpt
+++ b/ext/gd/tests/gif2gd.phpt
@@ -12,7 +12,7 @@ gif --> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "GIF to GD1 conversion: ";
echo imagegd(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.gd1") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/gif2jpg.phpt b/ext/gd/tests/gif2jpg.phpt
index 5f32c35960..38d8963271 100644
--- a/ext/gd/tests/gif2jpg.phpt
+++ b/ext/gd/tests/gif2jpg.phpt
@@ -15,7 +15,7 @@ gif --> jpeg conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "GIF to JPEG conversion: ";
echo imagejpeg(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.jpeg") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/gif2png.phpt b/ext/gd/tests/gif2png.phpt
index 3b8beca249..27aac9cdd8 100644
--- a/ext/gd/tests/gif2png.phpt
+++ b/ext/gd/tests/gif2png.phpt
@@ -15,7 +15,7 @@ gif --> png conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "GIF to PNG conversion: ";
echo imagepng(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.png") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/imagecolorstotal_basic.phpt b/ext/gd/tests/imagecolorstotal_basic.phpt
index 9ae79d2224..22eb022fc2 100644
--- a/ext/gd/tests/imagecolorstotal_basic.phpt
+++ b/ext/gd/tests/imagecolorstotal_basic.phpt
@@ -20,7 +20,7 @@ if(!function_exists('imagecolorstotal') || !function_exists('imagecreatefromgif'
echo "*** Testing imagecolorstotal() : basic functionality ***\n";
// Get an image
-$gif = dirname(__FILE__)."/php.gif";
+$gif = __DIR__."/php.gif";
$im = imagecreatefromgif($gif);
echo 'Total colors in image: ' . imagecolorstotal($im);
diff --git a/ext/gd/tests/imagefilter.phpt b/ext/gd/tests/imagefilter.phpt
index 04a2395b8b..87efb1591e 100644
--- a/ext/gd/tests/imagefilter.phpt
+++ b/ext/gd/tests/imagefilter.phpt
@@ -19,7 +19,7 @@ $no_arg_filters = array(
"IMG_FILTER_MEAN_REMOVAL"
);
-$SAVE_DIR = dirname(__FILE__);
+$SAVE_DIR = __DIR__;
$SOURCE_IMG = $SAVE_DIR . "/test.png";
foreach ($no_arg_filters as $filt) {
diff --git a/ext/gd/tests/imagefttext.phpt b/ext/gd/tests/imagefttext.phpt
index 2a516cb6c5..85bca4d545 100644
--- a/ext/gd/tests/imagefttext.phpt
+++ b/ext/gd/tests/imagefttext.phpt
@@ -11,7 +11,7 @@ imagefttext() function test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
$fontfile_8859 = "$cwd/test8859.ttf";
function testrun($im, $fontfile) {
diff --git a/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt b/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt
index ef13bb179d..18f806d5b0 100644
--- a/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt
+++ b/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt
@@ -9,7 +9,7 @@ if (!extension_loaded('gd')) die("skip gd extension not available\n");
?>
--FILE--
<?php
-$filename = dirname(__FILE__) . '/font.gdf';
+$filename = __DIR__ . '/font.gdf';
// End of file while reading header
$bin = "\x41\x41\x41\x41\x00\x00\x00\x00\x00\x00";
diff --git a/ext/gd/tests/imageloadfont_invalid.phpt b/ext/gd/tests/imageloadfont_invalid.phpt
index 5246a0713d..ed9d9e3a30 100644
--- a/ext/gd/tests/imageloadfont_invalid.phpt
+++ b/ext/gd/tests/imageloadfont_invalid.phpt
@@ -6,7 +6,7 @@ imageloadfont() function crashes
?>
--FILE--
<?php
-$filename = dirname(__FILE__) . '/font.gdf';
+$filename = __DIR__ . '/font.gdf';
$bin = "\x41\x41\x41\x41\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00";
$fp = fopen($filename, 'wb');
fwrite($fp, $bin);
diff --git a/ext/gd/tests/imagewbmp-mb.phpt b/ext/gd/tests/imagewbmp-mb.phpt
index bb6cfdc655..fefbb066c7 100644
--- a/ext/gd/tests/imagewbmp-mb.phpt
+++ b/ext/gd/tests/imagewbmp-mb.phpt
@@ -6,7 +6,7 @@ imagewbmp
?>
--FILE--
<?php
-$file = dirname(__FILE__) . '/im私はガラスを食べられます.wbmp';
+$file = __DIR__ . '/im私はガラスを食べられます.wbmp';
$im = imagecreatetruecolor(6,6);
imagefill($im, 0,0, 0xffffff);
diff --git a/ext/gd/tests/imagewbmp.phpt b/ext/gd/tests/imagewbmp.phpt
index a10dbdb5f7..27491bb42e 100644
--- a/ext/gd/tests/imagewbmp.phpt
+++ b/ext/gd/tests/imagewbmp.phpt
@@ -6,7 +6,7 @@ imagewbmp
?>
--FILE--
<?php
-$file = dirname(__FILE__) . '/im.wbmp';
+$file = __DIR__ . '/im.wbmp';
$im = imagecreatetruecolor(6,6);
imagefill($im, 0,0, 0xffffff);
diff --git a/ext/gd/tests/jpeg2png.phpt b/ext/gd/tests/jpeg2png.phpt
index 0a170eeeed..6e136514a8 100644
--- a/ext/gd/tests/jpeg2png.phpt
+++ b/ext/gd/tests/jpeg2png.phpt
@@ -15,7 +15,7 @@ jpeg <--> png conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "PNG to JPEG conversion: ";
echo imagejpeg(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_jpeg.jpeg") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/jpeg2wbmp_error1.phpt b/ext/gd/tests/jpeg2wbmp_error1.phpt
index fcdef0bcb1..e8e0a7cf2e 100644
--- a/ext/gd/tests/jpeg2wbmp_error1.phpt
+++ b/ext/gd/tests/jpeg2wbmp_error1.phpt
@@ -19,8 +19,8 @@ $im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-$file = dirname(__FILE__) .'/simpletext.jpg';
-$file2 = dirname(__FILE__) .'/simpletext.wbmp';
+$file = __DIR__ .'/simpletext.jpg';
+$file2 = __DIR__ .'/simpletext.wbmp';
// Save the image as 'simpletext.jpg'
imagejpeg($im, $file);
@@ -41,6 +41,6 @@ Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
Warning: jpeg2wbmp(): Invalid threshold value '-1' in %s on line %d
--CLEAN--
<?php
-unlink(dirname(__FILE__) .'/simpletext.jpg');
-unlink(dirname(__FILE__) .'/simpletext.wbmp');
+unlink(__DIR__ .'/simpletext.jpg');
+unlink(__DIR__ .'/simpletext.wbmp');
?>
diff --git a/ext/gd/tests/jpeg2wbmp_error2-mb.phpt b/ext/gd/tests/jpeg2wbmp_error2-mb.phpt
index 4eeac126a4..6c4019a935 100644
--- a/ext/gd/tests/jpeg2wbmp_error2-mb.phpt
+++ b/ext/gd/tests/jpeg2wbmp_error2-mb.phpt
@@ -14,7 +14,7 @@ if(!function_exists('jpeg2wbmp')) {
?>
--FILE--
<?php
-$file = dirname(__FILE__) .'/simpletext私はガラスを食べられます.wbmp';
+$file = __DIR__ .'/simpletext私はガラスを食べられます.wbmp';
jpeg2wbmp('', $file, 20, 120, 8);
jpeg2wbmp(null, $file, 20, 120, 8);
jpeg2wbmp(false, $file, 20, 120, 8);
@@ -33,5 +33,5 @@ Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
--CLEAN--
<?php
-unlink(dirname(__FILE__) .'/simpletext私はガラスを食べられます.wbmp');
+unlink(__DIR__ .'/simpletext私はガラスを食べられます.wbmp');
?>
diff --git a/ext/gd/tests/jpeg2wbmp_error2.phpt b/ext/gd/tests/jpeg2wbmp_error2.phpt
index 405eb83129..7ddc151d78 100644
--- a/ext/gd/tests/jpeg2wbmp_error2.phpt
+++ b/ext/gd/tests/jpeg2wbmp_error2.phpt
@@ -14,7 +14,7 @@ if(!function_exists('jpeg2wbmp')) {
?>
--FILE--
<?php
-$file = dirname(__FILE__) .'/simpletext.wbmp';
+$file = __DIR__ .'/simpletext.wbmp';
jpeg2wbmp('', $file, 20, 120, 8);
jpeg2wbmp(null, $file, 20, 120, 8);
jpeg2wbmp(false, $file, 20, 120, 8);
@@ -33,5 +33,5 @@ Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
Warning: jpeg2wbmp(): Unable to open '' for reading in %s on line %d
--CLEAN--
<?php
-unlink(dirname(__FILE__) .'/simpletext.wbmp');
+unlink(__DIR__ .'/simpletext.wbmp');
?>
diff --git a/ext/gd/tests/jpeg2wbmp_error3.phpt b/ext/gd/tests/jpeg2wbmp_error3.phpt
index 2662b7a86b..1d4c82b06e 100644
--- a/ext/gd/tests/jpeg2wbmp_error3.phpt
+++ b/ext/gd/tests/jpeg2wbmp_error3.phpt
@@ -19,7 +19,7 @@ $im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-$file = dirname(__FILE__) .'/simpletext.jpg';
+$file = __DIR__ .'/simpletext.jpg';
// Save the image as 'simpletext.jpg'
imagejpeg($im, $file);
@@ -45,5 +45,5 @@ Deprecated: Function jpeg2wbmp() is deprecated in %s on line %d
Warning: jpeg2wbmp(): Unable to open '' for writing in %s on line %d
--CLEAN--
<?php
-unlink(dirname(__FILE__) .'/simpletext.jpg');
+unlink(__DIR__ .'/simpletext.jpg');
?>
diff --git a/ext/gd/tests/jpg2gd-mb.phpt b/ext/gd/tests/jpg2gd-mb.phpt
index 8dee6b3bd5..85959b4271 100644
--- a/ext/gd/tests/jpg2gd-mb.phpt
+++ b/ext/gd/tests/jpg2gd-mb.phpt
@@ -12,7 +12,7 @@ jpeg <--> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "JPEG to GD1 conversion: ";
echo imagegd(imagecreatefromjpeg($cwd . "/conv_test私はガラスを食べられます.jpeg"), $cwd . "/test私はガラスを食べられます.gd1") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/jpg2gd.phpt b/ext/gd/tests/jpg2gd.phpt
index c68bddd1a8..672a392df0 100644
--- a/ext/gd/tests/jpg2gd.phpt
+++ b/ext/gd/tests/jpg2gd.phpt
@@ -12,7 +12,7 @@ jpeg <--> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "JPEG to GD1 conversion: ";
echo imagegd(imagecreatefromjpeg($cwd . "/conv_test.jpeg"), $cwd . "/test_jpeg.gd1") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/libgd00086.phpt b/ext/gd/tests/libgd00086.phpt
index 7756b34d5a..c7954a0a00 100644
--- a/ext/gd/tests/libgd00086.phpt
+++ b/ext/gd/tests/libgd00086.phpt
@@ -8,7 +8,7 @@ libgd #86 (Possible infinite loop in imagecreatefrompng)
--FILE--
<?php
-$im = imagecreatefrompng(dirname(__FILE__) . '/libgd00086.png');
+$im = imagecreatefrompng(__DIR__ . '/libgd00086.png');
var_dump($im);
?>
--EXPECTF--
diff --git a/ext/gd/tests/libgd00086_extern.phpt b/ext/gd/tests/libgd00086_extern.phpt
index 0c8d18092e..36b79b4835 100644
--- a/ext/gd/tests/libgd00086_extern.phpt
+++ b/ext/gd/tests/libgd00086_extern.phpt
@@ -8,7 +8,7 @@ libgd #86 (Possible infinite loop in imagecreatefrompng)
--FILE--
<?php
-$im = imagecreatefrompng(dirname(__FILE__) . '/libgd00086.png');
+$im = imagecreatefrompng(__DIR__ . '/libgd00086.png');
var_dump($im);
?>
--EXPECTF--
diff --git a/ext/gd/tests/libgd00094-mb.phpt b/ext/gd/tests/libgd00094-mb.phpt
index 8a14ceba1e..76b6bcd566 100644
--- a/ext/gd/tests/libgd00094-mb.phpt
+++ b/ext/gd/tests/libgd00094-mb.phpt
@@ -7,7 +7,7 @@ libgd #94 (imagecreatefromxbm can crash if gdImageCreate fails)
?>
--FILE--
<?php
-$im = imagecreatefromxbm(dirname(__FILE__) . '/libgd00094私はガラスを食べられます.xbm');
+$im = imagecreatefromxbm(__DIR__ . '/libgd00094私はガラスを食べられます.xbm');
var_dump($im);
?>
--EXPECTF--
diff --git a/ext/gd/tests/libgd00094.phpt b/ext/gd/tests/libgd00094.phpt
index f658fc64cf..17c4df70d5 100644
--- a/ext/gd/tests/libgd00094.phpt
+++ b/ext/gd/tests/libgd00094.phpt
@@ -7,7 +7,7 @@ libgd #94 (imagecreatefromxbm can crash if gdImageCreate fails)
?>
--FILE--
<?php
-$im = imagecreatefromxbm(dirname(__FILE__) . '/libgd00094.xbm');
+$im = imagecreatefromxbm(__DIR__ . '/libgd00094.xbm');
var_dump($im);
?>
--EXPECTF--
diff --git a/ext/gd/tests/libgd00101.phpt b/ext/gd/tests/libgd00101.phpt
index 4154012fbd..dbb1886171 100644
--- a/ext/gd/tests/libgd00101.phpt
+++ b/ext/gd/tests/libgd00101.phpt
@@ -7,7 +7,7 @@ libgd #101 (imagecreatefromgd can crash if gdImageCreate fails)
?>
--FILE--
<?php
-$im = imagecreatefromgd(dirname(__FILE__) . '/libgd00101.gd');
+$im = imagecreatefromgd(__DIR__ . '/libgd00101.gd');
var_dump($im);
?>
--EXPECTF--
diff --git a/ext/gd/tests/png2gd.phpt b/ext/gd/tests/png2gd.phpt
index 07148a9ab3..ea70298292 100644
--- a/ext/gd/tests/png2gd.phpt
+++ b/ext/gd/tests/png2gd.phpt
@@ -12,7 +12,7 @@ png <--> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "PNG to GD1 conversion: ";
echo imagegd(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_png.gd1") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/png2wbmp_error1-mb.phpt b/ext/gd/tests/png2wbmp_error1-mb.phpt
index 8c779d36d9..ac0753fb6c 100644
--- a/ext/gd/tests/png2wbmp_error1-mb.phpt
+++ b/ext/gd/tests/png2wbmp_error1-mb.phpt
@@ -19,8 +19,8 @@ $im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-$file = dirname(__FILE__) .'/simpletext私はガラスを食べられます.png';
-$file2 = dirname(__FILE__) .'/simpletext私はガラスを食べられます.wbmp';
+$file = __DIR__ .'/simpletext私はガラスを食べられます.png';
+$file2 = __DIR__ .'/simpletext私はガラスを食べられます.wbmp';
// Save the image as 'simpletext.png'
imagepng($im, $file);
@@ -41,6 +41,6 @@ Deprecated: Function png2wbmp() is deprecated in %s on line %d
Warning: png2wbmp(): Invalid threshold value '-1' in %s on line %d
--CLEAN--
<?php
-unlink(dirname(__FILE__) .'/simpletext私はガラスを食べられます.png');
-unlink(dirname(__FILE__) .'/simpletext私はガラスを食べられます.wbmp');
+unlink(__DIR__ .'/simpletext私はガラスを食べられます.png');
+unlink(__DIR__ .'/simpletext私はガラスを食べられます.wbmp');
?>
diff --git a/ext/gd/tests/png2wbmp_error1.phpt b/ext/gd/tests/png2wbmp_error1.phpt
index 543013b4bc..5805dfa7a0 100644
--- a/ext/gd/tests/png2wbmp_error1.phpt
+++ b/ext/gd/tests/png2wbmp_error1.phpt
@@ -19,8 +19,8 @@ $im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-$file = dirname(__FILE__) .'/simpletext.png';
-$file2 = dirname(__FILE__) .'/simpletext.wbmp';
+$file = __DIR__ .'/simpletext.png';
+$file2 = __DIR__ .'/simpletext.wbmp';
// Save the image as 'simpletext.png'
imagepng($im, $file);
@@ -41,6 +41,6 @@ Deprecated: Function png2wbmp() is deprecated in %s on line %d
Warning: png2wbmp(): Invalid threshold value '-1' in %s on line %d
--CLEAN--
<?php
-unlink(dirname(__FILE__) .'/simpletext.png');
-unlink(dirname(__FILE__) .'/simpletext.wbmp');
+unlink(__DIR__ .'/simpletext.png');
+unlink(__DIR__ .'/simpletext.wbmp');
?>
diff --git a/ext/gd/tests/png2wbmp_error2.phpt b/ext/gd/tests/png2wbmp_error2.phpt
index a674e0d6cc..3bfff05891 100644
--- a/ext/gd/tests/png2wbmp_error2.phpt
+++ b/ext/gd/tests/png2wbmp_error2.phpt
@@ -14,7 +14,7 @@ if(!function_exists('png2wbmp')) {
?>
--FILE--
<?php
-$file = dirname(__FILE__) .'/simpletext.wbmp';
+$file = __DIR__ .'/simpletext.wbmp';
png2wbmp('', $file, 20, 120, 8);
png2wbmp(null, $file, 20, 120, 8);
png2wbmp(false, $file, 20, 120, 8);
@@ -33,5 +33,5 @@ Deprecated: Function png2wbmp() is deprecated in %s on line %d
Warning: png2wbmp(): Unable to open '' for reading in %s on line %d
--CLEAN--
<?php
-unlink(dirname(__FILE__) .'/simpletext.wbmp');
+unlink(__DIR__ .'/simpletext.wbmp');
?>
diff --git a/ext/gd/tests/png2wbmp_error3.phpt b/ext/gd/tests/png2wbmp_error3.phpt
index 3cab3ccb98..8bf0aa25bb 100644
--- a/ext/gd/tests/png2wbmp_error3.phpt
+++ b/ext/gd/tests/png2wbmp_error3.phpt
@@ -19,7 +19,7 @@ $im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
-$file = dirname(__FILE__) .'/simpletext.png';
+$file = __DIR__ .'/simpletext.png';
// Save the image as 'simpletext.png'
imagepng($im, $file);
@@ -45,5 +45,5 @@ Deprecated: Function png2wbmp() is deprecated in %s on line %d
Warning: png2wbmp(): Unable to open '' for writing in %s on line %d
--CLEAN--
<?php
-unlink(dirname(__FILE__) .'/simpletext.png');
+unlink(__DIR__ .'/simpletext.png');
?>
diff --git a/ext/gd/tests/pngcomp.phpt b/ext/gd/tests/pngcomp.phpt
index 3fd7b57055..aa663a6dd2 100644
--- a/ext/gd/tests/pngcomp.phpt
+++ b/ext/gd/tests/pngcomp.phpt
@@ -12,7 +12,7 @@ png compression test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "PNG compression test: ";
diff --git a/ext/gd/tests/xbm2png.phpt b/ext/gd/tests/xbm2png.phpt
index 7eaabc410b..8dcd07bc4a 100644
--- a/ext/gd/tests/xbm2png.phpt
+++ b/ext/gd/tests/xbm2png.phpt
@@ -14,7 +14,7 @@ xbm --> png conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "XBM to PNG conversion: ";
echo imagepng(imagecreatefromxbm($cwd . "/conv_test.xbm"), $cwd . "/test_xbm.png") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/xpm2gd.phpt b/ext/gd/tests/xpm2gd.phpt
index 42df3f6213..f48dcb2b3b 100644
--- a/ext/gd/tests/xpm2gd.phpt
+++ b/ext/gd/tests/xpm2gd.phpt
@@ -12,7 +12,7 @@ xpm --> gd1/gd2 conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "XPM to GD1 conversion: ";
echo imagegd(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.gd1") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/xpm2jpg.phpt b/ext/gd/tests/xpm2jpg.phpt
index d412b074a7..92cab3e5fa 100644
--- a/ext/gd/tests/xpm2jpg.phpt
+++ b/ext/gd/tests/xpm2jpg.phpt
@@ -15,7 +15,7 @@ xpm --> jpeg conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "XPM to JPEG conversion: ";
echo imagejpeg(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.jpeg") ? 'ok' : 'failed';
diff --git a/ext/gd/tests/xpm2png.phpt b/ext/gd/tests/xpm2png.phpt
index a5eadffd81..e473cfb31c 100644
--- a/ext/gd/tests/xpm2png.phpt
+++ b/ext/gd/tests/xpm2png.phpt
@@ -15,7 +15,7 @@ xpm --> png conversion test
?>
--FILE--
<?php
- $cwd = dirname(__FILE__);
+ $cwd = __DIR__;
echo "XPM to PNG conversion: ";
echo imagepng(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.png") ? 'ok' : 'failed';