Testing kit: reject cached non-test database connections before refresh

オープン
#754 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
laravel, php, postgresql
領域
database, testing

調査の方向性

Start with the base test class Teme\Testing\TemeTestCase and see where it reaches Laravel's RefreshDatabase setup, then check how a cached configuration (bootstrap/cache/config.php) overrides the PHPUnit database settings. Add a regression test where the cached connection differs from the PostgreSQL test target. Done when that test stops before any refresh and the error names the effective and expected database and explains how to clear the config cache. The issue leaves open whether to reject the cache or verify the connection, so confirm the approach in the thread first.

索引モデルが issue の本文から書いたものです。

説明

area/themes type/bug when/soon

A theme test run inherited a Laravel configuration cache that pointed to the normal site database. Although PHPUnit specified the dedicated PostgreSQL test configuration, the values in the cached application configuration took precedence. Teme\Testing\TemeTestCase reached Laravel's RefreshDatabase setup and reset the local site's schema before a test assertion ran.

Expected: the kit rejects a cached configuration or verifies the effective database connection against the configured test target before invoking the database refresh. The error should name the effective database and expected test target and explain how to bypass the config cache for a test run. Add regression coverage for a cache whose database disagrees with PHPUnit.

For the theme verification, bypassing the config cache and explicitly using the dedicated PostgreSQL test database kept subsequent tests isolated.

主要言語
PHP
スター
1
フォーク
1
平均マージ
1時間 40分
マージ済み PR(30日)
143

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

temecms/teme のほかの issue

temecms/teme の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。