From 24f56d7227558e1f2778e2ba6e9a3a18ff21fea5 Mon Sep 17 00:00:00 2001 From: Ian Young Date: Sun, 25 Apr 2010 13:29:14 -0500 Subject: [PATCH] Additional test for conflicts between PHPDoc types and return statement --- tests/RenameMethodTest.php | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/RenameMethodTest.php b/tests/RenameMethodTest.php index 155bb79..64f6748 100644 --- a/tests/RenameMethodTest.php +++ b/tests/RenameMethodTest.php @@ -507,6 +507,55 @@ function getF() { } \$q = new Quark(); \$q->b()->baz(); +EOL; + $this->renameAndCompare($orig, $expected); + } + + /** + * This is a question of taste, since there's no "right" way to handle + * this kind of conflict. I choose to give PHPDoc types more weight than + * the guesses made by the static typer. + */ + public function testPHPDocReturnOverridesReturnStatement() { + $orig = <<a()->bar(); +\$q->b()->bar(); +EOL; + $expected = <<a()->bar(); +\$q->b()->baz(); EOL; $this->renameAndCompare($orig, $expected); }