Skip to content

Commit 9b3eb5b

Browse files
Allow usage with Symfony 7 (#46)
1 parent 25623d8 commit 9b3eb5b

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

.github/workflows/ci.yaml

+2-4
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
php: ['8.0', '8.1']
38+
php: ['8.0', '8.1', '8.2', '8.3']
3939
steps:
4040
- name: Setup PHP
4141
uses: shivammathur/setup-php@v2
4242
with:
4343
php-version: ${{ matrix.php }}
4444
extensions: json
45-
tools: prestissimo
4645
coverage: none
4746

4847
- name: Checkout
@@ -61,14 +60,13 @@ jobs:
6160
strategy:
6261
fail-fast: false
6362
matrix:
64-
php: ['8.0', '8.1']
63+
php: ['8.0', '8.1', '8.2', '8.3']
6564
steps:
6665
- name: Setup PHP
6766
uses: shivammathur/setup-php@v2
6867
with:
6968
php-version: ${{ matrix.php }}
7069
extensions: json
71-
tools: prestissimo
7270
coverage: none
7371

7472
- name: Checkout

composer.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@
1111
],
1212
"require": {
1313
"php": "^8.0",
14-
"symfony/lock": "^6.0",
15-
"symfony/cache": "^6.0",
16-
"symfony/http-foundation": "^6.0",
17-
"symfony/http-kernel": "^6.0",
18-
"symfony/options-resolver": "^6.0"
14+
"symfony/lock": "^6.0 || ^7.0",
15+
"symfony/cache": "^6.0 || ^7.0",
16+
"symfony/http-foundation": "^6.0 || ^7.0",
17+
"symfony/http-kernel": "^6.0 || ^7.0",
18+
"symfony/options-resolver": "^6.0 || ^7.0"
1919
},
2020
"require-dev": {
21-
"symfony/phpunit-bridge": "^6.0"
21+
"symfony/phpunit-bridge": "^6.0 || ^7.0"
2222
},
2323
"autoload": {
2424
"psr-4": {
2525
"Toflar\\Psr6HttpCacheStore\\": "src"
2626
}
27-
}
27+
},
28+
"minimum-stability": "dev"
2829
}

tests/Psr6StoreTest.php

+6-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
use Symfony\Component\HttpFoundation\Response;
2929
use Symfony\Component\Lock\Exception\LockReleasingException;
3030
use Symfony\Component\Lock\LockFactory;
31-
use Symfony\Component\Lock\LockInterface;
31+
use Symfony\Component\Lock\SharedLockInterface;
3232
use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
3333

3434
class Psr6StoreTest extends TestCase
@@ -661,15 +661,14 @@ public function testAutoPruneExpiredEntries(): void
661661
->expects($this->exactly(3))
662662
->method('prune');
663663

664-
$lock = $this->createMock(LockInterface::class);
664+
$lock = $this->createMock(SharedLockInterface::class);
665665
$lock
666666
->expects($this->exactly(3))
667667
->method('acquire')
668668
->willReturn(true);
669669
$lock
670670
->expects($this->exactly(3))
671-
->method('release')
672-
->willReturn(true);
671+
->method('release');
673672

674673
$lockFactory = $this->createMock(LockFactory::class);
675674
$lockFactory
@@ -734,7 +733,7 @@ public function testAutoPruneIsSkippedIfPruningIsAlreadyInProgress(): void
734733
->expects($this->never())
735734
->method('prune');
736735

737-
$lock = $this->createMock(LockInterface::class);
736+
$lock = $this->createMock(SharedLockInterface::class);
738737
$lock
739738
->expects($this->exactly(3))
740739
->method('acquire')
@@ -777,7 +776,7 @@ public function testItFailsWithoutCacheDirectoryForLockStore(): void
777776

778777
public function testUnlockReturnsFalseOnLockReleasingException(): void
779778
{
780-
$lock = $this->createMock(LockInterface::class);
779+
$lock = $this->createMock(SharedLockInterface::class);
781780
$lock
782781
->expects($this->once())
783782
->method('release')
@@ -802,7 +801,7 @@ public function testUnlockReturnsFalseOnLockReleasingException(): void
802801

803802
public function testLockReleasingExceptionIsIgnoredOnCleanup(): void
804803
{
805-
$lock = $this->createMock(LockInterface::class);
804+
$lock = $this->createMock(SharedLockInterface::class);
806805
$lock
807806
->expects($this->once())
808807
->method('release')

0 commit comments

Comments
 (0)