Skip to content

Commit

Permalink
SlevomatCodingStandard.Functions.RequireTrailingCommaInCall: More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Mar 25, 2022
1 parent a1e2836 commit e9dc93e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function testErrors(): void
'enable' => true,
]);

self::assertSame(15, $report->getErrorCount());
self::assertSame(17, $report->getErrorCount());

self::assertSniffError($report, 5, RequireTrailingCommaInCallSniff::CODE_MISSING_TRAILING_COMMA);
self::assertSniffError($report, 12, RequireTrailingCommaInCallSniff::CODE_MISSING_TRAILING_COMMA);
Expand All @@ -38,6 +38,8 @@ public function testErrors(): void
self::assertSniffError($report, 83, RequireTrailingCommaInCallSniff::CODE_MISSING_TRAILING_COMMA);
self::assertSniffError($report, 91, RequireTrailingCommaInCallSniff::CODE_MISSING_TRAILING_COMMA);
self::assertSniffError($report, 99, RequireTrailingCommaInCallSniff::CODE_MISSING_TRAILING_COMMA);
self::assertSniffError($report, 107, RequireTrailingCommaInCallSniff::CODE_MISSING_TRAILING_COMMA);
self::assertSniffError($report, 114, RequireTrailingCommaInCallSniff::CODE_MISSING_TRAILING_COMMA);

self::assertAllFixedInFile($report);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,18 @@ public static function createParent($a, $b)
function () {
},
);

call(<<<EOM
This command will execute 'npm run' with a specified task.
Example:
- code:npm --build-all will build the client resources for the core, the project zed and the project yves code
EOM,
);

call(
OPTION_TASK_BUILD_YVES,
OPTION_TASK_BUILD_YVES_SHORT,
InputOption::VALUE_NONE,
'execute \'npm run\' to build the project resources of yves',
);
15 changes: 15 additions & 0 deletions tests/Sniffs/Functions/data/requireTrailingCommaInCallErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,18 @@ public static function createParent($a, $b)
function () {
}
);

call(<<<EOM
This command will execute 'npm run' with a specified task.
Example:
- code:npm --build-all will build the client resources for the core, the project zed and the project yves code
EOM
);

call(
OPTION_TASK_BUILD_YVES,
OPTION_TASK_BUILD_YVES_SHORT,
InputOption::VALUE_NONE,
'execute \'npm run\' to build the project resources of yves'
);

0 comments on commit e9dc93e

Please sign in to comment.