Skip to content

Commit ad40782

Browse files
committed
fix(ci): resolve PHPCS, PHPUnit, and Vitest failures
- Fix PSR-12 indentation in Home/Views/index.php and blank line in starter_vocab.php - Update settings tests to match set-theme-dir being user-scoped - Normalize Windows path separators in BookControllerTest - Fix per_page max clamping test to match actual limit of 500 - Add missing Library icon to lucide mocks in 3 test files
1 parent 159fef9 commit ad40782

9 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/Modules/Home/Views/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ class="box has-background-warning-light has-text-centered"
406406
<?php endif; ?>
407407

408408
<?php if ($langcnt > 0) : ?>
409-
<?php renderWordPressLogout($isWordPress, $base); ?>
409+
<?php renderWordPressLogout($isWordPress, $base); ?>
410410
<?php endif; ?>
411411

412412
<!-- Version info -->

src/Modules/Vocabulary/Views/starter_vocab.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
Continue to Text Import
6666
</a>
6767
<?php else : ?>
68-
6968
<!-- Step 1: Choose sources and options -->
7069
<template x-if="step === 'choose'">
7170
<div class="box">

tests/backend/Modules/Admin/Application/UseCases/Settings/GetAllSettingsTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public function getSettingKeysContainsAdminKeys(): void
5555
{
5656
$keys = GetAllSettings::getSettingKeys();
5757
$expectedSubset = [
58-
'set-theme-dir',
5958
'set-max-articles-with-text',
6059
'set-max-articles-without-text',
6160
'set-max-texts-per-feed',

tests/backend/Modules/Admin/UseCases/AdminUseCaseTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public function testSaveAllSettingsAdminKeysAreComplete(): void
4949
$this->assertNotEmpty($keys);
5050

5151
// Verify admin-scoped settings are present
52-
$this->assertContains('set-theme-dir', $keys);
5352
$this->assertContains('set-max-articles-with-text', $keys);
5453
$this->assertContains('set-allow-registration', $keys);
5554

@@ -73,7 +72,6 @@ public function testUserKeysContainUserPreferences(): void
7372
$this->assertContains('set-regex-mode', $keys);
7473

7574
// Verify admin settings are NOT present
76-
$this->assertNotContains('set-theme-dir', $keys);
7775
$this->assertNotContains('set-allow-registration', $keys);
7876
}
7977

tests/backend/Modules/Book/Http/BookControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public function viewPathPointsToModuleViews(): void
6565
$reflection->setAccessible(true);
6666

6767
$viewPath = $reflection->getValue($this->controller);
68-
$this->assertStringContainsString('Book/Http/../Views/', $viewPath);
68+
$normalizedPath = str_replace('\\', '/', $viewPath);
69+
$this->assertStringContainsString('Book/Http/../Views/', $normalizedPath);
6970
}
7071

7172
// =========================================================================

tests/backend/Modules/Vocabulary/Http/WordListApiHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ public function testGetWordListClampsPerPageToRange(): void
109109
$this->assertEquals(1, $result['pagination']['per_page']);
110110

111111
// Test maximum clamping
112-
$result = $this->handler->getWordList(['per_page' => '200']);
113-
$this->assertEquals(100, $result['pagination']['per_page']);
112+
$result = $this->handler->getWordList(['per_page' => '600']);
113+
$this->assertEquals(500, $result['pagination']['per_page']);
114114
}
115115

116116
public function testGetWordListClampsSortToRange(): void

tests/frontend/texts/text_print.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ vi.mock('lucide', () => ({
127127
Key: ['svg', {}, []],
128128
Languages: ['svg', {}, []],
129129
Layers: ['svg', {}, []],
130+
Library: ['svg', {}, []],
130131
Lightbulb: ['svg', {}, []],
131132
LightbulbOff: ['svg', {}, []],
132133
Link: ['svg', {}, []],

tests/frontend/ui/lucide_icons.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ vi.mock('lucide', () => ({
7474
Key: ['svg', {}, []],
7575
Languages: ['svg', {}, []],
7676
Layers: ['svg', {}, []],
77+
Library: ['svg', {}, []],
7778
Lightbulb: ['svg', {}, []],
7879
LightbulbOff: ['svg', {}, []],
7980
Link: ['svg', {}, []],

tests/frontend/words/word_list_app.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ vi.mock('lucide', () => ({
8686
Key: ['svg', {}, []],
8787
Languages: ['svg', {}, []],
8888
Layers: ['svg', {}, []],
89+
Library: ['svg', {}, []],
8990
Lightbulb: ['svg', {}, []],
9091
LightbulbOff: ['svg', {}, []],
9192
Link: ['svg', {}, []],

0 commit comments

Comments
 (0)