File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
test/unit/SourceLocator/Type/AutoloadSourceLocator Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change 6
6
7
7
use Exception ;
8
8
use LogicException ;
9
- use PHPUnit \Framework \Error \Warning ;
10
9
use PHPUnit \Framework \TestCase ;
11
10
use Roave \BetterReflection \SourceLocator \Type \AutoloadSourceLocator \FileReadTrapStreamWrapper ;
12
11
use Throwable ;
13
12
use UnexpectedValueException ;
14
13
15
- use function class_exists ;
16
14
use function file_get_contents ;
17
15
use function is_file ;
18
16
use function sprintf ;
@@ -179,15 +177,8 @@ static function () use ($thrown): string {
179
177
180
178
public function testWillRaiseWarningWhenTryingToCheckFileExistenceForNonExistingFileWithoutSilencingModifier (): void
181
179
{
182
- self ::assertTrue (
183
- class_exists (Warning::class),
184
- 'The warning class should not be autoloaded lazily for this specific test ' ,
185
- );
186
-
187
180
$ nonExistingFile = __DIR__ . uniqid ('non-existing-file ' , true );
188
181
189
- $ this ->expectWarning ();
190
-
191
182
self ::assertSame (
192
183
'another value produced by the function ' ,
193
184
FileReadTrapStreamWrapper::withStreamWrapperOverride (
@@ -196,7 +187,7 @@ static function () use ($nonExistingFile): string {
196
187
throw new UnexpectedValueException ('is_file() should report `false` for a non-existing file ' );
197
188
}
198
189
199
- if (file_get_contents ($ nonExistingFile ) !== false ) {
190
+ if (@ file_get_contents ($ nonExistingFile ) !== false ) {
200
191
throw new UnexpectedValueException ('file_get_contents() should report `false` for a non-existing file ' );
201
192
}
202
193
You can’t perform that action at this time.
0 commit comments