Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump phpunit #69

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Behat

on:
pull_request:
push:
branches: [ master ]

jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0', '8.1']
name: php${{ matrix.php-versions }}

steps:
- uses: actions/checkout@v2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: ${{ matrix.coverage }}

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Set up PHP dependencies
run: composer i

- name: Behat
run: vendor/bin/behat
42 changes: 42 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: PHPUnit

on:
pull_request:
push:
branches: [ master ]

jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
coverage: ['xdebug']
xdebug_mode: ['debug']
php-versions: ['7.3', '7.4', '8.0', '8.1']
name: php${{ matrix.php-versions }}

steps:
- uses: actions/checkout@v2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: ${{ matrix.coverage }}

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: PHPUnit
env:
XDEBUG_MODE: ${{ matrix.xdebug_mode }}
run: ./vendor/phpunit/phpunit/phpunit -c phpunit.xml
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"rafikhaceb/tcpdi": "*"
},
"require-dev": {
"phpunit/phpunit": "^7|^8",
"smalot/pdfparser": "~0.13"
"phpunit/phpunit": "^9.5",
"smalot/pdfparser": "~0.13",
"phpspec/prophecy-phpunit": "^2.0",
"behat/behat": "^3.10"
}
}
21 changes: 11 additions & 10 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<phpunit bootstrap="./vendor/autoload.php">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
executionOrder="depends,defects"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
failOnWarning="true"
verbose="true">
<testsuites>
<testsuite name="default">
<directory>./tests</directory>
</testsuite>
<testsuite name="readme">
<file>./tests/ReadmeIntegration.php</file>
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
2 changes: 2 additions & 0 deletions tests/Driver/DefaultDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
namespace iio\libmergepdf\Driver;

use iio\libmergepdf\Source\SourceInterface;
use Prophecy\PhpUnit\ProphecyTrait;

class DefaultDriverTest extends \PHPUnit\Framework\TestCase
{
use ProphecyTrait;
public function testMerge()
{
$wrapped = $this->prophesize(DriverInterface::CLASS);
Expand Down
2 changes: 2 additions & 0 deletions tests/Driver/Fpdi2DriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
use iio\libmergepdf\Source\SourceInterface;
use setasign\Fpdi\Tcpdf\Fpdi;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;

class Fpdi2DriverTest extends \PHPUnit\Framework\TestCase
{
use ProphecyTrait;
public function testExceptionOnInvalidFpdi()
{
$this->expectException(\InvalidArgumentException::CLASS);
Expand Down
2 changes: 2 additions & 0 deletions tests/Driver/TcpdiDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
use iio\libmergepdf\Source\SourceInterface;
use iio\libmergepdf\Exception;
use iio\libmergepdf\Pages;
use Prophecy\PhpUnit\ProphecyTrait;

class TcpdiDriverTest extends \PHPUnit\Framework\TestCase
{
use ProphecyTrait;
public function testExceptionOnFailure()
{
$tcpdi = $this->prophesize(\TCPDI::CLASS);
Expand Down
2 changes: 2 additions & 0 deletions tests/MergerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
use iio\libmergepdf\Driver\DriverInterface;
use iio\libmergepdf\Source\FileSource;
use iio\libmergepdf\Source\RawSource;
use Prophecy\PhpUnit\ProphecyTrait;

class MergerTest extends \PHPUnit\Framework\TestCase
{
use ProphecyTrait;
public function testAddRaw()
{
$pages = $this->createMock(PagesInterface::CLASS);
Expand Down