1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
psalm/tests/ForbiddenCodeTest.php

32 lines
731 B
PHP
Raw Normal View History

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