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\LegacyEmptyPass;
16 class LegacyEmptyPassTest extends CodeCleanerTestCase
18 public function setUp()
20 $this->setPass(new LegacyEmptyPass());
24 * @dataProvider invalidStatements
25 * @expectedException \Psy\Exception\ParseErrorException
27 public function testProcessInvalidStatement($code)
29 $stmts = $this->parse($code);
30 $this->traverser->traverse($stmts);
33 public function invalidStatements()
35 if (version_compare(PHP_VERSION, '5.5', '>=')) {
44 array('empty(PHP_EOL)'),
45 array('empty("wat")'),
47 array('empty(Foo::$bar)'),
52 * @dataProvider validStatements
54 public function testProcessValidStatement($code)
56 $stmts = $this->parse($code);
57 $this->traverser->traverse($stmts);
60 public function validStatements()
62 if (version_compare(PHP_VERSION, '5.5', '<')) {
71 array('empty(PHP_EOL)'),
72 array('empty("wat")'),
74 array('empty(Foo::$bar)'),