4 * This file is part of Psy Shell.
6 * (c) 2012-2017 Justin Hileman
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Psy\Test\CodeCleaner;
14 use Psy\CodeCleaner\LeavePsyshAlonePass;
16 class LeavePsyshAlonePassTest extends CodeCleanerTestCase
18 public function setUp()
20 $this->setPass(new LeavePsyshAlonePass());
23 public function testPassesInlineHtmlThroughJustFine()
25 $inline = $this->parse('not php at all!', '');
26 $this->traverse($inline);
30 * @dataProvider validStatements
32 public function testProcessStatementPasses($code)
34 $stmts = $this->parse($code);
35 $this->traverse($stmts);
38 public function validStatements()
41 array('array_merge()'),
51 * @dataProvider invalidStatements
52 * @expectedException \Psy\Exception\RuntimeException
54 public function testProcessStatementFails($code)
56 $stmts = $this->parse($code);
57 $this->traverse($stmts);
60 public function invalidStatements()
64 array('var_dump($__psysh__)'),
65 array('$__psysh__ = "your mom"'),
66 array('$__psysh__->fakeFunctionCall()'),