smrealms /
smr
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php declare(strict_types=1); |
||||
| 2 | |||||
| 3 | namespace SmrTest; |
||||
| 4 | |||||
| 5 | use PHPUnit\Framework\TestCase; |
||||
| 6 | use Overtrue\PHPLint\Linter; |
||||
| 7 | |||||
| 8 | /** |
||||
| 9 | * @coversNothing |
||||
| 10 | */ |
||||
| 11 | class PhpFileInspectionTest extends TestCase { |
||||
| 12 | |||||
| 13 | public function test_all_files_use_strict_type() { |
||||
| 14 | $exit_code = 1; |
||||
| 15 | $output = []; |
||||
| 16 | exec(ROOT . 'test/strict_types.sh', $output, $exit_code); |
||||
| 17 | $this->assertSame(0, $exit_code, join("\n", $output)); |
||||
| 18 | $this->assertEquals('Success! No strict_type errors.', end($output)); |
||||
| 19 | } |
||||
| 20 | |||||
| 21 | public function test_all_files_pass_phplint() { |
||||
| 22 | $paths = [ROOT]; |
||||
| 23 | $excludes = ['vendor']; |
||||
| 24 | $linter = new Linter($paths, $excludes, warning: true); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 25 | $linter->setProcessLimit(8); // multiprocessing |
||||
| 26 | |||||
| 27 | // get errors |
||||
| 28 | $errors = $linter->lint(); |
||||
| 29 | $this->assertEmpty($errors, print_r($errors, true)); |
||||
|
0 ignored issues
–
show
It seems like
print_r($errors, true) can also be of type true; however, parameter $message of PHPUnit\Framework\Assert::assertEmpty() does only seem to accept string, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 30 | } |
||||
| 31 | |||||
| 32 | } |
||||
| 33 |