2016-12-11 23:41:11 -05:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Tests;
|
|
|
|
|
2017-04-24 23:45:02 -04:00
|
|
|
class ForeachTest extends TestCase
|
2016-12-11 23:41:11 -05:00
|
|
|
{
|
2017-04-24 23:45:02 -04:00
|
|
|
use Traits\FileCheckerInvalidCodeParseTestTrait;
|
2017-01-02 15:31:18 -05:00
|
|
|
|
2017-01-13 14:07:23 -05:00
|
|
|
/**
|
2017-04-24 23:45:02 -04:00
|
|
|
* @return array
|
2017-01-13 14:07:23 -05:00
|
|
|
*/
|
2017-04-24 23:45:02 -04:00
|
|
|
public function providerFileCheckerInvalidCodeParse()
|
2016-12-11 23:41:11 -05:00
|
|
|
{
|
2017-04-24 23:45:02 -04:00
|
|
|
return [
|
|
|
|
'continueOutsideLoop' => [
|
|
|
|
'<?php
|
|
|
|
continue;',
|
2017-05-26 20:05:57 -04:00
|
|
|
'error_message' => 'ContinueOutsideLoop',
|
2017-04-24 23:45:02 -04:00
|
|
|
],
|
|
|
|
'invalidIterator' => [
|
|
|
|
'<?php
|
|
|
|
foreach (5 as $a) {
|
|
|
|
|
|
|
|
}',
|
2017-05-26 20:05:57 -04:00
|
|
|
'error_message' => 'InvalidIterator',
|
|
|
|
],
|
2017-04-24 23:45:02 -04:00
|
|
|
];
|
2016-12-11 23:41:11 -05:00
|
|
|
}
|
|
|
|
}
|