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).
master
Boban Blaskovic 2026-05-31 22:47:34 +02:00
parent 21c2f8a63a
commit bb0e07ca47
3 changed files with 52 additions and 3 deletions

25
app/.env.testing Normal file
View File

@ -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

View File

@ -588,8 +588,8 @@
box-shadow: inset 0 1px 0 rgba(255,255,255,0.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 { 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::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: """; color: var(--color-accent); 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-quote-author { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.clu-avatar { .clu-avatar {
width: 32px; height: 32px; width: 32px; height: 32px;

View File

@ -6,5 +6,29 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends 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,
],
]);
}
} }