Arbit - project tracking

PHP Depend

Browse source code

File: / tests/ PHP/ Depend/ Bugs/ EndLessLoopBetweenForParentClassBug152Test.php

Type
text/plain text/plain
Last Author
mapi
Version
1320
Line Rev. Author Source
1 1307 mapi <?php
2 mapi /**
3 mapi * This file is part of PHP_Depend.
4 mapi *
5 mapi * PHP Version 5
6 mapi *
7 mapi * Copyright (c) 2008-2010, Manuel Pichler <mapi@pdepend.org>.
8 mapi * All rights reserved.
9 mapi *
10 mapi * Redistribution and use in source and binary forms, with or without
11 mapi * modification, are permitted provided that the following conditions
12 mapi * are met:
13 mapi *
14 mapi * * Redistributions of source code must retain the above copyright
15 mapi * notice, this list of conditions and the following disclaimer.
16 mapi *
17 mapi * * Redistributions in binary form must reproduce the above copyright
18 mapi * notice, this list of conditions and the following disclaimer in
19 mapi * the documentation and/or other materials provided with the
20 mapi * distribution.
21 mapi *
22 mapi * * Neither the name of Manuel Pichler nor the names of his
23 mapi * contributors may be used to endorse or promote products derived
24 mapi * from this software without specific prior written permission.
25 mapi *
26 mapi * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 mapi * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 mapi * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
29 mapi * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
30 mapi * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
31 mapi * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
32 mapi * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33 mapi * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34 mapi * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 mapi * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
36 mapi * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 mapi * POSSIBILITY OF SUCH DAMAGE.
38 mapi *
39 mapi * @category PHP
40 mapi * @package PHP_Depend
41 mapi * @subpackage Bugs
42 mapi * @author Manuel Pichler <mapi@pdepend.org>
43 mapi * @copyright 2008-2010 Manuel Pichler. All rights reserved.
44 mapi * @license http://www.opensource.org/licenses/bsd-license.php BSD License
45 mapi * @version SVN: $Id$
46 mapi * @link http://www.pdepend.org/
47 mapi */
48 mapi
49 mapi require_once dirname(__FILE__) . '/AbstractTest.php';
50 mapi
51 mapi /**
52 mapi * Test case for bug #152.
53 mapi *
54 mapi * @category PHP
55 mapi * @package PHP_Depend
56 mapi * @subpackage Bugs
57 mapi * @author Manuel Pichler <mapi@pdepend.org>
58 mapi * @copyright 2008-2010 Manuel Pichler. All rights reserved.
59 mapi * @license http://www.opensource.org/licenses/bsd-license.php BSD License
60 mapi * @version Release: @package_version@
61 mapi * @link http://www.pdepend.org/
62 mapi */
63 mapi class PHP_Depend_Bugs_EndLessLoopBetweenForParentClassBug152Test
64 mapi extends PHP_Depend_Bugs_AbstractTest
65 mapi {
66 mapi /**
67 mapi * testClassNotResultsInEndlessLoopWhileCallingGetParentClass
68 mapi *
69 mapi * @return void
70 mapi * @covers stdClass
71 mapi * @group pdepend
72 mapi * @group pdepend::bugs
73 mapi * @group regressiontest
74 mapi */
75 mapi public function testClassNotResultsInEndlessLoopWhileCallingGetParentClass()
76 mapi {
77 mapi self::parseTestCaseSource(__METHOD__)
78 mapi ->current()
79 mapi ->getClasses()
80 mapi ->current()
81 mapi ->getInterfaces();
82 mapi }
83 mapi
84 mapi /**
85 mapi * testClassNotResultsInEndlessLoopWhileCallingGetInterfaces
86 mapi *
87 mapi * @return void
88 mapi * @covers stdClass
89 mapi * @group pdepend
90 mapi * @group pdepend::bugs
91 mapi * @group regressiontest
92 mapi */
93 mapi public function testClassNotResultsInEndlessLoopWhileCallingGetInterfaces()
94 mapi {
95 mapi self::parseTestCaseSource(__METHOD__)
96 mapi ->current()
97 mapi ->getClasses()
98 mapi ->current()
99 mapi ->getInterfaces();
100 mapi }
101 mapi
102 mapi /**
103 mapi * testClassDeclarationAndParameterTypeHintAreReferencesToTheSameClass
104 mapi *
105 mapi * @return void
106 mapi * @covers stdClass
107 mapi * @group pdepend
108 mapi * @group pdepend::bugs
109 mapi * @group regressiontest
110 mapi */
111 mapi public function testClassDeclarationAndParameterTypeHintAreReferencesToTheSameClass()
112 mapi {
113 mapi $class = self::parseTestCaseSource(__METHOD__)
114 mapi ->current()
115 mapi ->getClasses()
116 mapi ->current();
117 mapi
118 mapi $typeHint = $class->getMethods()
119 mapi ->current()
120 mapi ->getParameters()
121 mapi ->current()
122 mapi ->getClass();
123 1320 mapi }
124 1307 mapi
125 1320 mapi /**
126 mapi * testParserDoesNotDetectThrownInternalExceptionClassAsPartOfPackage
127 mapi *
128 mapi * @return void
129 mapi * @covers stdClass
130 mapi * @group pdepend
131 mapi * @group pdepend::bugs
132 mapi * @group regressiontest
133 mapi * @group barbaz
134 mapi */
135 mapi public function testParserDoesNotDetectThrownInternalExceptionClassAsPartOfPackage()
136 mapi {
137 mapi $classes = self::parseTestCaseSource(__METHOD__)
138 mapi ->current()
139 mapi ->getClasses();
140 1307 mapi
141 1320 mapi $this->assertEquals(1, count($classes));
142 1307 mapi }
143 mapi }