Skip to content

Commit 859841b

Browse files
committed
adjust url based on 14763
1 parent 34bce8b commit 859841b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tests/StaticCaching/HalfMeasureStaticCachingTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Tests\StaticCaching;
44

5-
use Illuminate\Http\Request;
65
use Illuminate\Support\Carbon;
76
use Orchestra\Testbench\Attributes\DefineEnvironment;
87
use PHPUnit\Framework\Attributes\Test;
@@ -140,7 +139,7 @@ public function nocache_session_is_written_under_the_real_url_when_share_errors_
140139
// Regression: when share_errors is enabled, the middleware's copyError()
141140
// step used to call Request::fakeStaticCacheStatus() on every cacheable
142141
// response, including 200s. That mutated the singleton nocache Session
143-
// URL to /__shared-errors/200, causing Session::write() to persist the
142+
// URL to /__shared-errors/sitename/200, causing Session::write() to persist the
144143
// regions list under the wrong cache key. On subsequent hits in a
145144
// fresh PHP process, the cached page was found but its nocache regions
146145
// could not be restored, a RegionNotFound was caught, and the request
@@ -156,14 +155,14 @@ public function nocache_session_is_written_under_the_real_url_when_share_errors_
156155
$this->get('/about')->assertOk();
157156

158157
// The session metadata must be persisted under the real request URL,
159-
// not under the fake /__shared-errors/200 URL.
158+
// not under the fake /__shared-errors/default/200 URL.
160159
$store = \Statamic\Facades\StaticCache::cacheStore();
161160
$this->assertNotNull(
162161
$store->get('nocache::session.'.md5('http://localhost/about')),
163162
'Expected nocache session to be stored under the real request URL.'
164163
);
165164
$this->assertNull(
166-
$store->get('nocache::session.'.md5('/__shared-errors/200')),
165+
$store->get('nocache::session.'.md5('/__shared-errors/default/200')),
167166
'nocache session must not be stored under the shared-errors URL for 200 responses.'
168167
);
169168
}

0 commit comments

Comments
 (0)