Skip to content

Commit 6669726

Browse files
committed
Align fixtures and tests
1 parent 220798c commit 6669726

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

tests/Command/CodeCheckerCommandTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ abstract private function somefunc() { // To verify PHPCompatibility sniff.
9696
$output = $commandTester->getDisplay();
9797
$this->assertMatchesRegularExpression('/E\.* 10\.* \/ 10 \(100%\)/', $output); // Progress.
9898
$this->assertMatchesRegularExpression('/\/fixable.php/', $output); // File.
99-
$this->assertMatchesRegularExpression('/ 11 ERRORS AND 1 WARNING AFFECTING 8 /', $output); // Summary.
99+
$this->assertMatchesRegularExpression('/ 13 ERRORS AND 1 WARNING AFFECTING 8 /', $output); // Summary.
100100
$this->assertMatchesRegularExpression('/BoilerplateComment\.NoBoilerplateComment/', $output); // Moodle sniff.
101101
$this->assertMatchesRegularExpression('/Expected MOODLE_INTERNAL check/', $output); // Moodle sniff.
102102
$this->assertMatchesRegularExpression('/print_error\(\) has been deprecated/', $output); // Moodle sniff.
@@ -108,8 +108,9 @@ abstract private function somefunc() { // To verify PHPCompatibility sniff.
108108
$this->assertMatchesRegularExpression('/Missing docblock for function somefunc/', $output); // Moodle sniff.
109109
$this->assertMatchesRegularExpression('/AbstractPrivateMethods\.Found/', $output); // PHPCompatibility sniff.
110110
$this->assertMatchesRegularExpression('/Opening brace must be the last content/', $output); // Generic sniff.
111-
$this->assertMatchesRegularExpression('/Files\.EndFileNewline\.NotFound/', $output); // Generic of file.
112-
$this->assertMatchesRegularExpression('/PHPCBF CAN FIX THE 4 MARKED SNIFF/', $output); // PHPCBF note.
111+
$this->assertMatchesRegularExpression('/Closing brace must not be followed by/', $output); // PSR12 sniff.
112+
$this->assertMatchesRegularExpression('/Files\.EndFileNewline\.NoneFound/', $output); // Generic of file.
113+
$this->assertMatchesRegularExpression('/PHPCBF CAN FIX THE 5 MARKED SNIFF/', $output); // PHPCBF note.
113114
$this->assertMatchesRegularExpression('/Time:.*Memory:/', $output); // Time.
114115

115116
// Also verify display info is correct.
@@ -228,7 +229,9 @@ public function testExecuteWithExclusions()
228229
['--exclude' => 'moodle.Files.RequireLogin,' .
229230
'moodle.Files.BoilerplateComment,' .
230231
'moodle.Commenting.MissingDocblock,' .
231-
'moodle.Commenting.FileExpectedTags']
232+
'moodle.Commenting.FileExpectedTags,' .
233+
'PSR12.Files.OpenTag,' .
234+
'PSR12.Operators.OperatorSpacing']
232235
);
233236
$this->assertSame(0, $commandTester->getStatusCode());
234237
}

tests/Command/CodeFixerCommandTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testExecute()
7878
$output = $commandTester->getDisplay();
7979
$this->assertMatchesRegularExpression('/F\.* 10\.* \/ 10 \(100%\)/', $output); // Progress.
8080
$this->assertMatchesRegularExpression('/\/fixable.php/', $output); // File.
81-
$this->assertMatchesRegularExpression('/A TOTAL OF 2 ERRORS WERE FIXED IN 1 FILE/', $output); // Summary.
81+
$this->assertMatchesRegularExpression('/A TOTAL OF 4 ERRORS WERE FIXED IN 1 FILE/', $output); // Summary.
8282
$this->assertMatchesRegularExpression('/Time:.*Memory:/', $output); // Time.
8383

8484
// Also verify display info is correct.
@@ -102,9 +102,7 @@ public function testExecute()
102102
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
103103
104104
if (true) {
105-
106105
} else if (false) {
107-
108106
}
109107

110108
EOT;

tests/Fixture/moodle-local_ci/classes/output/mobile.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3333
*/
3434
class mobile {
35-
3635
/**
3736
* Render index page.
3837
*
@@ -48,5 +47,4 @@ public static function view_index() {
4847
],
4948
];
5049
}
51-
5250
}

tests/Fixture/moodle-local_ci/tests/lib_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

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

31-
require_once(__DIR__.'/../lib.php');
31+
require_once(__DIR__ . '/../lib.php');
3232

3333
/**
3434
* The test

0 commit comments

Comments
 (0)