Skip to content

Commit

Permalink
PHP8 Support
Browse files Browse the repository at this point in the history
- Added PHP 8 support
- Added Prophecy to PHPUnit tests
- Migrated PHPUnit configuration file
- Added temp PHPUnit file to .gitignore
  • Loading branch information
TimoBakx authored Jul 14, 2021
2 parents 022f6d4 + d3ad523 commit 4e0ed6d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor/
composer.lock
.phpunit.result.cache
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"license": "MIT",
"require": {
"php": "^7.2.0",
"php": "^7.2.0|^8.0.0",
"psr/log": "^1.1"
},
"autoload": {
Expand All @@ -18,6 +18,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "^8.0|^9.0"
"phpunit/phpunit": "^8.0|^9.0",
"phpspec/prophecy-phpunit": "^2.0"
}
}
23 changes: 10 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<coverage>
<include>
<directory>src</directory>
</include>
</coverage>
<php>
<ini name="error_reporting" value="-1" />
<ini name="error_reporting" value="-1"/>
</php>

<testsuites>
<testsuite name="Linku Feedback Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>
</phpunit>
3 changes: 3 additions & 0 deletions tests/ChainedFeedbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
use Linku\Feedback\ChainedFeedback;
use Linku\Feedback\Feedback;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use RuntimeException;

class ChainedFeedbackTest extends TestCase
{
use ProphecyTrait;

/**
* @var Feedback|ObjectProphecy
*/
Expand Down
3 changes: 3 additions & 0 deletions tests/LoggerFeedbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@

use Linku\Feedback\LoggerFeedback;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Log\LoggerInterface;
use RuntimeException;

final class LoggerFeedbackTest extends TestCase
{
use ProphecyTrait;

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

0 comments on commit 4e0ed6d

Please sign in to comment.