Arbit - project tracking

PHP Depend

History

Diff

1067 1068 /tests/PHP/Depend/Bugs/AllTests.php
76 76 require_once dirname(__FILE__) . '/NamespaceKeywordInParameterTypeHintBug102Test.php';
77 77 require_once dirname(__FILE__) . '/ParameterStringDefaultValueBug103Test.php';
78 78 require_once dirname(__FILE__) . '/DefaultNamespaceBug106Test.php';
79 +require_once dirname(__FILE__) . '/ComplexStringParsingBug114Test.php';
79 80
80 81 /**
81 82 * Test suite for bugs meta package.
132 133 $suite->addTestSuite('PHP_Depend_Bugs_NamespaceKeywordInParameterTypeHintBug102Test');
133 134 $suite->addTestSuite('PHP_Depend_Bugs_ParameterStringDefaultValueBug103Test');
134 135 $suite->addTestSuite('PHP_Depend_Bugs_DefaultNamespaceBug106Test');
136 + $suite->addTestSuite('PHP_Depend_Bugs_ComplexStringParsingBug114Test');
135 137
136 138 return $suite;
137 139 }
1067 1068 /tests/PHP/Depend/Bugs/ComplexStringParsingBug114Test.php
2 +<?php
3 +/**
4 + * This file is part of PHP_Depend.
5 + *
6 + * PHP Version 5
7 + *
8 + * Copyright (c) 2008-2010, 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-2010 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 ticket #114.
54 + *
55 + * @category PHP
56 + * @package PHP_Depend
57 + * @subpackage Bugs
58 + * @author Manuel Pichler <mapi@pdepend.org>
59 + * @copyright 2008-2010 Manuel Pichler. All rights reserved.
60 + * @license http://www.opensource.org/licenses/bsd-license.php BSD License
61 + * @version Release: @package_version@
62 + * @link http://www.pdepend.org/
63 + */
64 +class PHP_Depend_Bugs_ComplexStringParsingBug114Test extends PHP_Depend_Bugs_AbstractTest
65 +{
66 + /**
67 + * testParserHandlesStringWithEmbeddedBacktickExpression
68 + *
69 + * @return void
70 + * @covers stdClass
71 + * @group pdepend
72 + * @group pdepend::bugs
73 + * @group regressiontest
74 + */
75 + public function testParserHandlesStringWithEmbeddedBacktickExpression()
76 + {
77 + self::parseTestCaseSource(__METHOD__);
78 + }
79 +
80 + /**
81 + * testParserHandlesStringWithEmbeddedExpression
82 + *
83 + * @return void
84 + * @covers stdClass
85 + * @group pdepend
86 + * @group pdepend::bugs
87 + * @group regressiontest
88 + */
89 + public function testParserHandlesStringWithEmbeddedExpression()
90 + {
91 + self::parseTestCaseSource(__METHOD__);
92 + }
93 +
94 + /**
95 + * testParserHandlesBacktickExpressionWithEmbeddedStringExpression
96 + *
97 + * @return void
98 + * @covers stdClass
99 + * @group pdepend
100 + * @group pdepend::bugs
101 + * @group regressiontest
102 + */
103 + public function testParserHandlesBacktickExpressionWithEmbeddedStringExpression()
104 + {
105 + self::parseTestCaseSource(__METHOD__);
106 + }
107 +}
1067 1068 /tests/PHP/Depend/_code/bugs/114/testParserHandlesBacktickExpressionWithEmbeddedStringExpression.php
2 +<?php
3 +class testParserHandlesBacktickExpressionWithEmbeddedStringExpression
4 +{
5 + public function foo()
6 + {
7 + return `Manuel Pichler "$ticketNo"`;
8 + }
9 +}
1067 1068 /tests/PHP/Depend/_code/bugs/114/testParserHandlesStringWithEmbeddedBacktickExpression.php
2 +<?php
3 +class Reader
4 +{
5 + function fetch()
6 + {
7 + "DESCRIBE `$table`";
8 + }
9 +
10 + function convert()
11 + {
12 + }
13 +}
1067 1068 /tests/PHP/Depend/_code/bugs/114/testParserHandlesStringWithEmbeddedExpression.php
2 +<?php
3 +/**
4 + * @package Database
5 + */
6 +class Reader
7 +{
8 + function fetch()
9 + {
10 + "DESCRIBE `$tableName`";
11 + }
12 +
13 + static function convert()
14 + {
15 + }
16 +}
1067 1068 /CHANGELOG
11 11 revision #1037.
12 12 - Performance intensive calculation result cached.
13 13 - Test code restructured and improved.
14 +- Concurrency issue for parallel running pdepend instances fixed.
14 15
15 16 PHP_Depend 0.9.9
16 17 ----------------
1067 1068 /PHP/Depend/Parser.php
2562 2562 case $delimiterType:
2563 2563 break 2;
2564 2564
2565 + case self::T_BACKTICK:
2566 + case self::T_DOUBLE_QUOTE:
2567 + $token = $this->_consumeToken($tokenType);
2568 + $expr = $this->_builder->buildASTLiteral($token->image);
2569 + $string->addChild($expr);
2570 + break;
2571 +
2565 2572 default:
2566 2573 $expr = $this->_parseOptionalExpression();
2567 2574 if ($expr == null) {
2569 2576 $expr = $this->_builder->buildASTLiteral($token->image);
2570 2577 }
2571 2578 $string->addChild($expr);
2579 + break;
2572 2580 }
2573 2581
2574 2582 $this->_consumeComments();
2575 2583 $tokenType = $this->_tokenizer->peek();
2576 2584 }
2577 -
2585 +
2578 2586 $this->_consumeToken($delimiterType);
2579 2587
2580 2588 return $this->_setNodePositionsAndReturn($string);
1067 1068 /package.xml
34 34 revision #1037.
35 35 - Performance intensive calculation result cached.
36 36 - Test code restructured and improved.
37 +- Concurrency issue for parallel running pdepend instances fixed.
37 38 </notes>
38 39 <contents>
39 40 <dir name="/">