X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Ftest%2FPsy%2FTest%2FCodeCleaner%2FCalledClassPassTest.php;fp=vendor%2Fpsy%2Fpsysh%2Ftest%2FPsy%2FTest%2FCodeCleaner%2FCalledClassPassTest.php;h=0000000000000000000000000000000000000000;hp=a581d7f33e8d19cbeb06f5dbaa16125c1af7d851;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/CalledClassPassTest.php b/vendor/psy/psysh/test/Psy/Test/CodeCleaner/CalledClassPassTest.php deleted file mode 100644 index a581d7f33..000000000 --- a/vendor/psy/psysh/test/Psy/Test/CodeCleaner/CalledClassPassTest.php +++ /dev/null @@ -1,104 +0,0 @@ -pass = new CalledClassPass(); - $this->traverser = new NodeTraverser(); - $this->traverser->addVisitor($this->pass); - } - - /** - * @dataProvider invalidStatements - * @expectedException \Psy\Exception\ErrorException - */ - public function testProcessStatementFails($code) - { - $stmts = $this->parse($code); - $this->traverser->traverse($stmts); - } - - public function invalidStatements() - { - return array( - array('get_class()'), - array('get_class(null)'), - array('get_called_class()'), - array('get_called_class(null)'), - array('function foo() { return get_class(); }'), - array('function foo() { return get_class(null); }'), - array('function foo() { return get_called_class(); }'), - array('function foo() { return get_called_class(null); }'), - ); - } - - /** - * @dataProvider validStatements - */ - public function testProcessStatementPasses($code) - { - $stmts = $this->parse($code); - $this->traverser->traverse($stmts); - - // @todo a better thing to assert here? - $this->assertTrue(true); - } - - public function validStatements() - { - return array( - array('get_class($foo)'), - array('get_class(bar())'), - array('get_called_class($foo)'), - array('get_called_class(bar())'), - array('function foo($bar) { return get_class($bar); }'), - array('function foo($bar) { return get_called_class($bar); }'), - array('class Foo { function bar() { return get_class(); } }'), - array('class Foo { function bar() { return get_class(null); } }'), - array('class Foo { function bar() { return get_called_class(); } }'), - array('class Foo { function bar() { return get_called_class(null); } }'), - array('$foo = function () {}; $foo()'), - ); - } - - /** - * @dataProvider validTraitStatements - */ - public function testProcessTraitStatementPasses($code) - { - if (version_compare(PHP_VERSION, '5.4', '<')) { - $this->markTestSkipped(); - } - - $stmts = $this->parse($code); - $this->traverser->traverse($stmts); - - // @todo a better thing to assert here? - $this->assertTrue(true); - } - - public function validTraitStatements() - { - return array( - array('trait Foo { function bar() { return get_class(); } }'), - array('trait Foo { function bar() { return get_class(null); } }'), - array('trait Foo { function bar() { return get_called_class(); } }'), - array('trait Foo { function bar() { return get_called_class(null); } }'), - ); - } -}