mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
11bc153deb
* Rewriting and streamlining every unit test with data providers. All unit tests have been rewritten into PHPUnit data providers to reduce the amount of unnecessary code-reuse through out the test suite.
29 lines
626 B
PHP
29 lines
626 B
PHP
<?php
|
|
namespace Psalm\Tests;
|
|
|
|
class ForeachTest extends TestCase
|
|
{
|
|
use Traits\FileCheckerInvalidCodeParseTestTrait;
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function providerFileCheckerInvalidCodeParse()
|
|
{
|
|
return [
|
|
'continueOutsideLoop' => [
|
|
'<?php
|
|
continue;',
|
|
'error_message' => 'ContinueOutsideLoop'
|
|
],
|
|
'invalidIterator' => [
|
|
'<?php
|
|
foreach (5 as $a) {
|
|
|
|
}',
|
|
'error_message' => 'InvalidIterator'
|
|
]
|
|
];
|
|
}
|
|
}
|