feat: upgrade PHPUnit

This commit is contained in:
Phan An 2024-04-18 21:27:20 +02:00
parent 5de0bfde0d
commit 971f184e65
9 changed files with 343 additions and 455 deletions

View file

@ -12,7 +12,7 @@
"php": ">=8.1",
"laravel/framework": "^10.0",
"james-heinrich/getid3": "^1.9",
"guzzlehttp/guzzle": "^7.0.1",
"guzzlehttp/guzzle": "^7.2",
"pusher/pusher-php-server": "^7.0",
"predis/predis": "~1.0",
"jackiedo/dotenv-editor": "^2.1",
@ -29,9 +29,8 @@
"teamtnt/laravel-scout-tntsearch-driver": "^14.0",
"algolia/algoliasearch-client-php": "^3.3",
"webmozart/assert": "^1.10",
"laravel/sanctum": "^3.2",
"laravel/sanctum": "^3.3",
"laravel/scout": "^10.0",
"nunomaduro/collision": "^6.2",
"jwilsson/spotify-web-api-php": "^5.2",
"meilisearch/meilisearch-php": "^0.24.0",
"http-interop/http-factory-guzzle": "^1.2",
@ -40,13 +39,14 @@
"saloonphp/saloon": "^3.8",
"saloonphp/laravel-plugin": "^3.0",
"laravel/socialite": "^5.12",
"laravel/ui": "^4.5"
"laravel/ui": "^4.5",
"nunomaduro/collision": "^7.10"
},
"require-dev": {
"mockery/mockery": "~1.0",
"phpunit/phpunit": "^9.0",
"phpunit/phpunit": "^10.1",
"php-mock/php-mock-mockery": "^1.3",
"dms/phpunit-arraysubset-asserts": "^0.2.1",
"dms/phpunit-arraysubset-asserts": "^0.5.0",
"fakerphp/faker": "^1.13",
"slevomat/coding-standard": "^7.0",
"laravel/tinker": "^2.9",

670
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,54 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="bootstrap/autoload.php" colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app/</directory>
</include>
<exclude>
<directory>./app/Console</directory>
<directory>./app/Events</directory>
<directory>./app/Exceptions</directory>
<directory>./app/Facades</directory>
<directory>./app/Http/Requests</directory>
<directory>./app/Models</directory>
<directory>./app/Policies</directory>
<directory>./app/Providers</directory>
<directory>./app/Repositories</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
<testsuite name="unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="integration">
<directory suffix="Test.php">./tests/Integration</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_URL" value="http://localhost/"/>
<env name="APP_KEY" value="16efa6c23c2e8c705826b0e66778fbe7"/>
<env name="STORAGE_DRIVER" value="local"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SCOUT_DRIVER" value="tntsearch"/> <!-- "database" driver doesn't support SQLite -->
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="LASTFM_API_KEY" value="foo"/>
<env name="LASTFM_API_SECRET" value="bar"/>
<env name="SPOTIFY_CLIENT_ID" value=""/>
<env name="SPOTIFY_CLIENT_SECRET" value=""/> <!-- Spotify integration during tests must be opt-in -->
<env name="YOUTUBE_API_KEY" value="foo"/>
<env name="BROADCAST_DRIVER" value="log"/>
<env name="CACHE_MEDIA" value="true"/>
<env name="MAIL_MAILER" value="log"/>
<ini name="memory_limit" value="1024M"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="bootstrap/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
<testsuite name="unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="integration">
<directory suffix="Test.php">./tests/Integration</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_URL" value="http://localhost/"/>
<env name="APP_KEY" value="16efa6c23c2e8c705826b0e66778fbe7"/>
<env name="STORAGE_DRIVER" value="local"/>
<env name="CACHE_DRIVER" value="array"/>
<!-- "database" driver doesn't support SQLite -->
<env name="SCOUT_DRIVER" value="tntsearch"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="LASTFM_API_KEY" value="foo"/>
<env name="LASTFM_API_SECRET" value="bar"/>
<!-- Spotify integration during tests must be opt-in -->
<env name="SPOTIFY_CLIENT_ID" value=""/>
<env name="SPOTIFY_CLIENT_SECRET" value=""/>
<env name="YOUTUBE_API_KEY" value="foo"/>
<env name="BROADCAST_DRIVER" value="log"/>
<env name="CACHE_MEDIA" value="true"/>
<env name="MAIL_MAILER" value="log"/>
<ini name="memory_limit" value="1024M"/>
</php>
<source>
<include>
<directory suffix=".php">./app/</directory>
</include>
<exclude>
<directory>./app/Console</directory>
<directory>./app/Events</directory>
<directory>./app/Exceptions</directory>
<directory>./app/Facades</directory>
<directory>./app/Http/Requests</directory>
<directory>./app/Models</directory>
<directory>./app/Policies</directory>
<directory>./app/Providers</directory>
<directory>./app/Repositories</directory>
</exclude>
</source>
</phpunit>

View file

@ -20,7 +20,7 @@ class AlbumThumbnailTest extends TestCase
}
/** @return array<mixed> */
public function provideAlbumThumbnailData(): array
public static function provideAlbumThumbnailData(): array
{
return [['http://localhost/img/covers/foo_thumbnail.jpg'], [null]];
}

View file

@ -170,7 +170,7 @@ class LastfmServiceTest extends TestCase
}
/** @return array<mixed> */
public function provideToggleLoveTrackData(): array
public static function provideToggleLoveTrackData(): array
{
return [[true, 'track.love'], [false, 'track.unlove']];
}

View file

@ -69,7 +69,7 @@ class StreamerTest extends TestCase
}
/** @return array<mixed> */
public function provideStreamConfigData(): array
public static function provideStreamConfigData(): array
{
return [
PhpStreamerAdapter::class => [null, PhpStreamerAdapter::class],

View file

@ -30,7 +30,7 @@ class AlbumTest extends TestCase
}
/** @return array<mixed> */
public function provideEmptyAlbumNames(): array
public static function provideEmptyAlbumNames(): array
{
return [
[''],

View file

@ -25,7 +25,7 @@ class ArtistTest extends TestCase
}
/** @return array<mixed> */
public function provideEmptyNames(): array
public static function provideEmptyNames(): array
{
return [
[''],

View file

@ -9,7 +9,7 @@ use Throwable;
class ValidSmartPlaylistRulePayloadTest extends TestCase
{
/** @return array<mixed> */
public function provideInvalidPayloads(): array
public static function provideInvalidPayloads(): array
{
return [
'invalid format' => ['foo'],
@ -99,7 +99,7 @@ class ValidSmartPlaylistRulePayloadTest extends TestCase
}
/** @return array<mixed> */
public function provideValidPayloads(): array
public static function provideValidPayloads(): array
{
return [
'one rule' => [