Arbit - project tracking

PHP Depend

History

Diff

1008 1009 /tests/PHP/Depend/Bugs/AllTests.php
73 73 require_once dirname(__FILE__) . '/NPathComplexityIsBrokenInVersion096Bug095Test.php';
74 74 require_once dirname(__FILE__) . '/DefaultPackageContainsBrokenAritfactsBug098Test.php';
75 75 require_once dirname(__FILE__) . '/ParserSetsIncorrectStartLineBug101Test.php';
76 +require_once dirname(__FILE__) . '/ParameterStringDefaultValueBug103Test.php';
76 77
77 78 /**
78 79 * Test suite for bugs meta package.
126 127 $suite->addTestSuite('PHP_Depend_Bugs_NPathComplexityIsBrokenInVersion096Bug095Test');
127 128 $suite->addTestSuite('PHP_Depend_Bugs_DefaultPackageContainsBrokenAritfactsBug098Test');
128 129 $suite->addTestSuite('PHP_Depend_Bugs_ParserSetsIncorrectStartLineBug101Test');
130 + $suite->addTestSuite('PHP_Depend_Bugs_ParameterStringDefaultValueBug103Test');
129 131
130 132 return $suite;
131 133 }
1008 1009 /tests/PHP/Depend/Bugs/ParameterStringDefaultValueBug103Test.php
2 +<?php
3 +/**
4 + * This file is part of PHP_Depend.
5 + *
6 + * PHP Version 5
7 + *
8 + * Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.
9 + * All rights reserved.
10 + *
11 + * Redistribution and use in source and binary forms, with or without
12 + * modification, are permitted provided that the following conditions
13 + * are met:
14 + *
15 + * * Redistributions of source code must retain the above copyright
16 + * notice, this list of conditions and the following disclaimer.
17 + *
18 + * * Redistributions in binary form must reproduce the above copyright
19 + * notice, this list of conditions and the following disclaimer in
20 + * the documentation and/or other materials provided with the
21 + * distribution.
22 + *
23 + * * Neither the name of Manuel Pichler nor the names of his
24 + * contributors may be used to endorse or promote products derived
25 + * from this software without specific prior written permission.
26 + *
27 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30 + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31 + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33 + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35 + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 + * POSSIBILITY OF SUCH DAMAGE.
39 + *
40 + * @category PHP
41 + * @package PHP_Depend
42 + * @subpackage Bugs
43 + * @author Manuel Pichler <mapi@pdepend.org>
44 + * @copyright 2008-2009 Manuel Pichler. All rights reserved.
45 + * @license http://www.opensource.org/licenses/bsd-license.php BSD License
46 + * @version SVN: $Id$
47 + * @link http://www.pdepend.org/
48 + */
49 +
50 +require_once dirname(__FILE__) . '/AbstractTest.php';
51 +
52 +/**
53 + * Test case for bug 103. The current parser implementation does not handle
54 + * string parameter default values as expected. For example the following source
55 + * fragment:
56 + *
57 + * http://tracker.pdepend.org/pdepend/issue_tracker/issue/103
58 + *
59 + * @category PHP
60 + * @package PHP_Depend
61 + * @subpackage Bugs
62 + * @author Manuel Pichler <mapi@pdepend.org>
63 + * @copyright 2008-2009 Manuel Pichler. All rights reserved.
64 + * @license http://www.opensource.org/licenses/bsd-license.php BSD License
65 + * @version Release: @package_version@
66 + * @link http://www.pdepend.org/
67 + */
68 +class PHP_Depend_Bugs_ParameterStringDefaultValueBug103Test
69 + extends PHP_Depend_Bugs_AbstractTest
70 +{
71 + /**
72 + * testParserHandlesStringDefaultValueWithEmbeddedExpression
73 + *
74 + * @return void
75 + * @covers PHP_Depend_Parser
76 + * @group parser
77 + * @group bugs
78 + */
79 + public function testParserHandlesStringDefaultValueWithEmbeddedExpression()
80 + {
81 + $packages = self::parseTestCaseSource(__METHOD__);
82 + $function = $packages->current()
83 + ->getFunctions()
84 + ->current()
85 + ->getParameters()
86 + ->current()
87 + ->getDefaultValue();
88 + }
89 +}
1008 1009 /tests/PHP/Depend/Bugs/ClosureReturnsByReferenceBug094Test.php
66 66 extends PHP_Depend_Bugs_AbstractTest
67 67 {
68 68 /**
69 + * testParserHandlesClosureThatReturnsReference
70 + *
69 71 * @return void
72 + * @covers PHP_Depend_Parser
73 + * @group parser
70 74 * @group bugs
71 75 */
72 76 public function testParserHandlesClosureThatReturnsReference()
1008 1009 /tests/PHP/Depend/_code/bugs/103/testParserHandlesStringDefaultValueWithEmbeddedExpression.php
2 +<?php
3 +function foo($bar = "x (\$x) y") {
4 +}
1008 1009 /package.xml
2749 2749 </package>
2750 2750 </optional>
2751 2751 </dependencies>
2752 +
2752 2753 <phprelease>
2753 2754 <installconditions>
2754 2755 <os>
2766 2767 <ignore name="pdepend.bat"/>
2767 2768 </filelist>
2768 2769 </phprelease>
2770 +
2769 2771 <changelog>
2770 2772 <release>
2771 2773 <lead>