Skip to content

Commit f8b6b27

Browse files
committed
Fix: tests
1 parent 0244cc1 commit f8b6b27

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

.husky/pre-commit

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
#echo "🔍 Running PHPStan..."
5-
#php vendor/bin/phpstan analyse -l 5 src/ tests/ || exit 1
6-
#
7-
#echo "📏 Running PHPMD..."
8-
#php vendor/bin/phpmd src/ text vendor/phplist/core/config/PHPMD/rules.xml || exit 1
9-
#
10-
#echo "🧹 Running PHPCS..."
11-
#php vendor/bin/phpcs --standard=vendor/phplist/core/config/PhpCodeSniffer/ src/ tests/ || exit 1
4+
echo "🔍 Running PHPStan..."
5+
php vendor/bin/phpstan analyse -l 5 src/ tests/ || exit 1
6+
7+
echo "📏 Running PHPMD..."
8+
php vendor/bin/phpmd src/ text vendor/phplist/core/config/PHPMD/rules.xml || exit 1
9+
10+
echo "🧹 Running PHPCS..."
11+
php vendor/bin/phpcs --standard=vendor/phplist/core/config/PhpCodeSniffer/ src/ tests/ || exit 1

tests/Integration/Auth/LoginTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public function testLoginPageFormFieldsAreVisible(): void
3434
$this->assertSelectorTextContains('label[for="password"]', 'Password');
3535
$this->assertSelectorExists('button[type="submit"]');
3636
$this->assertSelectorTextContains('button[type="submit"]', 'Sign In');
37-
$this->assertSelectorExists('.login-container');
38-
$this->assertSelectorExists('#vue-app');
3937

4038
$this->assertSelectorTextContains('h4', 'Sign in to your account');
4139
}
@@ -54,6 +52,6 @@ public function testLoginFormSubmission(): void
5452
]);
5553

5654
$this->assertPageTitleContains('Login');
57-
$this->assertSelectorExists('.alert.alert-danger');
55+
$this->assertSelectorExists('.bg-red-50.border-red-200.text-red-600');
5856
}
5957
}

tests/System/ApplicationBundle/PhpListApplicationBundleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testHomepageReturnsSuccess(): void
4141

4242
self::assertSame(200, $response->getStatusCode());
4343
self::assertStringContainsString(
44-
'This page has been intentionally left empty.',
44+
'Access is restricted to authorised administrators only.',
4545
$response->getBody()->getContents()
4646
);
4747
}

tests/Unit/Controller/AuthControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function testLoginWithPostRequestSuccess(): void
125125
$response = $this->controller->login($request);
126126

127127
$this->assertInstanceOf(RedirectResponse::class, $response);
128-
$this->assertStringContainsString('empty_start_page', $response->getTargetUrl());
128+
$this->assertStringContainsString('mocked-route-to-home', $response->getTargetUrl());
129129
}
130130

131131
public function testLoginWithPostRequestFailure(): void
@@ -172,7 +172,7 @@ public function testLoginWithExistingSession(): void
172172
$response = $this->controller->login($request);
173173

174174
$this->assertInstanceOf(RedirectResponse::class, $response);
175-
$this->assertStringContainsString('empty_start_page', $response->getTargetUrl());
175+
$this->assertStringContainsString('/', $response->getTargetUrl());
176176
}
177177

178178
public function testLogout(): void

0 commit comments

Comments
 (0)