Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
],
"require": {
"php": ">=7.4",
"moodlehq/moodle-cs": "^3.4.11",
"moodlehq/moodle-cs": "^3.6.0",
"moodlehq/moodle-local_ci": "^1.0.32",
"moodlehq/moodle-local_moodlecheck": "^1.3.2",
"sebastian/phpcpd": "^6.0.3",
Expand Down
82 changes: 41 additions & 41 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions tests/Command/CodeCheckerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ abstract private function somefunc() { // To verify PHPCompatibility sniff.
$output = $commandTester->getDisplay();
$this->assertMatchesRegularExpression('/E\.* 10\.* \/ 10 \(100%\)/', $output); // Progress.
$this->assertMatchesRegularExpression('/\/fixable.php/', $output); // File.
$this->assertMatchesRegularExpression('/ 11 ERRORS AND 1 WARNING AFFECTING 8 /', $output); // Summary.
$this->assertMatchesRegularExpression('/ 13 ERRORS AND 1 WARNING AFFECTING 8 /', $output); // Summary.
$this->assertMatchesRegularExpression('/BoilerplateComment\.NoBoilerplateComment/', $output); // Moodle sniff.
$this->assertMatchesRegularExpression('/Expected MOODLE_INTERNAL check/', $output); // Moodle sniff.
$this->assertMatchesRegularExpression('/print_error\(\) has been deprecated/', $output); // Moodle sniff.
Expand All @@ -108,8 +108,9 @@ abstract private function somefunc() { // To verify PHPCompatibility sniff.
$this->assertMatchesRegularExpression('/Missing docblock for function somefunc/', $output); // Moodle sniff.
$this->assertMatchesRegularExpression('/AbstractPrivateMethods\.Found/', $output); // PHPCompatibility sniff.
$this->assertMatchesRegularExpression('/Opening brace must be the last content/', $output); // Generic sniff.
$this->assertMatchesRegularExpression('/Files\.EndFileNewline\.NotFound/', $output); // Generic of file.
$this->assertMatchesRegularExpression('/PHPCBF CAN FIX THE 4 MARKED SNIFF/', $output); // PHPCBF note.
$this->assertMatchesRegularExpression('/Closing brace must not be followed by/', $output); // PSR12 sniff.
$this->assertMatchesRegularExpression('/Files\.EndFileNewline\.NoneFound/', $output); // Generic of file.
$this->assertMatchesRegularExpression('/PHPCBF CAN FIX THE 5 MARKED SNIFF/', $output); // PHPCBF note.
$this->assertMatchesRegularExpression('/Time:.*Memory:/', $output); // Time.

// Also verify display info is correct.
Expand Down Expand Up @@ -228,7 +229,9 @@ public function testExecuteWithExclusions()
['--exclude' => 'moodle.Files.RequireLogin,' .
'moodle.Files.BoilerplateComment,' .
'moodle.Commenting.MissingDocblock,' .
'moodle.Commenting.FileExpectedTags']
'moodle.Commenting.FileExpectedTags,' .
'PSR12.Files.OpenTag,' .
'PSR12.Operators.OperatorSpacing']
);
$this->assertSame(0, $commandTester->getStatusCode());
}
Expand Down
4 changes: 1 addition & 3 deletions tests/Command/CodeFixerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testExecute()
$output = $commandTester->getDisplay();
$this->assertMatchesRegularExpression('/F\.* 10\.* \/ 10 \(100%\)/', $output); // Progress.
$this->assertMatchesRegularExpression('/\/fixable.php/', $output); // File.
$this->assertMatchesRegularExpression('/A TOTAL OF 2 ERRORS WERE FIXED IN 1 FILE/', $output); // Summary.
$this->assertMatchesRegularExpression('/A TOTAL OF 4 ERRORS WERE FIXED IN 1 FILE/', $output); // Summary.
$this->assertMatchesRegularExpression('/Time:.*Memory:/', $output); // Time.

// Also verify display info is correct.
Expand All @@ -102,9 +102,7 @@ public function testExecute()
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.

if (true) {

} else if (false) {

}

EOT;
Expand Down
2 changes: 0 additions & 2 deletions tests/Fixture/moodle-local_ci/classes/output/mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class mobile {

/**
* Render index page.
*
Expand All @@ -48,5 +47,4 @@ public static function view_index() {
],
];
}

}
2 changes: 1 addition & 1 deletion tests/Fixture/moodle-local_ci/tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

defined('MOODLE_INTERNAL') || die();

require_once(__DIR__.'/../lib.php');
require_once(__DIR__ . '/../lib.php');

/**
* The test
Expand Down
Loading