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);
28 // @todo a better thing to assert here?
29 $this->assertTrue(true);
33 * @dataProvider validStatements
35 public function testProcessStatementPasses($code)
37 $stmts = $this->parse($code);
38 $this->traverse($stmts);
40 // @todo a better thing to assert here?
41 $this->assertTrue(true);
44 public function validStatements()
47 array('array_merge()'),
57 * @dataProvider invalidStatements
58 * @expectedException \Psy\Exception\RuntimeException
60 public function testProcessStatementFails($code)
62 $stmts = $this->parse($code);
63 $this->traverse($stmts);
66 public function invalidStatements()
70 array('var_dump($__psysh__)'),
71 array('$__psysh__ = "your mom"'),
72 array('$__psysh__->fakeFunctionCall()'),