From 8d18a3307271bfd9a2196a4d5bc8d7730e4ef209 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 21 Feb 2026 03:11:50 +1300 Subject: [PATCH] fix: call ensureSharedProject() in all setup methods, not just setupDatabase When setupAttributes/setupIndexes/etc hit the file cache, they return immediately without calling setupDatabase(), so ensureSharedProject() was never called. This left self::$project empty, causing getProject() to create a new project that didn't match the cached database IDs (404s). Co-Authored-By: Claude Opus 4.6 --- tests/e2e/Services/Databases/DatabasesBase.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index fff1d86856..afc5eb42c3 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -110,6 +110,7 @@ trait DatabasesBase */ protected function setupCollection(): array { + $this->ensureSharedProject(); $cacheKey = $this->getCacheKey(); if (!empty(self::$collectionCache[$cacheKey])) { return self::$collectionCache[$cacheKey]; @@ -181,6 +182,7 @@ trait DatabasesBase */ protected function setupAttributes(): array { + $this->ensureSharedProject(); $cacheKey = $this->getCacheKey(); if (!empty(self::$attributesCache[$cacheKey])) { return self::$attributesCache[$cacheKey]; @@ -337,6 +339,7 @@ trait DatabasesBase */ protected function setupIndexes(): array { + $this->ensureSharedProject(); $cacheKey = $this->getCacheKey(); if (!empty(self::$indexesCache[$cacheKey])) { return self::$indexesCache[$cacheKey]; @@ -418,6 +421,7 @@ trait DatabasesBase */ protected function setupDocuments(): array { + $this->ensureSharedProject(); $cacheKey = $this->getCacheKey(); if (!empty(self::$documentsCache[$cacheKey])) { return self::$documentsCache[$cacheKey]; @@ -516,6 +520,7 @@ trait DatabasesBase */ protected function setupOneToOneRelationship(): array { + $this->ensureSharedProject(); $cacheKey = $this->getCacheKey(); if (!empty(self::$oneToOneCache[$cacheKey])) { return self::$oneToOneCache[$cacheKey]; @@ -601,6 +606,7 @@ trait DatabasesBase */ protected function setupOneToManyRelationship(): array { + $this->ensureSharedProject(); $cacheKey = $this->getCacheKey(); if (!empty(self::$oneToManyCache[$cacheKey])) { return self::$oneToManyCache[$cacheKey]; @@ -722,6 +728,7 @@ trait DatabasesBase */ protected function setupFulltextSearchDocuments(): array { + $this->ensureSharedProject(); $cacheKey = $this->getCacheKey(); if (!empty(self::$fulltextDocsCache[$cacheKey])) { return self::$fulltextDocsCache[$cacheKey];