2016-12-12 05:41:11 +01:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Tests;
|
|
|
|
|
2017-04-25 05:45:02 +02:00
|
|
|
class ForbiddenCodeTest extends TestCase
|
2016-12-12 05:41:11 +01:00
|
|
|
{
|
2017-04-25 05:45:02 +02:00
|
|
|
use Traits\FileCheckerInvalidCodeParseTestTrait;
|
2016-12-12 05:41:11 +01:00
|
|
|
|
|
|
|
/**
|
2017-04-25 05:45:02 +02:00
|
|
|
* @return array
|
2016-12-12 05:41:11 +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 [
|
|
|
|
'varDump' => [
|
|
|
|
'<?php
|
|
|
|
var_dump("hello");',
|
2017-05-27 02:05:57 +02:00
|
|
|
'error_message' => 'ForbiddenCode',
|
2017-04-25 05:45:02 +02:00
|
|
|
],
|
|
|
|
'execTicks' => [
|
|
|
|
'<?php
|
|
|
|
`rm -rf`;',
|
2017-05-27 02:05:57 +02:00
|
|
|
'error_message' => 'ForbiddenCode',
|
2017-04-25 05:45:02 +02:00
|
|
|
],
|
|
|
|
'exec' => [
|
|
|
|
'<?php
|
|
|
|
shell_exec("rm -rf");',
|
2017-05-27 02:05:57 +02:00
|
|
|
'error_message' => 'ForbiddenCode',
|
|
|
|
],
|
2017-04-25 05:45:02 +02:00
|
|
|
];
|
2016-12-12 05:41:11 +01:00
|
|
|
}
|
|
|
|
}
|