Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed #182: Clone is a valid function, method and type name in older
php versions.
- Loading branch information
1 parent
6ec5f71
commit b18bf37
Showing
8 changed files
with
147 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
tests/PHP/Depend/Bugs/CloneIsValidNameInOlderPhpVersionsBug182Test.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?php | ||
/** | ||
* This file is part of PHP_Depend. | ||
* | ||
* PHP Version 5 | ||
* | ||
* Copyright (c) 2008-2010, Manuel Pichler <mapi@pdepend.org>. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* * Neither the name of Manuel Pichler nor the names of his | ||
* contributors may be used to endorse or promote products derived | ||
* from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @category PHP | ||
* @package PHP_Depend | ||
* @subpackage Bugs | ||
* @author Manuel Pichler <mapi@pdepend.org> | ||
* @copyright 2008-2010 Manuel Pichler. All rights reserved. | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License | ||
* @version SVN: $Id$ | ||
* @link http://tracker.pdepend.org/pdepend/issue_tracker/issue/182 | ||
*/ | ||
|
||
require_once dirname(__FILE__) . '/AbstractTest.php'; | ||
|
||
/** | ||
* Test case for ticket #182. | ||
* | ||
* @category PHP | ||
* @package PHP_Depend | ||
* @subpackage Bugs | ||
* @author Manuel Pichler <mapi@pdepend.org> | ||
* @copyright 2008-2010 Manuel Pichler. All rights reserved. | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License | ||
* @version Release: @package_version@ | ||
* @link http://tracker.pdepend.org/pdepend/issue_tracker/issue/182 | ||
* | ||
* @covers stdClass | ||
*/ | ||
class PHP_Depend_Bugs_CloneIsValidNameInOlderPhpVersionsBug182Test | ||
extends PHP_Depend_Bugs_AbstractTest | ||
{ | ||
/** | ||
* testParserAcceptsCloneAsFunctionName | ||
* | ||
* @return void | ||
* @group pdepend | ||
* @group pdepend::bugs | ||
* @group regressiontest | ||
*/ | ||
public function testParserAcceptsCloneAsFunctionName() | ||
{ | ||
self::parseCodeResourceForTest(); | ||
} | ||
|
||
/** | ||
* testParserAcceptsCloneAsMethodName | ||
* | ||
* @return void | ||
* @group pdepend | ||
* @group pdepend::bugs | ||
* @group regressiontest | ||
*/ | ||
public function testParserAcceptsCloneAsMethodName() | ||
{ | ||
self::parseCodeResourceForTest(); | ||
} | ||
|
||
/** | ||
* testParserAcceptsCloneAsClassName | ||
* | ||
* @return void | ||
* @group pdepend | ||
* @group pdepend::bugs | ||
* @group regressiontest | ||
*/ | ||
public function testParserAcceptsCloneAsClassName() | ||
{ | ||
self::parseCodeResourceForTest(); | ||
} | ||
|
||
/** | ||
* testParserAcceptsCloneAsInterfaceName | ||
* | ||
* @return void | ||
* @group pdepend | ||
* @group pdepend::bugs | ||
* @group regressiontest | ||
*/ | ||
public function testParserAcceptsCloneAsInterfaceName() | ||
{ | ||
self::parseCodeResourceForTest(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
tests/PHP/Depend/_code/bugs/182/testParserAcceptsCloneAsClassName.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
class Clone | ||
{ | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/PHP/Depend/_code/bugs/182/testParserAcceptsCloneAsFunctionName.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
function clone($object) | ||
{ | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
tests/PHP/Depend/_code/bugs/182/testParserAcceptsCloneAsInterfaceName.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
interface Clone | ||
{ | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
tests/PHP/Depend/_code/bugs/182/testParserAcceptsCloneAsMethodName.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
class testParserAcceptsCloneAsMethodName | ||
{ | ||
function clone($object) | ||
{ | ||
return $object; | ||
} | ||
} |