Skip to content

Commit

Permalink
Updated PHP compatibilit version range for ^7.4|^8.0 (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
yann-eugone authored May 10, 2021
1 parent e0f559c commit f9111f2
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 35 deletions.
29 changes: 10 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
strategy:
matrix:
include:
- php-version: 7.1
symfony-version: 4.4.*
- php-version: 7.4
symfony-version: 4.4.*
- php-version: 7.2
symfony-version: 5.2.*
- php-version: 8.0
symfony-version: 4.4.*
- php-version: 7.4
symfony-version: 5.2.*
- php-version: 8.0
symfony-version: 5.2.*

steps:
- name: "Checkout"
Expand All @@ -48,8 +48,7 @@ jobs:
strategy:
matrix:
include:
- php-version: 7.4
symfony-version: 4.4.*
- php-version: 8.0

steps:
- name: "Checkout"
Expand All @@ -62,9 +61,7 @@ jobs:
php-version: ${{ matrix.php-version }}

- name: "Install dependencies with composer"
run: |
composer require --no-update "symfony/framework-bundle:${{ matrix.symfony-version }}"
composer update --no-interaction --no-progress --no-suggest
run: composer update --no-interaction --no-progress --no-suggest

- name: "Run static analyzis with phpstan/phpstan"
run: vendor/bin/phpstan analyze
Expand All @@ -76,8 +73,7 @@ jobs:
strategy:
matrix:
include:
- php-version: 7.4
symfony-version: 4.4.*
- php-version: 8.0

steps:
- name: "Checkout"
Expand All @@ -90,9 +86,7 @@ jobs:
php-version: ${{ matrix.php-version }}

- name: "Install dependencies with composer"
run: |
composer require --no-update "symfony/framework-bundle:${{ matrix.symfony-version }}"
composer update --no-interaction --no-progress --no-suggest
run: composer update --no-interaction --no-progress --no-suggest

- name: "Run checkstyle with squizlabs/php_codesniffer"
run: vendor/bin/phpcs
Expand All @@ -104,8 +98,7 @@ jobs:
strategy:
matrix:
include:
- php-version: 7.4
symfony-version: 4.4.*
- php-version: 8.0

steps:
- name: "Checkout"
Expand All @@ -118,9 +111,7 @@ jobs:
php-version: ${{ matrix.php-version }}

- name: "Install dependencies with composer"
run: |
composer require --no-update "symfony/framework-bundle:${{ matrix.symfony-version }}"
composer update --no-interaction --no-progress --no-suggest
run: composer update --no-interaction --no-progress --no-suggest

- name: "Run tests with phpunit/phpunit"
env:
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
}
],
"require": {
"php": "^7.1.3",
"php": "^7.4|^8.0",
"ext-openssl": "*",
"symfony/framework-bundle": "^4.4|^5.0",
"doctrine/orm": "^2.7",
"doctrine/doctrine-bundle": "^2.0",
"yokai/dependency-injection": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0",
"symfony/yaml": "^4.4|^5.0",
"phpstan/phpstan": "^0.12.80",
"squizlabs/php_codesniffer": "^3.5"
"phpunit/phpunit": "^9.5",
"phpspec/prophecy-phpunit": "^2.0",
"symfony/yaml": "^4.4|^5.2",
"phpstan/phpstan": "^0.12",
"squizlabs/php_codesniffer": "^3.6"
},
"autoload": {
"psr-4": { "Yokai\\SecurityTokenBundle\\": "src/" }
Expand Down
19 changes: 8 additions & 11 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
colors="true"
bootstrap="vendor/autoload.php"
>

bootstrap="vendor/autoload.php">
<php>
<server name="KERNEL_CLASS" value="Yokai\SecurityTokenBundle\Tests\Kernel"/>
</php>

<testsuites>
<testsuite name="YokaiSecurityTokenBundle Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>./src</directory>
</whitelist>
</filter>
</include>
</coverage>
</phpunit>
3 changes: 3 additions & 0 deletions tests/Command/ArchiveTokenCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Yokai\SecurityTokenBundle\Tests\Command;

use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
Expand All @@ -18,6 +19,8 @@
*/
class ArchiveTokenCommandTest extends KernelTestCase
{
use ProphecyTrait;

/**
* @var ArchivistInterface|ObjectProphecy
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/DependencyInjection/DependencyInjectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
use Generator;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ProphecySubjectInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Config\FileLocator;
Expand Down Expand Up @@ -37,6 +38,8 @@
*/
class DependencyInjectionTest extends TestCase
{
use ProphecyTrait;

/**
* @var ContainerBuilder
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/Factory/TokenFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use DateTime;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Yokai\SecurityTokenBundle\Configuration\TokenConfiguration;
use Yokai\SecurityTokenBundle\Configuration\TokenConfigurationRegistry;
Expand All @@ -23,6 +24,8 @@
*/
class TokenFactoryTest extends TestCase
{
use ProphecyTrait;

/**
* @var InformationGuesserInterface|ObjectProphecy
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/Manager/ChainUserManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Yokai\SecurityTokenBundle\Manager\ChainUserManager;
use Yokai\SecurityTokenBundle\Manager\UserManagerInterface;
Expand All @@ -20,6 +21,8 @@
*/
class ChainUserManagerTest extends TestCase
{
use ProphecyTrait;

private function manager($managers): ChainUserManager
{
return new ChainUserManager($managers);
Expand Down
3 changes: 3 additions & 0 deletions tests/Manager/DoctrineUserManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Doctrine\Persistence\Mapping\ClassMetadata;
use Doctrine\Persistence\ObjectManager;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Yokai\SecurityTokenBundle\Manager\DoctrineUserManager;

Expand All @@ -19,6 +20,8 @@
*/
class DoctrineUserManagerTest extends TestCase
{
use ProphecyTrait;

/**
* @var ManagerRegistry|ObjectProphecy
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/Manager/TokenManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Yokai\SecurityTokenBundle\Entity\Token;
Expand Down Expand Up @@ -35,6 +36,8 @@
*/
class TokenManagerTest extends TestCase
{
use ProphecyTrait;

/**
* @var TokenFactoryInterface|ObjectProphecy
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/Repository/DoctrineORMTokenRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Yokai\SecurityTokenBundle\Entity\Token;
use Yokai\SecurityTokenBundle\Exception\TokenConsumedException;
Expand All @@ -21,6 +22,8 @@
*/
class DoctrineORMTokenRepositoryTest extends TestCase
{
use ProphecyTrait;

/**
* @var EntityManager|ObjectProphecy
*/
Expand Down

0 comments on commit f9111f2

Please sign in to comment.