Skip to content

Commit

Permalink
Preparatory work to add a silent response
Browse files Browse the repository at this point in the history
Update PHPUnit to version 10 and fix all deprecations of phpunit and php-cs-fixer
  • Loading branch information
Dropelikeit committed Aug 24, 2023
1 parent 9515f84 commit 43d683d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
'array_indentation' => true,
'array_syntax' => ['syntax'=>'short'],
'blank_line_before_statement' => true,
'braces' => false,
'single_space_around_construct' => false,
'cast_spaces' => true,
'concat_space' => ['spacing'=>'one'],
'declare_equal_normalize' => true,
'dir_constant' => true,
'function_typehint_space' => true,
'type_declaration_spaces' => true,
'include' => true,
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
Expand Down Expand Up @@ -56,7 +56,7 @@
'return_type_declaration' => true,
'short_scalar_cast' => true,
'simplified_null_return' => true,
'single_blank_line_before_namespace' => true,
'blank_lines_before_namespace' => true,
'single_quote' => true,
'standardize_not_equals' => true,
'strict_comparison' => true,
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"illuminate/http": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0",
"illuminate/contracts": "^9.0|^10.0",
"jms/serializer": "^3.23"
"jms/serializer": "^3.27"
},
"autoload": {
"psr-4": {
Expand All @@ -37,14 +37,14 @@
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"friendsofphp/php-cs-fixer": "^3.16",
"phpunit/phpunit": "^9.6",
"nunomaduro/larastan": "^2.5",
"orchestra/testbench": "^7.24",
"friendsofphp/php-cs-fixer": "^3.23",
"phpunit/phpunit": "^10.3",
"nunomaduro/larastan": "^2.6",
"orchestra/testbench": "^8.9",
"phpstan/phpstan-phpunit": "^1.3",
"php-parallel-lint/php-parallel-lint": "^1.3",
"symfony/cache": "^6.2",
"vimeo/psalm": "^5.9",
"symfony/cache": "^6.3",
"vimeo/psalm": "^5.15",
"psalm/plugin-laravel": "^2.8",
"psalm/plugin-phpunit": "^0.18.4"
},
Expand Down
20 changes: 11 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" backupGlobals="false" beStrictAboutCoversAnnotation="true" beStrictAboutOutputDuringTests="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutTodoAnnotatedTests="true" verbose="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" bootstrap="vendor/autoload.php" backupGlobals="false" beStrictAboutOutputDuringTests="true" beStrictAboutTestsThatDoNotTestAnything="true" cacheDirectory=".phpunit.cache" beStrictAboutCoverageMetadata="true">
<coverage>
<report>
<clover outputFile="build/output/tests/coverage.xml"/>
<text outputFile="php://stdout" showUncoveredFiles="false"/>
Expand All @@ -16,4 +9,13 @@
<testsuite name="Laravel-JMS-Serializer">
<directory suffix="Test.php">tests</directory>
</testsuite>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion tests/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function canCreateConfig(array $config, bool $throwMissingException, bool
/**
* @return array<string, array<int, mixed>>
*/
public function dataProviderCanCreateConfig(): array
public static function dataProviderCanCreateConfig(): array
{
return [
'success' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Http/Responses/ResponseFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function canSerializeWithSerializeType(string $changeSerializeTypeTo, str
* @return array<string, array<int, string>>
* @psalm-return array{with_json: array<int, string>, 'with_xml': array<int, string>}
*/
public function dataProviderCanSerializeWithSerializeType(): array
public static function dataProviderCanSerializeWithSerializeType(): array
{
return [
'with_json' => [
Expand Down
17 changes: 1 addition & 16 deletions tests/ServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
namespace Dropelikeit\LaravelJmsSerializer\Tests;

use Dropelikeit\LaravelJmsSerializer\Config\Config;
use Dropelikeit\LaravelJmsSerializer\Contracts\ResponseBuilder;
use Dropelikeit\LaravelJmsSerializer\Http\Responses\ResponseFactory;
use Dropelikeit\LaravelJmsSerializer\Serializer\Factory;
use Dropelikeit\LaravelJmsSerializer\ServiceProvider;
Expand Down Expand Up @@ -57,14 +56,6 @@ public function canRegister(): void
$this->configRepository
->expects(self::exactly(6))
->method('get')
->withConsecutive(
['laravel-jms-serializer', []],
['laravel-jms-serializer.serialize_null', true],
['laravel-jms-serializer.serialize_type', 'json'],
['laravel-jms-serializer.debug', false],
['laravel-jms-serializer.add_default_handlers', true],
['laravel-jms-serializer.custom_handlers', []],
)
->willReturnOnConsecutiveCalls([], true, 'json', false, true, []);

$this->application
Expand Down Expand Up @@ -106,13 +97,7 @@ public function canRegister(): void

$this->application
->expects(self::exactly(2))
->method('bind')
->withConsecutive(
[ResponseBuilder::class, ResponseFactory::class],
['ResponseFactory', static function ($app): ResponseFactory {
return $app->get(ResponseFactory::class);
}]
);
->method('bind');

$provider = new ServiceProvider($this->application);

Expand Down

0 comments on commit 43d683d

Please sign in to comment.