Skip to content

Commit 132142b

Browse files
authored
[13.x] Fix changes from Laravel 12 (#57919)
* [13.x] Test Improvements Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> --------- Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 4b099b5 commit 132142b

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

.github/workflows/databases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
coverage: none
181181

182182
- name: Set Framework version
183-
run: composer config version "12.x-dev"
183+
run: composer config version "13.x-dev"
184184

185185
- name: Install dependencies
186186
uses: nick-fields/retry@v3

.github/workflows/redis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ jobs:
3232
- name: Setup PHP
3333
uses: shivammathur/setup-php@v2
3434
with:
35-
php-version: 8.2
35+
php-version: 8.3
3636
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
3737
tools: composer:v2
3838
coverage: none
3939

4040
- name: Set Framework version
41-
run: composer config version "12.x-dev"
41+
run: composer config version "13.x-dev"
4242

4343
- name: Install dependencies
4444
uses: nick-fields/retry@v3
@@ -78,13 +78,13 @@ jobs:
7878
- name: Setup PHP
7979
uses: shivammathur/setup-php@v2
8080
with:
81-
php-version: 8.2
81+
php-version: 8.3
8282
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_mysql, :php-psr
8383
tools: composer:v2
8484
coverage: none
8585

8686
- name: Set Framework version
87-
run: composer config version "12.x-dev"
87+
run: composer config version "13.x-dev"
8888

8989
- name: Install dependencies
9090
uses: nick-fields/retry@v3

src/Illuminate/Cache/FailoverStore.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ public function restoreLock($name, $owner)
141141
return $this->attemptOnAllStores(__FUNCTION__, func_get_args());
142142
}
143143

144+
/**
145+
* Adjust the expiration time of a cached item.
146+
*
147+
* @param string $key
148+
* @param int $seconds
149+
* @return bool
150+
*/
151+
public function touch($key, $seconds)
152+
{
153+
return $this->attemptOnAllStores(__FUNCTION__, func_get_args());
154+
}
155+
144156
/**
145157
* Remove an item from the cache.
146158
*

tests/Integration/Cache/MemoizedStoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
use Throwable;
2424

2525
#[WithConfig('cache.default', 'redis')]
26-
#[WithConfig('cache.prefix', 'laravel_cache_')]
26+
#[WithConfig('cache.prefix', 'laravel-cache-')]
2727
class MemoizedStoreTest extends TestCase
2828
{
2929
use InteractsWithRedis;
@@ -296,7 +296,7 @@ public function test_flush_forgets_memoized_value()
296296

297297
public function test_memoized_driver_uses_underlying_drivers_prefix()
298298
{
299-
$this->assertSame('laravel_cache_', Cache::memo()->getPrefix());
299+
$this->assertSame('laravel-cache-', Cache::memo()->getPrefix());
300300

301301
Cache::driver('redis')->setPrefix('foo');
302302

tests/Integration/Cache/RedisStoreTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
use Illuminate\Support\Sleep;
1111
use Mockery as m;
1212
use Orchestra\Testbench\TestCase;
13+
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
1314
use PHPUnit\Framework\Attributes\TestWith;
1415

16+
#[RequiresPhpExtension('redis')]
1517
class RedisStoreTest extends TestCase
1618
{
1719
use InteractsWithRedis;

0 commit comments

Comments
 (0)