FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add PHP 8 compatibility by alexander-schranz · Pull Request #45 · php-task/php-task · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .dist  (1) .json  (1) .php  (15) .yaml  (1) .yml  (1) All 5 file types selected
Only manifest files
Deleted files Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
60 changes: 60 additions & 0 deletions .github/workflows/test-application.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: PHP Test

on:
pull_request:
push:
branches:
- 'master'
- '[0-9]+.x'
- '[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.x'

jobs:
test:
name: '${{ matrix.php-version }} ${{ matrix.dependencies }}, Coverage ${{ matrix.coverage }}'
runs-on: ubuntu-20.04
env:
COVERAGE: ${{ matrix.coverage }}

strategy:
fail-fast: false
matrix:
include:
- php-version: '5.6'
dependencies: 'lowest'
- php-version: '5.6'
- php-version: '7.0'
dependencies: 'lowest'
- php-version: '7.0'
dependencies: 'lowest'
- php-version: '7.1'
dependencies: 'lowest'
- php-version: '7.1'
- php-version: '7.4'
coverage: 'true'
- php-version: '8.0'

steps:
- name: Checkout project
uses: actions/checkout@v2

- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: 'composer:v2'

- name: Install dependencies with Composer
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: --prefer-dist --no-suggest

- name: Execute test
run: vendor/bin/simple-phpunit -c phpunit.xml.dist --coverage-clover=coverage.clover

- name: Coverage
if: ${{ matrix.coverage }}
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --access-token="230ec5e01daf5bb3e46ea304fb20348b52d80de73463ec08ee9c96fcd1349e35" --format=php-clover coverage.clover
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions composer.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
}
],
"require": {
"php": "^5.6 || ^7.0",
"doctrine/common": "^2.6",
"ramsey/uuid": "^3.1",
"php": "^5.6 || ^7.0 || ^8.0",
"doctrine/collections": "^1.0",
"ramsey/uuid": "^3.1 || ^4.0",
"symfony/event-dispatcher": "^2.6 || ^3.4 || ^4.0 || ^5.0",
"dragonmantank/cron-expression": "^1.1 || ^2.0 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7.27",
"mikey179/vfsstream": "^1.6.7",
"psr/log": "^1.0"
"psr/log": "^1.0",
"symfony/phpunit-bridge": "^5.2.3"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml.dist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
bootstrap="vendor/autoload.php">
<php>
<ini name="error_reporting" value="-1" />
<env name="SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT" value="1"/>
<env name="SYMFONY_PHPUNIT_REMOVE" value="symfony/yaml"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
</php>

<testsuites>
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Builder/TaskBuilderFactoryTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Task\Tests\Unit\Builder;

use PHPUnit\Framework\TestCase;
use Task\Builder\TaskBuilderFactory;
use Task\Builder\TaskBuilderInterface;
use Task\Scheduler\TaskSchedulerInterface;
Expand All @@ -19,7 +20,7 @@
/**
* Tests for TaskBuilder.
*/
class TaskBuilderFactoryTest extends \PHPUnit_Framework_TestCase
class TaskBuilderFactoryTest extends TestCase
{
public function testCreate()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Builder/TaskBuilderTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
namespace Task\Tests\Unit\Builder;

use Cron\CronExpression;
use PHPUnit\Framework\TestCase;
use Task\Builder\TaskBuilder;
use Task\Scheduler\TaskSchedulerInterface;
use Task\TaskInterface;

/**
* Tests for TaskBuilder.
*/
class TaskBuilderTest extends \PHPUnit_Framework_TestCase
class TaskBuilderTest extends TestCase
{
public function testHourly()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Event/TaskEventTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

namespace Task\Tests\Unit\Event;

use PHPUnit\Framework\TestCase;
use Task\Event\TaskEvent;
use Task\TaskInterface;

/**
* Tests for class TaskEvent.
*/
class TaskEventTest extends \PHPUnit_Framework_TestCase
class TaskEventTest extends TestCase
{
public function testGetTask()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Event/TaskExecutionEventTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@

namespace Task\Tests\Unit\Event;

use PHPUnit\Framework\TestCase;
use Task\Event\TaskExecutionEvent;
use Task\Execution\TaskExecutionInterface;
use Task\TaskInterface;

/**
* Test for class TaskExecutionEvent.
*/
class TaskExecutionEventTest extends \PHPUnit_Framework_TestCase
class TaskExecutionEventTest extends TestCase
{
public function testGetTask()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Event/TaskFailedEventTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

namespace Task\Tests\Unit\Event;

use PHPUnit\Framework\TestCase;
use Task\Event\TaskFailedEvent;
use Task\TaskInterface;

/**
* Tests for class TaskFailedEvent.
*/
class TaskFailedEventTest extends \PHPUnit_Framework_TestCase
class TaskFailedEventTest extends TestCase
{
public function testGetTask()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Execution/TaskExecutionTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@

namespace Task\Tests\Unit\Execution;

use PHPUnit\Framework\TestCase;
use Task\Execution\TaskExecution;
use Task\Task;
use Task\TaskStatus;

/**
* Tests for TaskExecution.
*/
class TaskExecutionTest extends \PHPUnit_Framework_TestCase
class TaskExecutionTest extends TestCase
{
public function testUuid()
{
Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/Handler/TaskHandlerFactoryTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@

namespace Task\Tests\Unit\Handler;

use PHPUnit\Framework\TestCase;
use Task\Handler\TaskHandlerFactory;
use Task\Handler\TaskHandlerInterface;
use Task\Handler\TaskHandlerNotExistsException;

/**
* Tests for TaskHandlerFactory.
*/
class TaskHandlerFactoryTest extends \PHPUnit_Framework_TestCase
class TaskHandlerFactoryTest extends TestCase
{
public function testCreate()
{
Expand All @@ -29,7 +30,7 @@ public function testCreate()

public function testCreateNotExisting()
{
$this->setExpectedException(TaskHandlerNotExistsException::class);
$this->expectException(TaskHandlerNotExistsException::class);

$factory = new TaskHandlerFactory();

Expand Down
19 changes: 9 additions & 10 deletions tests/Unit/Lock/LockTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@

namespace Task\Tests\Unit\Lock;

use PHPUnit\Framework\TestCase;
use Task\Lock\Exception\LockConflictException;
use Task\Lock\Lock;
use Task\Lock\LockInterface;
use Task\Lock\LockStorageInterface;

class LockTest extends \PHPUnit_Framework_TestCase
class LockTest extends TestCase
{
/**
* @var LockStorageInterface
Expand Down Expand Up @@ -52,11 +54,10 @@ public function testAcquire()
$this->assertTrue($this->lock->acquire($this->key));
}

/**
* @expectedException \Task\Lock\Exception\LockConflictException
*/
public function testAcquireAlreadyAcquired()
{
$this->expectException(LockConflictException::class);

$this->storage->exists($this->key)->willReturn(true);
$this->storage->save($this->key, $this->ttl)->shouldNotBeCalled();

Expand All @@ -71,11 +72,10 @@ public function testRefresh()
$this->assertTrue($this->lock->refresh($this->key));
}

/**
* @expectedException \Task\Lock\Exception\LockConflictException
*/
public function testRefreshNotAcquired()
{
$this->expectException(LockConflictException::class);

$this->storage->exists($this->key)->willReturn(false);
$this->storage->save($this->key, $this->ttl)->shouldNotBeCalled();

Expand All @@ -90,11 +90,10 @@ public function testRelease()
$this->assertTrue($this->lock->release($this->key));
}

/**
* @expectedException \Task\Lock\Exception\LockConflictException
*/
public function testReleaseNotAcquired()
{
$this->expectException(LockConflictException::class);

$this->storage->exists($this->key)->willReturn(false);
$this->storage->delete($this->key)->shouldNotBeCalled();

Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Lock/Storage/FileLockStorageTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
use org\bovigo\vfs\vfsStreamFile;
use PHPUnit\Framework\TestCase;
use Task\Lock\LockStorageInterface;
use Task\Lock\Storage\FileLockStorage;

class FileLockStorageTest extends \PHPUnit_Framework_TestCase
class FileLockStorageTest extends TestCase
{
/**
* @var vfsStreamDirectory
Expand Down
7 changes: 4 additions & 3 deletions tests/Unit/Runner/InsideProcessExecutorTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Unit\Runner;

use PHPUnit\Framework\TestCase;
use Task\Execution\TaskExecutionInterface;
use Task\Executor\FailedException;
use Task\Executor\InsideProcessExecutor;
Expand All @@ -19,7 +20,7 @@
use Task\Handler\TaskHandlerFactoryInterface;
use Task\Handler\TaskHandlerInterface;

class InsideProcessExecutorTest extends \PHPUnit_Framework_TestCase
class InsideProcessExecutorTest extends TestCase
{
/**
* @var TaskHandlerFactoryInterface
Expand Down Expand Up @@ -56,7 +57,7 @@ public function testExecute()

public function testExecuteException()
{
$this->setExpectedException(\InvalidArgumentException::class, 'test message');
$this->expectException(\InvalidArgumentException::class, 'test message');

$executions = $this->prophesize(TaskExecutionInterface::class);
$executions->getHandlerClass()->willReturn('AppBundle\\Handler\\TestHandler');
Expand Down Expand Up @@ -98,7 +99,7 @@ public function testExecuteExceptionRetry()

public function testExecuteFailedException()
{
$this->setExpectedException(\InvalidArgumentException::class, 'test message');
$this->expectException(\InvalidArgumentException::class, 'test message');

$execution = $this->prophesize(TaskExecutionInterface::class);
$execution->getHandlerClass()->willReturn('AppBundle\\Handler\\TestHandler');
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Runner/PendingExecutionFinderTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Task\Tests\Unit\Runner;

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Ramsey\Uuid\Uuid;
use Task\Execution\TaskExecutionInterface;
Expand All @@ -21,7 +22,7 @@
use Task\Runner\PendingExecutionFinder;
use Task\Storage\TaskExecutionRepositoryInterface;

class PendingExecutionFinderTest extends \PHPUnit_Framework_TestCase
class PendingExecutionFinderTest extends TestCase
{
const HANDLER = 'AppBundle\\Handler\\TestHandler';

Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/Runner/TaskRunnerTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Task\Tests\Unit\Runner;

use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
Expand All @@ -30,7 +31,7 @@
/**
* Tests for TaskRunner.
*/
class TaskRunnerTest extends \PHPUnit_Framework_TestCase
class TaskRunnerTest extends TestCase
{
/**
* @var TaskExecutionRepositoryInterface
Expand Down
Loading

Back | FazBrowse Home | New Git URL