Skip to content

Commit dab24ad

Browse files
Improved support for Codeception 5/PHP 8 (#17)
Co-authored-by: TavoNiievez <[email protected]>
1 parent b4dd6f3 commit dab24ad

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
/tests export-ignore
33
/.gitattributes export-ignore
44
/.gitignore export-ignore
5-
/Robofile.php export-ignore
65
/*.md export-ignore
76
/*.yml export-ignore

composer.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "codeception/module-filesystem",
33
"description": "Codeception module for testing local filesystem",
4-
"keywords": [ "codeception", "filesystem" ],
5-
"homepage": "https://codeception.com/",
6-
"type": "library",
74
"license": "MIT",
5+
"type": "library",
6+
"keywords": [
7+
"codeception",
8+
"filesystem"
9+
],
810
"authors": [
911
{
1012
"name": "Michael Bodnarchuk"
@@ -13,21 +15,23 @@
1315
"name": "Gintautas Miselis"
1416
}
1517
],
16-
"minimum-stability": "dev",
18+
"homepage": "https://codeception.com/",
1719
"require": {
1820
"php": "^8.0",
19-
"codeception/codeception": "^5.0.0-alpha1",
20-
"symfony/finder": "^4.4 | ^5.4 | ^6.0"
21+
"codeception/codeception": "dev-5.0-interfaces as 5.0.0",
22+
"symfony/finder": "^4.4 || ^5.4 || ^6.0"
2123
},
2224
"conflict": {
2325
"codeception/codeception": "<5.0"
2426
},
27+
"minimum-stability": "dev",
2528
"autoload": {
2629
"classmap": [
2730
"src/"
2831
]
2932
},
3033
"config": {
31-
"classmap-authoritative": true
34+
"classmap-authoritative": true,
35+
"sort-packages": true
3236
}
3337
}

src/Codeception/Module/Filesystem.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Filesystem extends Module
3232

3333
protected string $path = '';
3434

35-
public function _before(TestInterface $test)
35+
public function _before(TestInterface $test): void
3636
{
3737
$this->path = Configuration::projectDir();
3838
}
@@ -50,7 +50,7 @@ public function amInPath(string $path): void
5050
protected function absolutizePath(string $path): string
5151
{
5252
// *nix way
53-
if (strpos($path, '/') === 0) {
53+
if (str_starts_with($path, '/')) {
5454
return $path;
5555
}
5656

@@ -264,7 +264,7 @@ public function dontSeeFileFound(string $filename, string $path = ''): void
264264
* @throws AssertionFailedError When path does not exist
265265
* @return string|false Path to the first matching file
266266
*/
267-
private function findFileInPath(string $filename, string $path)
267+
private function findFileInPath(string $filename, string $path): string|false
268268
{
269269
$path = $this->absolutizePath($path);
270270
if (!file_exists($path)) {

0 commit comments

Comments
 (0)