X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Ftest%2FPsy%2FTest%2FCodeCleaner%2FImplicitReturnPassTest.php;fp=vendor%2Fpsy%2Fpsysh%2Ftest%2FPsy%2FTest%2FCodeCleaner%2FImplicitReturnPassTest.php;h=0000000000000000000000000000000000000000;hp=b9912c390b6da5d0bca088988b4eb6405b86c6f9;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ImplicitReturnPassTest.php b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ImplicitReturnPassTest.php deleted file mode 100644 index b9912c390..000000000 --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/ImplicitReturnPassTest.php +++ /dev/null @@ -1,96 +0,0 @@ -setPass(new ImplicitReturnPass()); - } - - /** - * @dataProvider implicitReturns - */ - public function testProcess($from, $to) - { - $this->assertProcessesAs($from, $to); - } - - public function implicitReturns() - { - $values = array( - array('4', 'return 4;'), - array('foo()', 'return foo();'), - array('return 1', 'return 1;'), - ); - - $from = 'if (true) { 1; } elseif (true) { 2; } else { 3; }'; - $to = <<<'EOS' -if (true) { - return 1; -} elseif (true) { - return 2; -} else { - return 3; -} -return new \Psy\CodeCleaner\NoReturnValue(); -EOS; - $values[] = array($from, $to); - - $from = 'class A {}'; - $to = <<<'EOS' -class A -{ -} -return new \Psy\CodeCleaner\NoReturnValue(); -EOS; - $values[] = array($from, $to); - - $from = <<<'EOS' -switch (false) { - case 0: - 0; - case 1: - 1; - break; - case 2: - 2; - return; -} -EOS; - $to = <<<'EOS' -switch (false) { - case 0: - 0; - case 1: - return 1; - break; - case 2: - 2; - return; -} -return new \Psy\CodeCleaner\NoReturnValue(); -EOS; - $values[] = array($from, $to); - - if (version_compare(PHP_VERSION, '5.4', '<')) { - $values[] = array('exit()', 'die;'); - } else { - $values[] = array('exit()', 'exit;'); - } - - return $values; - } -}