Skip to content

Commit 61e8342

Browse files
committed
Make tests more consistent
1 parent 18f3144 commit 61e8342

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

ext/phar/tests/buildFromIterator_user_overrides/getMTime_errors.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@ Entry content/hello.txt cannot be created: getMTime() must return an int
112112
Entry content/hello.txt cannot be created: getMTime() must return an int
113113
Previous: Throwing an exception inside getMTime()
114114
--- Iteration 3 ---
115-
[ Found: /run/media/niels/MoreData/php-src-multitasking/ext/phar/tests/buildFromIterator_user_overrides/002/content/hello.txt ]
115+
[ Found: %scontent/hello.txt ]
116116
[MTime]
117117
Entry content/hello.txt cannot be created: getMTime() must return an int

ext/phar/tests/buildFromIterator_user_overrides/getPathname.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ N. Dossche
1313

1414
class MyGlobIterator extends GlobIterator {
1515
public function getPathname(): string {
16+
echo "[getPathname]\n";
1617
var_dump(parent::getPathname());
1718
// For testing: always return hello2 such that it will be the only file
1819
return str_replace("hello1.txt", "hello2.txt", parent::getPathname());
@@ -57,8 +58,10 @@ $workdir = __DIR__.'/004';
5758
?>
5859
--EXPECTF--
5960
[ Found: %shello%d.txt ]
61+
[getPathname]
6062
string(%d) "%shello1.txt"
6163
[ Found: %shello%d.txt ]
64+
[getPathname]
6265
string(%d) "%shello1.txt"
6366
bool(false)
6467
bool(true)

ext/phar/tests/buildFromIterator_user_overrides/getPathname_byRef.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ N. Dossche
1313

1414
class MyGlobIterator extends GlobIterator {
1515
public function &getPathname(): string {
16+
echo "[getPathname]\n";
1617
static $data = parent::getPathname();
1718
return $data;
1819
}
1920
}
2021

2122
class MyIterator extends RecursiveDirectoryIterator {
2223
public function current(): SplFileInfo {
24+
echo "[ Found: " . parent::current()->getPathname() . " ]\n";
2325
return new MyGlobIterator(parent::current()->getPath() . '/*');
2426
}
2527
}
@@ -51,4 +53,6 @@ $workdir = __DIR__.'/005';
5153
@rmdir($workdir);
5254
?>
5355
--EXPECTF--
56+
[ Found: %scontent/hello.txt ]
57+
[getPathname]
5458
bool(true)

ext/phar/tests/buildFromIterator_user_overrides/getPathname_exception.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ N. Dossche
1313

1414
class MyGlobIterator extends GlobIterator {
1515
public function getPathname(): string {
16+
echo "[getPathname]\n";
1617
var_dump(parent::getPathname());
1718
throw new Error('exception in getPathname()');
1819
}
@@ -53,5 +54,6 @@ $workdir = __DIR__.'/003';
5354
?>
5455
--EXPECTF--
5556
[ Found: %shello.txt ]
57+
[getPathname]
5658
string(%d) "%shello.txt"
5759
exception in getPathname()

ext/phar/tests/buildFromIterator_user_overrides/getPathname_wrong_type.phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ N. Dossche
1414
class MyGlobIterator extends GlobIterator {
1515
#[\ReturnTypeWillChange]
1616
public function getPathname(): int {
17+
echo "[getPathname]\n";
1718
return 1;
1819
}
1920
}
2021

2122
class MyIterator extends RecursiveDirectoryIterator {
2223
public function current(): SplFileInfo {
24+
echo "[ Found: " . parent::current()->getPathname() . " ]\n";
2325
return new MyGlobIterator(parent::current()->getPath() . '/*');
2426
}
2527
}
@@ -50,5 +52,7 @@ $workdir = __DIR__.'/006';
5052
@rmdir($workdir . '/content');
5153
@rmdir($workdir);
5254
?>
53-
--EXPECT--
55+
--EXPECTF--
56+
[ Found: %scontent/hello.txt ]
57+
[getPathname]
5458
getPathname() must return a string

0 commit comments

Comments
 (0)