Use __DIR__-relative path in tests

Otherwise we can't run them from another directory, they'll fail
instead.
This commit is contained in:
Niels Dossche 2023-11-15 20:27:02 +01:00
parent 4f1103ef3b
commit f320c3561e
2 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@ Bug #78793: Use-after-free in exif parsing under memory sanitizer
exif exif
--FILE-- --FILE--
<?php <?php
$f = "ext/exif/tests/bug77950.tiff"; $f = __DIR__ . "/bug77950.tiff";
for ($i = 0; $i < 10; $i++) { for ($i = 0; $i < 10; $i++) {
@exif_read_data($f); @exif_read_data($f);
} }

View file

@ -7,11 +7,11 @@ soap
$options = array("cache_wsdl" => WSDL_CACHE_NONE); $options = array("cache_wsdl" => WSDL_CACHE_NONE);
// Need a warm-up for globals // Need a warm-up for globals
for ($i = 0; $i < 10; $i++) { for ($i = 0; $i < 10; $i++) {
$client = new SoapClient("ext/soap/tests/test.wsdl", $options); $client = new SoapClient(__DIR__ . "/test.wsdl", $options);
} }
$usage = memory_get_usage(); $usage = memory_get_usage();
for ($i = 0; $i < 10; $i++) { for ($i = 0; $i < 10; $i++) {
$client = new SoapClient("ext/soap/tests/test.wsdl", $options); $client = new SoapClient(__DIR__ . "/test.wsdl", $options);
} }
$usage_delta = memory_get_usage() - $usage; $usage_delta = memory_get_usage() - $usage;
var_dump($usage_delta); var_dump($usage_delta);