Skip to content

Commit

Permalink
Merge pull request #1 from vladdnepr/migrate-to-php8
Browse files Browse the repository at this point in the history
Migrate to 8.1
  • Loading branch information
vladdnepr authored Sep 12, 2022
2 parents 95d3ea9 + 772e0d6 commit 9257fca
Show file tree
Hide file tree
Showing 37 changed files with 124 additions and 148 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/.idea
/bin
/build
/vendor
composer.lock
.phpunit.result.cache
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: php

php:
- '7.1'
- '7.2'
- '8.1'
- nightly

env:
Expand Down
4 changes: 2 additions & 2 deletions .travis/install_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ set -ev
mkdir --parents "${HOME}/bin"

# PHPUnit install
wget "https://phar.phpunit.de/phpunit-7.0.phar" --output-document="${HOME}/bin/phpunit"
wget "https://phar.phpunit.de/phpunit-9.5.phar" --output-document="${HOME}/bin/phpunit"
chmod u+x "${HOME}/bin/phpunit"

# Coveralls client install
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar --output-document="${HOME}/bin/coveralls"
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.2/php-coveralls.phar --output-document="${HOME}/bin/coveralls"
chmod u+x "${HOME}/bin/coveralls"

composer install --dev --prefer-dist
41 changes: 16 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@ GraphQL Test Case

Makes testing your GraphQL queries and mutations easier.

Support for Symfony, Lumen and Laravel.

[![PHP Version](https://img.shields.io/badge/php-%5E7.1-blue.svg)](https://img.shields.io/badge/php-%5E7.1-blue.svg)
[![Latest Stable Version](https://poser.pugx.org/kunicmarko/graphql-test/v/stable)](https://packagist.org/packages/kunicmarko/graphql-test)
[![Latest Unstable Version](https://poser.pugx.org/kunicmarko/graphql-test/v/unstable)](https://packagist.org/packages/kunicmarko/graphql-test)

[![Build Status](https://travis-ci.org/kunicmarko20/graphql-test.svg?branch=master)](https://travis-ci.org/kunicmarko20/graphql-test)
[![Coverage Status](https://coveralls.io/repos/github/kunicmarko20/graphql-test/badge.svg?branch=master)](https://coveralls.io/github/kunicmarko20/graphql-test?branch=master)
Support for Symfony.

Documentation
-------------
Expand All @@ -36,9 +29,7 @@ composer require --dev kunicmarko/graphql-test
Depending on your framework, extend the correct `TestCase`:

```php
use KunicMarko\GraphQLTest\Bridge\Symfony\TestCase;
use KunicMarko\GraphQLTest\Bridge\Lumen\TestCase;
use KunicMarko\GraphQLTest\Bridge\Laravel\TestCase;
use VladDnepr\GraphQLTest\Bridge\Symfony\TestCase;
```

> Everything you see in the next snippets is the same for all Test Cases.
Expand All @@ -53,7 +44,7 @@ public function mutation(MutationInterface $mutation, array $files = [], array $
By default, endpoint is `/graphql`, you can overwrite this by changing variable in your tests:

```php
use KunicMarko\GraphQLTest\Bridge\Symfony\TestCase;
use VladDnepr\GraphQLTest\Bridge\Symfony\TestCase;

class UserTest extends TestCase
{
Expand All @@ -65,7 +56,7 @@ class UserTest extends TestCase
There is a helper method that allows you to preset headers:

```php
use KunicMarko\GraphQLTest\Bridge\Symfony\TestCase;
use VladDnepr\GraphQLTest\Bridge\Symfony\TestCase;

class SettingsTest extends TestCase
{
Expand All @@ -84,8 +75,8 @@ class SettingsTest extends TestCase
### Query

```php
use KunicMarko\GraphQLTest\Bridge\Symfony\TestCase;
use KunicMarko\GraphQLTest\Operation\Query;
use VladDnepr\GraphQLTest\Bridge\Symfony\TestCase;
use VladDnepr\GraphQLTest\Operation\Query;

class SettingsQueryTest extends TestCase
{
Expand Down Expand Up @@ -116,7 +107,7 @@ class SettingsQueryTest extends TestCase
}
```

`KunicMarko\GraphQLTest\Operation\Query` construct accepts 3 arguments:
`VladDnepr\GraphQLTest\Operation\Query` construct accepts 3 arguments:

* name of query (mandatory)
* parameters (optional)
Expand All @@ -125,8 +116,8 @@ class SettingsQueryTest extends TestCase
### Mutation

```php
use KunicMarko\GraphQLTest\Bridge\Symfony\TestCase;
use KunicMarko\GraphQLTest\Operation\Mutation;
use VladDnepr\GraphQLTest\Bridge\Symfony\TestCase;
use VladDnepr\GraphQLTest\Operation\Mutation;

class SettingsMutationTest extends TestCase
{
Expand Down Expand Up @@ -160,7 +151,7 @@ class SettingsMutationTest extends TestCase
}
```

`KunicMarko\GraphQLTest\Operation\Mutation` construct accepts 3 arguments:
`VladDnepr\GraphQLTest\Operation\Mutation` construct accepts 3 arguments:

* name of mutation (mandatory)
* parameters (optional)
Expand All @@ -169,11 +160,11 @@ class SettingsMutationTest extends TestCase
If you have a Enum, Boolean or Array as an argument you can pass it as following:

```php
use KunicMarko\GraphQLTest\Bridge\Symfony\TestCase;
use KunicMarko\GraphQLTest\Operation\Mutation;
use KunicMarko\GraphQLTest\Type\EnumType;
use KunicMarko\GraphQLTest\Type\BooleanType;
use KunicMarko\GraphQLTest\Type\ArrayType;
use VladDnepr\GraphQLTest\Bridge\Symfony\TestCase;
use VladDnepr\GraphQLTest\Operation\Mutation;
use VladDnepr\GraphQLTest\Type\EnumType;
use VladDnepr\GraphQLTest\Type\BooleanType;
use VladDnepr\GraphQLTest\Type\ArrayType;

class UserMutationTest extends TestCase
{
Expand Down Expand Up @@ -203,5 +194,5 @@ class UserMutationTest extends TestCase
}
```

Also, if you need a custom type you can always extend `KunicMarko\GraphQLTest\Type\TypeInterface`
Also, if you need a custom type you can always extend `VladDnepr\GraphQLTest\Type\TypeInterface`
and use your own Type instead.
21 changes: 9 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "kunicmarko/graphql-test",
"name": "vladdnepr/graphql-test",
"type": "library",
"description": "GraphQL Test Cases",
"keywords": [
"graphql",
"graphql-test",
"symfony",
"laravel",
"lumen"
"symfony"
],
"homepage": "https://github.com/kunicmarko20/graphql-test",
"license": "MIT",
Expand All @@ -19,26 +17,25 @@
}
],
"require": {
"php": "^7.1"
"php": "^8.1"
},
"require-dev": {
"laravel/laravel": "^5.6",
"laravel/lumen-framework": "^5.6",
"symfony/browser-kit": "^3.4 || ^4.0 || ^4.1",
"symfony/framework-bundle": "^3.4 || ^4.0 || ^4.1",
"symfony/phpunit-bridge": "^4.0"
"phpspec/prophecy-phpunit": "^2.0",
"symfony/browser-kit": "^5.4|^6.0",
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/phpunit-bridge": "^5.4|^6.0"
},
"config": {
"sort-packages": true
},
"autoload": {
"psr-4": {
"KunicMarko\\GraphQLTest\\": "src/"
"VladDnepr\\GraphQLTest\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"KunicMarko\\GraphQLTest\\Tests\\": "tests/"
"VladDnepr\\GraphQLTest\\Tests\\": "tests/"
}
}
}
28 changes: 18 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<testsuites>
<testsuite name="SonataAnnotationBundle Test Suite">
Expand All @@ -18,15 +19,22 @@
</testsuites>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
<arguments>
<array>
<!-- set this option to 0 to disable the DebugClassLoader integration -->
<!-- https://github.com/sebastianbergmann/phpunit/issues/4002 -->
<element key="debug-class-loader"><integer>0</integer></element>
</array>
</arguments>
</listener>
</listeners>

<filter>
<whitelist>
<coverage>
<include>
<directory>./src/</directory>
<exclude>
<directory>./vendor/</directory>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<directory>./vendor/</directory>
</exclude>
</coverage>
</phpunit>
14 changes: 0 additions & 14 deletions src/Bridge/Laravel/TestCase.php

This file was deleted.

14 changes: 0 additions & 14 deletions src/Bridge/Lumen/TestCase.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Bridge/Symfony/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace KunicMarko\GraphQLTest\Bridge\Symfony;
namespace VladDnepr\GraphQLTest\Bridge\Symfony;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use KunicMarko\GraphQLTest\Bridge\TestCaseTrait;
use VladDnepr\GraphQLTest\Bridge\TestCaseTrait;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
6 changes: 3 additions & 3 deletions src/Bridge/TestCaseTrait.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace KunicMarko\GraphQLTest\Bridge;
namespace VladDnepr\GraphQLTest\Bridge;

use KunicMarko\GraphQLTest\Operation\MutationInterface;
use KunicMarko\GraphQLTest\Operation\QueryInterface;
use VladDnepr\GraphQLTest\Operation\MutationInterface;
use VladDnepr\GraphQLTest\Operation\QueryInterface;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/FieldsFormatter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Formatter;
namespace VladDnepr\GraphQLTest\Formatter;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
4 changes: 2 additions & 2 deletions src/Formatter/Formatter.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace KunicMarko\GraphQLTest\Formatter;
namespace VladDnepr\GraphQLTest\Formatter;

use KunicMarko\GraphQLTest\Type\TypeInterface;
use VladDnepr\GraphQLTest\Type\TypeInterface;
use function is_array;
use function is_string;

Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/FormatterInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Formatter;
namespace VladDnepr\GraphQLTest\Formatter;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/ParametersFormatter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Formatter;
namespace VladDnepr\GraphQLTest\Formatter;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Operation/Mutation.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Operation;
namespace VladDnepr\GraphQLTest\Operation;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Operation/MutationInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Operation;
namespace VladDnepr\GraphQLTest\Operation;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
8 changes: 4 additions & 4 deletions src/Operation/Operation.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace KunicMarko\GraphQLTest\Operation;
namespace VladDnepr\GraphQLTest\Operation;

use KunicMarko\GraphQLTest\Formatter\FieldsFormatter;
use KunicMarko\GraphQLTest\Formatter\FormatterInterface;
use KunicMarko\GraphQLTest\Formatter\ParametersFormatter;
use VladDnepr\GraphQLTest\Formatter\FieldsFormatter;
use VladDnepr\GraphQLTest\Formatter\FormatterInterface;
use VladDnepr\GraphQLTest\Formatter\ParametersFormatter;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Operation/Query.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Operation;
namespace VladDnepr\GraphQLTest\Operation;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Operation/QueryInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Operation;
namespace VladDnepr\GraphQLTest\Operation;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Type/ArrayType.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Type;
namespace VladDnepr\GraphQLTest\Type;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Type/BooleanType.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Type;
namespace VladDnepr\GraphQLTest\Type;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Type/EnumType.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KunicMarko\GraphQLTest\Type;
namespace VladDnepr\GraphQLTest\Type;

/**
* @author Marko Kunic <kunicmarko20@gmail.com>
Expand Down
Loading

0 comments on commit 9257fca

Please sign in to comment.