cvs: pear /PhpDocumentor package.xml /PhpDocumentor/Documentation/tests bug1574047.php /PhpDocumentor/phpDocumentor ParserElements.inc

From: Date: Tue, 24 Apr 2007 21:30:50 +0000
Subject: cvs: pear /PhpDocumentor package.xml /PhpDocumentor/Documentation/tests bug1574047.php /PhpDocumentor/phpDocumentor ParserElements.inc
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-46138@lists.php.net to get a copy of this message
ashnazg Tue Apr 24 21:30:50 2007 UTC Added files: /pear/PhpDocumentor/Documentation/tests bug1574047.php Modified files: /pear/PhpDocumentor package.xml /pear/PhpDocumentor/phpDocumentor ParserElements.inc Log: Sourceforge [1574047] Refactored RETURNs #2

http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/package.xml?r1=1.103&r2=1.104&diff_format=u Index: pear/PhpDocumentor/package.xml diff -u pear/PhpDocumentor/package.xml:1.103 pear/PhpDocumentor/package.xml:1.104 --- pear/PhpDocumentor/package.xml:1.103 Tue Apr 24 21:27:43 2007 +++ pear/PhpDocumentor/package.xml Tue Apr 24 21:30:50 2007 @@ -91,6 +91,7 @@ - [1602988] Added --ignore-symlinks option - [1588942] Allow memory_limit setting in phpdoc.ini - [1588936] Show INI Path at Startup +- [1574047] Refactored RETURNs #2 - [1574043] Refactored RETURNs #1 - [1543289] Apply ignore patterns to subdir of dir, instead of full path - [1543287] Use predefined PHP env var in phpdoc script @@ -2953,6 +2954,7 @@ - [1602988] Added --ignore-symlinks option - [1588942] Allow memory_limit setting in phpdoc.ini - [1588936] Show INI Path at Startup +- [1574047] Refactored RETURNs #2 - [1574043] Refactored RETURNs #1 - [1543289] Apply ignore patterns to subdir of dir, instead of full path - [1543287] Use predefined PHP env var in phpdoc script http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/ParserElements.inc?r1=1.18&r2=1.19&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/ParserElements.inc diff -u pear/PhpDocumentor/phpDocumentor/ParserElements.inc:1.18 pear/PhpDocumentor/phpDocumentor/ParserElements.inc:1.19 --- pear/PhpDocumentor/phpDocumentor/ParserElements.inc:1.18 Thu Apr 19 20:20:57 2007 +++ pear/PhpDocumentor/phpDocumentor/ParserElements.inc Tue Apr 24 21:30:50 2007 @@ -30,7 +30,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2002-2006 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version CVS: $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @see Parser, WordParser @@ -44,7 +44,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@php.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ */ class parserElement extends parserBase { @@ -197,7 +197,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@php.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ */ class parserInclude extends parserElement { @@ -213,7 +213,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@php.net> * @since 1.1 - * @version $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ */ class parserGlobal extends parserElement { @@ -317,7 +317,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@php.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ */ class parserFunction extends parserElement { @@ -678,7 +678,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@php.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ */ class parserClass extends parserElement { @@ -1338,21 +1338,22 @@ function getSourceLocation($c,$pearize = false) { global $_phpDocumentor_options; - if (!isset($this->sourceLocation)) return false; - if ($pearize) + if (!isset($this->sourceLocation)) + { + $sl = false; + } + else { $sl = $this->sourceLocation; - if (strpos($sl,'pear/')) - { - $sl = substr($sl,strpos($sl,'pear/') + 5); - return $sl; - } else + if ($pearize) { - return $sl; + if (strpos($sl,'pear/')) + { + $sl = substr($sl,strpos($sl,'pear/') + 5); + } } - return $sl; - } - return $this->sourceLocation; + } + return $sl; } /** @@ -1410,7 +1411,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@php.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ */ class parserVar extends parserElement { @@ -1623,7 +1624,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@php.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ */ class parserMethod extends parserFunction { @@ -1978,7 +1979,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@php.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ */ class parserDefine extends parserElement { @@ -2022,7 +2023,7 @@ * @subpackage ParserElements * @author Greg Beaver <cellog@php.net> * @since 1.0rc1 - * @version $Id: ParserElements.inc,v 1.18 2007/04/19 20:20:57 ashnazg Exp $ + * @version $Id: ParserElements.inc,v 1.19 2007/04/24 21:30:50 ashnazg Exp $ */ class parserPackagePage extends parserStringWithInlineTags { http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/Documentation/tests/bug1574047.php?view=markup&rev=1.1 Index: pear/PhpDocumentor/Documentation/tests/bug1574047.php +++ pear/PhpDocumentor/Documentation/tests/bug1574047.php <?php // Call ParserPageTest::main() if this source file is executed directly. if (!defined("PHPUnit_MAIN_METHOD")) { define("PHPUnit_MAIN_METHOD", "ParserPageTest::main"); } require_once "PHPUnit/Framework/TestCase.php"; require_once "PHPUnit/Framework/TestSuite.php"; require_once 'phpDocumentor/ParserData.inc'; require_once 'phpDocumentor/ParserElements.inc'; require_once 'phpDocumentor/Converter.inc'; require_once 'phpDocumentor/Setup.inc.php'; /** * ParserClass->getSourceLocation refactoring of RETURN statements */ class Documentation_tests_bug1574047 extends PHPUnit_Framework_TestCase { private $ps; private $pc; /** * Runs the test methods of this class. * * @access public * @static */ public static function main() { require_once "PHPUnit/TextUI/TestRunner.php"; $suite = new PHPUnit_Framework_TestSuite("Documentation_tests_bug1574047"); $result = PHPUnit_TextUI_TestRunner::run($suite); } /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { $GLOBALS['_phpDocumentor_install_dir'] = "."; $GLOBALS['_phpDocumentor_setting']['quiet'] = "true"; $this->ps = new phpDocumentor_setup; $this->ps->setTitle("Unit Testing"); // this step is necessary to ensure ps->render is instantiated $this->pc = new parserClass; } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * @access protected */ protected function tearDown() { unset($pc); unset($ps); } /** * normal, expected cases */ // sourceLocation not set yet public function testWhenLocationNotSetAndPearizeNull() { $this->assertEquals($this->pc->getSourceLocation($this->ps->render), false); } public function testWhenLocationNotSetAndPearizeFalse() { $this->assertEquals($this->pc->getSourceLocation($this->ps->render, false), false); } public function testWhenLocationNotSetAndPearizeTrue() { $this->assertEquals($this->pc->getSourceLocation($this->ps->render, true), false); } // absolute path, but not a PEAR location public function testWhenNonPearLocationSetAndPearizeNull() { $this->pc->setSourceLocation('/where/on/earth/are/we'); $this->assertEquals($this->pc->getSourceLocation($this->ps->render), '/where/on/earth/are/we'); } public function testWhenNonPearLocationSetAndPearizeFalse() { $this->pc->setSourceLocation('/where/on/earth/are/we'); $this->assertEquals($this->pc->getSourceLocation($this->ps->render, false), '/where/on/earth/are/we'); } public function testWhenNonPearLocationSetAndPearizeTrue() { $this->pc->setSourceLocation('/where/on/earth/are/we'); $this->assertEquals($this->pc->getSourceLocation($this->ps->render, true), '/where/on/earth/are/we'); } // absolute path, and IS a PEAR location public function testWhenPearLocationSetAndPearizeNull() { $this->pc->sourceLocation = '/outside/pear/inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render), '/outside/pear/inside'); } public function testWhenPearLocationSetAndPearizeFalse() { $this->pc->sourceLocation = '/outside/pear/inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, false), '/outside/pear/inside'); } public function testWhenPearLocationSetAndPearizeTrue() { $this->pc->sourceLocation = '/outside/pear/inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, true), 'inside'); } /** * odd, edge cases */ // include a ".." in an absolute, non-PEAR path public function testWhenNonPearLocationSetIncludingDotsAndPearizeNull() { $this->pc->sourceLocation = '/outside/plum/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render), '/outside/plum/inside/../inside'); } public function testWhenNonPearLocationSetIncludingDotsAndPearizeFalse() { $this->pc->sourceLocation = '/outside/plum/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, false), '/outside/plum/inside/../inside'); } public function testWhenNonPearLocationSetIncludingDotsAndPearizeTrue() { $this->pc->sourceLocation = '/outside/plum/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, true), '/outside/plum/inside/../inside'); } // include a ".." in a relative, non-PEAR path public function testWhenNonPearRelativeLocationSetAndPearizeNull() { $this->pc->sourceLocation = 'outside/plum/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render), 'outside/plum/inside/../inside'); } public function testWhenNonPearRelativeLocationSetAndPearizeFalse() { $this->pc->sourceLocation = 'outside/plum/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, false), 'outside/plum/inside/../inside'); } public function testWhenNonPearRelativeLocationSetAndPearizeTrue() { $this->pc->sourceLocation = 'outside/plum/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, true), 'outside/plum/inside/../inside'); } // include a ".." in an absolute, PEAR path public function testWhenPearLocationSetIncludingDotsAndPearizeNull() { $this->pc->sourceLocation = '/outside/pear/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render), '/outside/pear/inside/../inside'); } public function testWhenPearLocationSetIncludingDotsAndPearizeFalse() { $this->pc->sourceLocation = '/outside/pear/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, false), '/outside/pear/inside/../inside'); } public function testWhenPearLocationSetIncludingDotsAndPearizeTrue() { $this->pc->sourceLocation = '/outside/pear/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, true), 'inside/../inside'); } // include a ".." in a relative, PEAR path public function testWhenPearRelativeLocationSetAndPearizeNull() { $this->pc->sourceLocation = 'outside/pear/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render), 'outside/pear/inside/../inside'); } public function testWhenPearRelativeLocationSetAndPearizeFalse() { $this->pc->sourceLocation = 'outside/pear/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, false), 'outside/pear/inside/../inside'); } public function testWhenPearRelativeLocationSetAndPearizeTrue() { $this->pc->sourceLocation = 'outside/pear/inside/../inside'; $this->assertEquals($this->pc->getSourceLocation($this->ps->render, true), 'inside/../inside'); } } // Call ParserPageTest::main() if this source file is executed directly. if (PHPUnit_MAIN_METHOD == "Documentation_tests_bug1574047::main") { ParserPageTest::main(); } ?>
« previous php.pear.cvs (#46138) next »