Skip to content

Commit 59048a1

Browse files
authored
test: update phpunit (#674)
Fixes deprecations, AbstractQueryProviderTest renamed because Test suffix produces warning in file with no tests
1 parent 23d6c9d commit 59048a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+121
-143
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ website/.cache-loader
2222

2323
.phpunit.result.cache
2424
.phpstan-cache
25+
.phpunit.cache

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"php-coveralls/php-coveralls": "^2.1",
3838
"phpstan/extension-installer": "^1.1",
3939
"phpstan/phpstan": "^1.9",
40-
"phpunit/phpunit": "^8.5.19 || ^9.5.8",
40+
"phpunit/phpunit": "^10.1 || ^11.0",
4141
"symfony/var-dumper": "^5.4 || ^6.0 || ^7",
4242
"thecodingmachine/phpstan-strict-rules": "^1.0"
4343
},

phpunit.xml.dist

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
6-
backupGlobals="false"
7-
backupStaticAttributes="false"
8-
colors="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
12-
processIsolation="false"
13-
stopOnFailure="false"
14-
bootstrap="tests/Bootstrap.php"
15-
>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/Bootstrap.php" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<coverage>
4+
<report>
5+
<clover outputFile="build/logs/clover.xml"/>
6+
<html outputDirectory="build/coverage"/>
7+
</report>
8+
</coverage>
169
<testsuites>
1710
<testsuite name="GraphQLite Test Suite">
1811
<directory>./tests/</directory>
1912
<exclude>./tests/Bootstrap.php</exclude>
2013
</testsuite>
2114
</testsuites>
22-
23-
<filter>
24-
<whitelist processUncoveredFilesFromWhitelist="true">
15+
<logging/>
16+
<source>
17+
<include>
2518
<directory suffix=".php">src/</directory>
26-
</whitelist>
27-
</filter>
28-
<logging>
29-
<log type="coverage-html" target="build/coverage"/>
30-
<log type="coverage-clover" target="build/logs/clover.xml"/>
31-
</logging>
19+
</include>
20+
</source>
3221
</phpunit>

tests/AbstractQueryProviderTest.php renamed to tests/AbstractQueryProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
use TheCodingMachine\GraphQLite\Utils\Namespaces\NamespaceFactory;
5858
use UnitEnum;
5959

60-
abstract class AbstractQueryProviderTest extends TestCase
60+
abstract class AbstractQueryProvider extends TestCase
6161
{
6262
private $testObjectType;
6363
private $testObjectType2;
@@ -455,7 +455,7 @@ protected function getTypeRegistry(): TypeRegistry
455455
return $this->typeRegistry;
456456
}
457457

458-
protected function resolveType(string $type): \phpDocumentor\Reflection\Type
458+
protected static function resolveType(string $type): \phpDocumentor\Reflection\Type
459459
{
460460
return (new PhpDocumentorTypeResolver())->resolve($type);
461461
}

tests/AggregateControllerQueryProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Psr\Container\ContainerInterface;
66
use TheCodingMachine\GraphQLite\Fixtures\TestController;
77

8-
class AggregateControllerQueryProviderTest extends AbstractQueryProviderTest
8+
class AggregateControllerQueryProviderTest extends AbstractQueryProvider
99
{
1010
public function testAggregate(): void
1111
{

tests/Containers/BasicAutoWiringContainerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
namespace TheCodingMachine\GraphQLite\Containers;
66

77
use Psr\Container\ContainerInterface;
8-
use TheCodingMachine\GraphQLite\AbstractQueryProviderTest;
8+
use TheCodingMachine\GraphQLite\AbstractQueryProvider;
99
use TheCodingMachine\GraphQLite\Fixtures\TestType;
1010

11-
class BasicAutoWiringContainerTest extends AbstractQueryProviderTest
11+
class BasicAutoWiringContainerTest extends AbstractQueryProvider
1212
{
1313
private function getContainer(): ContainerInterface
1414
{

tests/Containers/LazyContainerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace TheCodingMachine\GraphQLite\Containers;
66

7-
use TheCodingMachine\GraphQLite\AbstractQueryProviderTest;
7+
use TheCodingMachine\GraphQLite\AbstractQueryProvider;
88
use TheCodingMachine\GraphQLite\Fixtures\TestType;
99

10-
final class LazyContainerTest extends AbstractQueryProviderTest
10+
final class LazyContainerTest extends AbstractQueryProvider
1111
{
1212
private function getContainer(): LazyContainer
1313
{

tests/FactoryContextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use TheCodingMachine\GraphQLite\Containers\EmptyContainer;
88
use TheCodingMachine\GraphQLite\Fixtures\Inputs\Validator;
99

10-
class FactoryContextTest extends AbstractQueryProviderTest
10+
class FactoryContextTest extends AbstractQueryProvider
1111
{
1212
const GLOB_TTL_SECONDS = 2;
1313

tests/FieldsBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
use TheCodingMachine\GraphQLite\Types\DateTimeType;
7575
use TheCodingMachine\GraphQLite\Types\VoidType;
7676

77-
class FieldsBuilderTest extends AbstractQueryProviderTest
77+
class FieldsBuilderTest extends AbstractQueryProvider
7878
{
7979
public function testQueryProvider(): void
8080
{

tests/GlobControllerQueryProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Symfony\Component\Cache\Psr16Cache;
1212
use TheCodingMachine\GraphQLite\Fixtures\TestController;
1313

14-
class GlobControllerQueryProviderTest extends AbstractQueryProviderTest
14+
class GlobControllerQueryProviderTest extends AbstractQueryProvider
1515
{
1616
public function testGlob(): void
1717
{

0 commit comments

Comments
 (0)