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