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 PhpParser\NodeTraverser;
15 use Psy\CodeCleaner\CodeCleanerPass;
16 use Psy\Test\ParserTestCase;
18 class CodeCleanerTestCase extends ParserTestCase
22 protected function setPass(CodeCleanerPass $pass)
25 if (!isset($this->traverser)) {
26 $this->traverser = new NodeTraverser();
28 $this->traverser->addVisitor($this->pass);
31 protected function parseAndTraverse($code, $prefix = '<?php ')
33 return $this->traverse($this->parse($code, $prefix));