|
10 | 10 | use PHPUnit\Framework\TestCase;
|
11 | 11 |
|
12 | 12 | use function array_shift;
|
13 |
| -use function get_class; |
14 | 13 | use function trim;
|
15 | 14 | use function uniqid;
|
16 | 15 |
|
@@ -69,67 +68,72 @@ public function testInterfaceReturn()
|
69 | 68 | public function testGetContentsReturnsContents()
|
70 | 69 | {
|
71 | 70 | $reflectionClass = new ClassReflection(TestAsset\TestSampleClass2::class);
|
72 |
| - $target = <<<EOS |
73 |
| -{ |
74 |
| - protected \$_prop1 = null; |
75 |
| -
|
76 |
| - /** |
77 |
| - * @Sample({"foo":"bar"}) |
78 |
| - */ |
79 |
| - protected \$_prop2 = null; |
80 | 71 |
|
81 |
| - public function getProp1() |
82 |
| - { |
83 |
| - return \$this->_prop1; |
84 |
| - } |
85 |
| -
|
86 |
| - public function getProp2(\$param1, TestSampleClass \$param2) |
87 |
| - { |
88 |
| - return \$this->_prop2; |
89 |
| - } |
90 |
| -
|
91 |
| - public function getIterator(): \Traversable |
92 |
| - { |
93 |
| - return new \EmptyIterator(); |
94 |
| - } |
95 |
| -
|
96 |
| -} |
97 |
| -EOS; |
98 |
| - $contents = $reflectionClass->getContents(); |
| 72 | + // phpcs:disable SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly |
| 73 | + $target = <<<EOS |
| 74 | + { |
| 75 | + protected \$_prop1 = null; |
| 76 | + |
| 77 | + /** |
| 78 | + * @Sample({"foo":"bar"}) |
| 79 | + */ |
| 80 | + protected \$_prop2 = null; |
| 81 | + |
| 82 | + public function getProp1() |
| 83 | + { |
| 84 | + return \$this->_prop1; |
| 85 | + } |
| 86 | + |
| 87 | + public function getProp2(\$param1, TestSampleClass \$param2) |
| 88 | + { |
| 89 | + return \$this->_prop2; |
| 90 | + } |
| 91 | + |
| 92 | + public function getIterator(): \Traversable |
| 93 | + { |
| 94 | + return new \EmptyIterator(); |
| 95 | + } |
| 96 | + |
| 97 | + } |
| 98 | + EOS; |
| 99 | + $contents = $reflectionClass->getContents(); |
99 | 100 | self::assertEquals(trim($target), trim($contents));
|
| 101 | + // phpcs:enable |
100 | 102 | }
|
101 | 103 |
|
102 | 104 | public function testGetContentsReturnsContentsWithImplementsOnSeparateLine()
|
103 | 105 | {
|
104 | 106 | $reflectionClass = new ClassReflection(TestAsset\TestSampleClass9::class);
|
105 |
| - $target = <<<EOS |
106 |
| -{ |
107 |
| - protected \$_prop1 = null; |
108 |
| -
|
109 |
| - /** |
110 |
| - * @Sample({"foo":"bar"}) |
111 |
| - */ |
112 |
| - protected \$_prop2 = null; |
113 |
| -
|
114 |
| - public function getProp1() |
115 |
| - { |
116 |
| - return \$this->_prop1; |
117 |
| - } |
118 |
| -
|
119 |
| - public function getProp2(\$param1, TestSampleClass \$param2) |
120 |
| - { |
121 |
| - return \$this->_prop2; |
122 |
| - } |
123 |
| -
|
124 |
| - public function getIterator(): \Traversable |
125 |
| - { |
126 |
| - return new \EmptyIterator(); |
127 |
| - } |
128 |
| -
|
129 |
| -} |
130 |
| -EOS; |
131 |
| - $contents = $reflectionClass->getContents(); |
| 107 | + // phpcs:disable SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly |
| 108 | + $target = <<<EOS |
| 109 | + { |
| 110 | + protected \$_prop1 = null; |
| 111 | + |
| 112 | + /** |
| 113 | + * @Sample({"foo":"bar"}) |
| 114 | + */ |
| 115 | + protected \$_prop2 = null; |
| 116 | + |
| 117 | + public function getProp1() |
| 118 | + { |
| 119 | + return \$this->_prop1; |
| 120 | + } |
| 121 | + |
| 122 | + public function getProp2(\$param1, TestSampleClass \$param2) |
| 123 | + { |
| 124 | + return \$this->_prop2; |
| 125 | + } |
| 126 | + |
| 127 | + public function getIterator(): \Traversable |
| 128 | + { |
| 129 | + return new \EmptyIterator(); |
| 130 | + } |
| 131 | + |
| 132 | + } |
| 133 | + EOS; |
| 134 | + $contents = $reflectionClass->getContents(); |
132 | 135 | self::assertEquals(trim($target), trim($contents));
|
| 136 | + // phpcs:enable |
133 | 137 | }
|
134 | 138 |
|
135 | 139 | public function testStartLine()
|
|
0 commit comments