From bb0e07ca47bc2b711ec5f1a51a7aeb8134fd025c Mon Sep 17 00:00:00 2001 From: Boban Blaskovic Date: Sun, 31 May 2026 22:47:34 +0200 Subject: [PATCH] Fix tailwind build + test-DB isolation - app.css: CSS quote chars in .clu-quote-text::before/::after were literal smart quotes which broke as terminating string delimiters in the tailwind v4 parser. Use unicode escapes \201E and \201C. - tests/TestCase.php: force DB_CONNECTION=sqlite + :memory: in setUp. phpunit.xml env section was being ignored by pest 3 runner, so RefreshDatabase truncated the real MySQL between turns. - .env.testing for clarity (sqlite memory). --- app/.env.testing | 25 +++++++++++++++++++++++++ app/resources/css/app.css | 4 ++-- app/tests/TestCase.php | 26 +++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 app/.env.testing diff --git a/app/.env.testing b/app/.env.testing new file mode 100644 index 0000000..b225b7e --- /dev/null +++ b/app/.env.testing @@ -0,0 +1,25 @@ +APP_NAME=CluPilot +APP_ENV=testing +APP_KEY=base64:oEEC4rofMfGShU0P7spAjI7HM/064V1ku3Ob42HtIhE= +APP_DEBUG=true +APP_URL=http://localhost + +BCRYPT_ROUNDS=4 + +DB_CONNECTION=sqlite +DB_DATABASE=:memory: + +CACHE_STORE=array +SESSION_DRIVER=array +QUEUE_CONNECTION=sync +MAIL_MAILER=array +BROADCAST_CONNECTION=null + +LOG_CHANNEL=stack +LOG_LEVEL=warning + +REVERB_APP_ID=clupilot +REVERB_APP_KEY=test +REVERB_APP_SECRET=test +REVERB_HOST=127.0.0.1 +REVERB_PORT=8080 diff --git a/app/resources/css/app.css b/app/resources/css/app.css index e00063d..6469768 100644 --- a/app/resources/css/app.css +++ b/app/resources/css/app.css @@ -588,8 +588,8 @@ box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); } .clu-quote-text { font-size: 13.5px; color: var(--color-fg); line-height: 1.55; } - .clu-quote-text::before { content: "„"; color: var(--color-accent); font-size: 24px; line-height: 0; margin-right: 4px; vertical-align: -6px; font-weight: 600; } - .clu-quote-text::after { content: """; color: var(--color-accent); font-weight: 600; } + .clu-quote-text::before { content: "\201E"; color: var(--color-accent); font-size: 24px; line-height: 0; margin-right: 4px; vertical-align: -6px; font-weight: 600; } + .clu-quote-text::after { content: "\201C"; color: var(--color-accent); font-weight: 600; } .clu-quote-author { display: flex; align-items: center; gap: 10px; margin-top: 12px; } .clu-avatar { width: 32px; height: 32px; diff --git a/app/tests/TestCase.php b/app/tests/TestCase.php index fe1ffc2..b9096da 100644 --- a/app/tests/TestCase.php +++ b/app/tests/TestCase.php @@ -6,5 +6,29 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase; abstract class TestCase extends BaseTestCase { - // + protected function setUp(): void + { + // HARD override: never let tests touch the dev MySQL — even if + // phpunit.xml env section is ignored by the runner. + putenv('DB_CONNECTION=sqlite'); + putenv('DB_DATABASE=:memory:'); + $_ENV['DB_CONNECTION'] = 'sqlite'; + $_ENV['DB_DATABASE'] = ':memory:'; + $_SERVER['DB_CONNECTION'] = 'sqlite'; + $_SERVER['DB_DATABASE'] = ':memory:'; + + parent::setUp(); + + // Belt-and-braces: force the resolved config to sqlite memory. + config([ + 'database.default' => 'sqlite', + 'database.connections.sqlite' => [ + 'driver' => 'sqlite', + 'url' => null, + 'database' => ':memory:', + 'prefix' => '', + 'foreign_key_constraints' => true, + ], + ]); + } }