4 * This file is part of Psy Shell.
6 * (c) 2012-2018 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\AssignThisVariablePass;
16 class AssignThisVariablePassTest extends CodeCleanerTestCase
18 public function setUp()
20 $this->setPass(new AssignThisVariablePass());
24 * @dataProvider invalidStatements
25 * @expectedException \Psy\Exception\FatalErrorException
27 public function testProcessStatementFails($code)
29 $this->parseAndTraverse($code);
32 public function invalidStatements()
36 ['strtolower($this = "this")'],
41 * @dataProvider validStatements
43 public function testProcessStatementPasses($code)
45 $this->parseAndTraverse($code);
46 $this->assertTrue(true);
49 public function validStatements()
54 ['$a = "this"; $$a = 3'],