Skip to content

Commit c47da61

Browse files
authored
Merge pull request #15 from stof/bump_min_versions
Drop support for unmaintained versions of Symfony 5 and PHP
2 parents bed6077 + 14539fd commit c47da61

File tree

8 files changed

+41
-33
lines changed

8 files changed

+41
-33
lines changed

.github/workflows/ci.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
push:
55
pull_request:
66

7-
env:
8-
SYMFONY_PHPUNIT_REMOVE: ''
9-
107
jobs:
118
check_composer:
129
name: Check composer.json
@@ -16,7 +13,7 @@ jobs:
1613
- uses: shivammathur/setup-php@v2
1714
with:
1815
coverage: none
19-
php-version: '7.4'
16+
php-version: '8.0'
2017
- run: composer validate --strict --no-check-lock
2118

2219
tests:
@@ -26,15 +23,15 @@ jobs:
2623
strategy:
2724
fail-fast: false
2825
matrix:
29-
php: [ '7.2', '7.3', '7.4', '8.0' ]
26+
php: [ '7.4', '8.0' ]
3027
min_stability: [ '' ]
3128
name_suffix: [ '' ]
3229
composer_flags: [ '' ]
3330
include:
3431
- php: '8.0'
3532
min_stability: 'dev'
3633
name_suffix: ' (dev deps)'
37-
- php: '7.2'
34+
- php: '7.4'
3835
min_stability: ''
3936
name_suffix: ' (lowest deps)'
4037
composer_flags: '--prefer-lowest'
@@ -53,8 +50,5 @@ jobs:
5350
- name: Install dependencies
5451
run: composer update --ansi --no-progress --prefer-dist --no-interaction ${{ matrix.composer_flags }}
5552

56-
- name: Install PHPUnit
57-
run: vendor/bin/simple-phpunit install
58-
5953
- name: Run tests
60-
run: vendor/bin/simple-phpunit -v --colors=always
54+
run: vendor/bin/phpunit -v --colors=always

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/composer.lock
33
/phpunit.xml
44
/vendor/
5+
/.phpunit.result.cache

composer.json

+14-9
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=7.2",
15-
"symfony/asset": "^3.4.36 || ^4.3 || ^5.0",
16-
"symfony/cache": "^3.4.36 || ^4.3 || ^5.0",
17-
"symfony/config": "^3.4.36 || ^4.3 || ^5.0",
18-
"symfony/dependency-injection": "^3.4.36 || ^4.3 || ^5.0",
19-
"symfony/finder": "^3.4.36 || ^4.3 || ^5.0",
20-
"symfony/framework-bundle": "^3.4.36 || ^4.3 || ^5.0",
21-
"symfony/http-kernel": "^3.4.36 || ^4.3 || ^5.0"
14+
"php": ">=7.4",
15+
"symfony/asset": "^3.4.36 || ^4.4.13 || ^5.3",
16+
"symfony/cache": "^3.4.36 || ^4.4.13 || ^5.3",
17+
"symfony/config": "^3.4.36 || ^4.4 || ^5.3",
18+
"symfony/dependency-injection": "^3.4.36 || ^4.4.13 || ^5.3",
19+
"symfony/finder": "^3.4.36 || ^4.4.13 || ^5.3",
20+
"symfony/framework-bundle": "^3.4.36 || ^4.3.13 || ^5.3",
21+
"symfony/http-kernel": "^3.4.36 || ^4.4.13 || ^5.3"
2222
},
2323
"require-dev": {
24-
"symfony/phpunit-bridge": "^5.2"
24+
"phpspec/prophecy-phpunit": "^2.0",
25+
"phpunit/phpunit": "^9.5",
26+
"symfony/phpunit-bridge": "^5.3"
2527
},
2628
"autoload": {
2729
"psr-4": {
@@ -33,6 +35,9 @@
3335
"Incenteev\\HashedAssetBundle\\Tests\\": "tests"
3436
}
3537
},
38+
"config": {
39+
"sort-packages": true
40+
},
3641
"extra": {
3742
"branch-alias": {
3843
"dev-master": "1.x-dev"

phpunit.xml.dist

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit bootstrap="./vendor/autoload.php" colors="true">
4-
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory>./src</directory>
6+
</include>
7+
<exclude>
8+
<directory>./src/Resources</directory>
9+
</exclude>
10+
</coverage>
511
<testsuites>
612
<testsuite name="HashedAssetBundle test suite">
713
<directory suffix="Test.php">./tests</directory>
814
</testsuite>
915
</testsuites>
10-
11-
<filter>
12-
<whitelist>
13-
<directory>./src</directory>
14-
<exclude>
15-
<directory>./src/Resources</directory>
16-
</exclude>
17-
</whitelist>
18-
</filter>
1916
</phpunit>

src/CacheWarmer/HashCacheWarmer.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(AssetFinder $assetFinder, string $cacheFile, AssetHa
3131
$this->fallbackPool = $fallbackPool;
3232
}
3333

34-
public function warmUp($cacheDir)
34+
public function warmUp($cacheDir): array
3535
{
3636
$phpArrayPool = new PhpArrayAdapter($this->cacheFile, $this->fallbackPool);
3737
$arrayPool = new ArrayAdapter(0, false);
@@ -50,6 +50,8 @@ public function warmUp($cacheDir)
5050
$this->fallbackPool->saveDeferred($item->set($v));
5151
}
5252
$this->fallbackPool->commit();
53+
54+
return [];
5355
}
5456

5557
public function isOptional(): bool

tests/Asset/HashingVersionStrategyTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
use Incenteev\HashedAssetBundle\Asset\HashingVersionStrategy;
66
use Incenteev\HashedAssetBundle\Hashing\AssetHasherInterface;
77
use PHPUnit\Framework\TestCase;
8+
use Prophecy\PhpUnit\ProphecyTrait;
89

910
class HashingVersionStrategyTest extends TestCase
1011
{
12+
use ProphecyTrait;
13+
1114
public function testGetVersion()
1215
{
1316
$hasher = $this->prophesize(AssetHasherInterface::class);

tests/CacheWarmer/HashCacheWarmerTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
use Incenteev\HashedAssetBundle\CacheWarmer\HashCacheWarmer;
77
use Incenteev\HashedAssetBundle\Hashing\AssetHasherInterface;
88
use PHPUnit\Framework\TestCase;
9+
use Prophecy\PhpUnit\ProphecyTrait;
910
use Psr\Cache\CacheItemPoolInterface;
1011
use Symfony\Component\Cache\Adapter\ArrayAdapter;
1112
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
1213

1314
class HashCacheWarmerTest extends TestCase
1415
{
16+
use ProphecyTrait;
17+
1518
public function testWarmUp()
1619
{
1720
$hasher = $this->prophesize(AssetHasherInterface::class);
@@ -49,7 +52,7 @@ public function testWarmUp()
4952
$this->assertIsArray($values);
5053
} else {
5154
$this->assertInternalType('array', $values);
52-
}
55+
}
5356
$this->assertCount(2, $values);
5457
$this->assertArrayHasKey(base64_encode('foo'), $values);
5558
$this->assertArrayHasKey(base64_encode('bar/baz.js'), $values);

tests/Hashing/CachedHasherTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
use Incenteev\HashedAssetBundle\Hashing\AssetHasherInterface;
66
use Incenteev\HashedAssetBundle\Hashing\CachedHasher;
77
use PHPUnit\Framework\TestCase;
8+
use Prophecy\PhpUnit\ProphecyTrait;
89
use Symfony\Component\Cache\Adapter\ArrayAdapter;
910

1011
class CachedHasherTest extends TestCase
1112
{
13+
use ProphecyTrait;
14+
1215
public function testComputeHash()
1316
{
1417
$delegateHasher = $this->prophesize(AssetHasherInterface::class);

0 commit comments

Comments
 (0)