Skip to content

Commit 342bdce

Browse files
committed
Fixed coding standards in workflow and installer tests.
1 parent 87ad5aa commit 342bdce

6 files changed

Lines changed: 187 additions & 98 deletions

File tree

.vortex/installer/composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vortex/installer/rector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector;
1717
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
1818
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
19+
use Rector\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector;
1920
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
2021
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
2122
use Rector\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector;
@@ -56,6 +57,7 @@
5657
InlineArrayReturnAssignRector::class,
5758
NewlineAfterStatementRector::class,
5859
NewlineBeforeNewAssignSetRector::class,
60+
NewlineBetweenClassLikeStmtsRector::class,
5961
PrivatizeFinalClassMethodRector::class,
6062
PrivatizeFinalClassPropertyRector::class,
6163
PrivatizeLocalGetterToPropertyRector::class,
@@ -91,4 +93,3 @@
9193
])
9294
// Import configuration.
9395
->withImportNames(importNames: false, importDocBlockNames: false);
94-

.vortex/tests/composer.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vortex/tests/phpunit/Functional/PostBuildTest.php

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -53,37 +53,37 @@ protected function tearDown(): void {
5353
*/
5454
#[Group('postbuild')]
5555
public function testCircleCiArtifactsAreSaved(): void {
56-
$currentJobNumber = (int) getenv('CIRCLE_BUILD_NUM');
57-
$previousJobNumbers = $this->circleCiGetPreviousJobNumbers($currentJobNumber);
56+
$current_job_number = (int) getenv('CIRCLE_BUILD_NUM');
57+
$previous_job_numbers = $this->circleCiGetPreviousJobNumbers($current_job_number);
5858

59-
$this->assertNotEmpty($previousJobNumbers, 'No previous job numbers found');
59+
$this->assertNotEmpty($previous_job_numbers, 'No previous job numbers found');
6060

61-
foreach ($previousJobNumbers as $previousJobNumber) {
62-
$artifactsData = $this->circleCiGetJobArtifacts($previousJobNumber);
61+
foreach ($previous_job_numbers as $previou_job_number) {
62+
$artifacts_data = $this->circleCiGetJobArtifacts($previou_job_number);
6363

6464
// Verify runner 0 artifacts.
65-
$artifactPathsRunner0 = $this->circleCiExtractArtifactPaths($artifactsData, 0);
66-
$artifactPathsRunner0Str = implode("\n", $artifactPathsRunner0);
65+
$artifact_paths_runner0 = $this->circleCiExtractArtifactPaths($artifacts_data, 0);
66+
$artifact_paths_runner0_str = implode("\n", $artifact_paths_runner0);
6767

68-
$this->assertStringContainsString('coverage/phpunit/cobertura.xml', $artifactPathsRunner0Str, 'Runner 0 should have PHPUnit cobertura coverage');
69-
$this->assertStringContainsString('coverage/phpunit/.coverage-html/index.html', $artifactPathsRunner0Str, 'Runner 0 should have PHPUnit HTML coverage');
68+
$this->assertStringContainsString('coverage/phpunit/cobertura.xml', $artifact_paths_runner0_str, 'Runner 0 should have PHPUnit cobertura coverage');
69+
$this->assertStringContainsString('coverage/phpunit/.coverage-html/index.html', $artifact_paths_runner0_str, 'Runner 0 should have PHPUnit HTML coverage');
7070

71-
$this->assertStringContainsString('homepage.feature', $artifactPathsRunner0Str, 'Runner 0 should have homepage.feature');
72-
$this->assertStringContainsString('login.feature', $artifactPathsRunner0Str, 'Runner 0 should have login.feature');
73-
$this->assertStringContainsString('clamav.feature', $artifactPathsRunner0Str, 'Runner 0 should have clamav.feature');
74-
$this->assertStringNotContainsString('search.feature', $artifactPathsRunner0Str, 'Runner 0 should NOT have search.feature');
71+
$this->assertStringContainsString('homepage.feature', $artifact_paths_runner0_str, 'Runner 0 should have homepage.feature');
72+
$this->assertStringContainsString('login.feature', $artifact_paths_runner0_str, 'Runner 0 should have login.feature');
73+
$this->assertStringContainsString('clamav.feature', $artifact_paths_runner0_str, 'Runner 0 should have clamav.feature');
74+
$this->assertStringNotContainsString('search.feature', $artifact_paths_runner0_str, 'Runner 0 should NOT have search.feature');
7575

7676
// Verify runner 1 artifacts.
77-
$artifactPathsRunner1 = $this->circleCiExtractArtifactPaths($artifactsData, 1);
78-
$artifactPathsRunner1Str = implode("\n", $artifactPathsRunner1);
77+
$artifact_paths_runner1 = $this->circleCiExtractArtifactPaths($artifacts_data, 1);
78+
$artifact_paths_runner1_str = implode("\n", $artifact_paths_runner1);
7979

80-
$this->assertStringContainsString('coverage/phpunit/cobertura.xml', $artifactPathsRunner1Str, 'Runner 1 should have PHPUnit cobertura coverage');
81-
$this->assertStringContainsString('coverage/phpunit/.coverage-html/index.html', $artifactPathsRunner1Str, 'Runner 1 should have PHPUnit HTML coverage');
80+
$this->assertStringContainsString('coverage/phpunit/cobertura.xml', $artifact_paths_runner1_str, 'Runner 1 should have PHPUnit cobertura coverage');
81+
$this->assertStringContainsString('coverage/phpunit/.coverage-html/index.html', $artifact_paths_runner1_str, 'Runner 1 should have PHPUnit HTML coverage');
8282

83-
$this->assertStringContainsString('homepage.feature', $artifactPathsRunner1Str, 'Runner 1 should have homepage.feature');
84-
$this->assertStringContainsString('login.feature', $artifactPathsRunner1Str, 'Runner 1 should have login.feature');
85-
$this->assertStringNotContainsString('clamav.feature', $artifactPathsRunner1Str, 'Runner 1 should NOT have clamav.feature');
86-
$this->assertStringContainsString('search.feature', $artifactPathsRunner1Str, 'Runner 1 should have search.feature');
83+
$this->assertStringContainsString('homepage.feature', $artifact_paths_runner1_str, 'Runner 1 should have homepage.feature');
84+
$this->assertStringContainsString('login.feature', $artifact_paths_runner1_str, 'Runner 1 should have login.feature');
85+
$this->assertStringNotContainsString('clamav.feature', $artifact_paths_runner1_str, 'Runner 1 should NOT have clamav.feature');
86+
$this->assertStringContainsString('search.feature', $artifact_paths_runner1_str, 'Runner 1 should have search.feature');
8787
}
8888
}
8989

@@ -96,30 +96,30 @@ public function testCircleCiArtifactsAreSaved(): void {
9696
*/
9797
#[Group('postbuild')]
9898
public function testCircleCiTestResultsAreSaved(): void {
99-
$currentJobNumber = (int) getenv('CIRCLE_BUILD_NUM');
100-
$previousJobNumbers = $this->circleCiGetPreviousJobNumbers($currentJobNumber);
99+
$current_job_number = (int) getenv('CIRCLE_BUILD_NUM');
100+
$previous_job_numbers = $this->circleCiGetPreviousJobNumbers($current_job_number);
101101

102-
$this->assertNotEmpty($previousJobNumbers, 'No previous job numbers found');
102+
$this->assertNotEmpty($previous_job_numbers, 'No previous job numbers found');
103103

104-
foreach ($previousJobNumbers as $previousJobNumber) {
105-
$testsData = $this->circleCiGetJobTestMetadata($previousJobNumber);
106-
$testPaths = $this->circleCiExtractTestPaths($testsData);
107-
$testPathsStr = implode("\n", $testPaths);
104+
foreach ($previous_job_numbers as $previou_job_number) {
105+
$tests_data = $this->circleCiGetJobTestMetadata($previou_job_number);
106+
$test_paths = $this->circleCiExtractTestPaths($tests_data);
107+
$test_paths_str = implode("\n", $test_paths);
108108

109109
// Verify PHPUnit test results.
110-
$this->assertStringContainsString('tests/phpunit/CircleCiConfigTest.php', $testPathsStr, 'Should have CircleCiConfigTest results');
111-
$this->assertStringContainsString('tests/phpunit/Drupal/DatabaseSettingsTest.php', $testPathsStr, 'Should have DatabaseSettingsTest results');
112-
$this->assertStringContainsString('tests/phpunit/Drupal/EnvironmentSettingsTest.php', $testPathsStr, 'Should have EnvironmentSettingsTest results');
113-
$this->assertStringContainsString('tests/phpunit/Drupal/SwitchableSettingsTest.php', $testPathsStr, 'Should have SwitchableSettingsTest results');
114-
$this->assertStringContainsString('web/modules/custom/ys_base/tests/src/Functional/ExampleTest.php', $testPathsStr, 'Should have custom module Functional test results');
115-
$this->assertStringContainsString('web/modules/custom/ys_base/tests/src/Kernel/ExampleTest.php', $testPathsStr, 'Should have custom module Kernel test results');
116-
$this->assertStringContainsString('web/modules/custom/ys_base/tests/src/Unit/ExampleTest.php', $testPathsStr, 'Should have custom module Unit test results');
110+
$this->assertStringContainsString('tests/phpunit/CircleCiConfigTest.php', $test_paths_str, 'Should have CircleCiConfigTest results');
111+
$this->assertStringContainsString('tests/phpunit/Drupal/DatabaseSettingsTest.php', $test_paths_str, 'Should have DatabaseSettingsTest results');
112+
$this->assertStringContainsString('tests/phpunit/Drupal/EnvironmentSettingsTest.php', $test_paths_str, 'Should have EnvironmentSettingsTest results');
113+
$this->assertStringContainsString('tests/phpunit/Drupal/SwitchableSettingsTest.php', $test_paths_str, 'Should have SwitchableSettingsTest results');
114+
$this->assertStringContainsString('web/modules/custom/ys_base/tests/src/Functional/ExampleTest.php', $test_paths_str, 'Should have custom module Functional test results');
115+
$this->assertStringContainsString('web/modules/custom/ys_base/tests/src/Kernel/ExampleTest.php', $test_paths_str, 'Should have custom module Kernel test results');
116+
$this->assertStringContainsString('web/modules/custom/ys_base/tests/src/Unit/ExampleTest.php', $test_paths_str, 'Should have custom module Unit test results');
117117

118118
// Verify Behat test results.
119-
$this->assertStringContainsString('homepage.feature', $testPathsStr, 'Should have homepage.feature results');
120-
$this->assertStringContainsString('login.feature', $testPathsStr, 'Should have login.feature results');
121-
$this->assertStringContainsString('clamav.feature', $testPathsStr, 'Should have clamav.feature results');
122-
$this->assertStringContainsString('search.feature', $testPathsStr, 'Should have search.feature results');
119+
$this->assertStringContainsString('homepage.feature', $test_paths_str, 'Should have homepage.feature results');
120+
$this->assertStringContainsString('login.feature', $test_paths_str, 'Should have login.feature results');
121+
$this->assertStringContainsString('clamav.feature', $test_paths_str, 'Should have clamav.feature results');
122+
$this->assertStringContainsString('search.feature', $test_paths_str, 'Should have search.feature results');
123123
}
124124
}
125125

0 commit comments

Comments
 (0)