Skip to content

Commit 6ef35a2

Browse files
committed
tests: Avoid null passed to unlink
When tests are skipped, there is a deprecation notice Deprecated: unlink(): Passing null to parameter #1 ($filename) of type string is deprecated in tests\CdbTest.php on line 34 Change-Id: I2c34859371d4e6f1d17fcd54b1f378af39bae0c0
1 parent 5fd200c commit 6ef35a2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/CdbTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ protected function setUp(): void {
3131
}
3232

3333
protected function tearDown(): void {
34-
unlink( $this->phpCdbFile );
35-
unlink( $this->dbaCdbFile );
34+
if ( $this->phpCdbFile !== null ) {
35+
unlink( $this->phpCdbFile );
36+
}
37+
if ( $this->dbaCdbFile !== null ) {
38+
unlink( $this->dbaCdbFile );
39+
}
3640
parent::tearDown();
3741
}
3842

0 commit comments

Comments
 (0)