Skip to content

Commit

Permalink
Unit tests for #3051 (ref #2770)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Jan 19, 2021
1 parent e5afcb2 commit b1c2254
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 87 deletions.
12 changes: 12 additions & 0 deletions src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1000,3 +1000,15 @@ public function foo(object $a, ?object $b) {}
* @return void
*/
function foo($foo) {}

/**
* {@inheritDoc}
*/
public function foo($a, $b) {}

// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true

/**
* {@inheritDoc}
*/
public function foo($a, $b) {}
Original file line number Diff line number Diff line change
Expand Up @@ -1000,3 +1000,15 @@ public function foo(object $a, ?object $b) {}
* @return void
*/
function foo($foo) {}

/**
* {@inheritDoc}
*/
public function foo($a, $b) {}

// phpcs:set Squiz.Commenting.FunctionComment skipIfInheritdoc true

/**
* {@inheritDoc}
*/
public function foo($a, $b) {}
176 changes: 89 additions & 87 deletions src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,93 +26,95 @@ class FunctionCommentUnitTest extends AbstractSniffUnitTest
public function getErrorList()
{
$errors = [
5 => 1,
10 => 3,
12 => 2,
13 => 2,
14 => 1,
15 => 1,
28 => 1,
43 => 1,
76 => 1,
87 => 1,
103 => 1,
109 => 1,
112 => 1,
122 => 1,
123 => 3,
124 => 2,
125 => 1,
126 => 1,
137 => 4,
138 => 4,
139 => 4,
143 => 2,
152 => 1,
155 => 2,
159 => 1,
166 => 1,
173 => 1,
183 => 1,
190 => 2,
193 => 2,
196 => 1,
199 => 2,
210 => 1,
211 => 1,
222 => 1,
223 => 1,
224 => 1,
225 => 1,
226 => 1,
227 => 1,
230 => 2,
232 => 2,
246 => 1,
248 => 4,
261 => 1,
263 => 1,
276 => 1,
277 => 1,
278 => 1,
279 => 1,
280 => 1,
281 => 1,
284 => 1,
286 => 7,
294 => 1,
302 => 1,
312 => 1,
358 => 1,
359 => 2,
372 => 1,
373 => 1,
387 => 1,
407 => 1,
441 => 1,
500 => 1,
526 => 1,
548 => 1,
641 => 1,
669 => 1,
688 => 1,
744 => 1,
748 => 1,
767 => 1,
789 => 1,
792 => 1,
794 => 1,
797 => 1,
801 => 1,
828 => 1,
840 => 1,
852 => 1,
864 => 1,
886 => 1,
888 => 1,
890 => 1,
978 => 1,
997 => 1,
5 => 1,
10 => 3,
12 => 2,
13 => 2,
14 => 1,
15 => 1,
28 => 1,
43 => 1,
76 => 1,
87 => 1,
103 => 1,
109 => 1,
112 => 1,
122 => 1,
123 => 3,
124 => 2,
125 => 1,
126 => 1,
137 => 4,
138 => 4,
139 => 4,
143 => 2,
152 => 1,
155 => 2,
159 => 1,
166 => 1,
173 => 1,
183 => 1,
190 => 2,
193 => 2,
196 => 1,
199 => 2,
210 => 1,
211 => 1,
222 => 1,
223 => 1,
224 => 1,
225 => 1,
226 => 1,
227 => 1,
230 => 2,
232 => 2,
246 => 1,
248 => 4,
261 => 1,
263 => 1,
276 => 1,
277 => 1,
278 => 1,
279 => 1,
280 => 1,
281 => 1,
284 => 1,
286 => 7,
294 => 1,
302 => 1,
312 => 1,
358 => 1,
359 => 2,
372 => 1,
373 => 1,
387 => 1,
407 => 1,
441 => 1,
500 => 1,
526 => 1,
548 => 1,
641 => 1,
669 => 1,
688 => 1,
744 => 1,
748 => 1,
767 => 1,
789 => 1,
792 => 1,
794 => 1,
797 => 1,
801 => 1,
828 => 1,
840 => 1,
852 => 1,
864 => 1,
886 => 1,
888 => 1,
890 => 1,
978 => 1,
997 => 1,
1004 => 2,
1006 => 1,
];

// Scalar type hints only work from PHP 7 onwards.
Expand Down

0 comments on commit b1c2254

Please sign in to comment.