Skip to content

Commit 3c630e1

Browse files
authored
Merge pull request #9 from chrisryan/master
Add Support for PHP 8.
2 parents b57782f + 87a05e7 commit 3c630e1

File tree

4 files changed

+32
-30
lines changed

4 files changed

+32
-30
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-18.04
1212
strategy:
1313
matrix:
14-
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4']
14+
php-versions: ['7.3', '7.4', '8.0', '8.1']
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v2

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
"filter"
88
],
99
"license": "MIT",
10-
"configure": {
10+
"config": {
1111
"sort-packages": true
1212
},
1313
"require": {
14-
"php": "^7.0",
15-
"traderinteractive/exceptions": "^1.0"
14+
"php": "^7.3 || ^8.0",
15+
"traderinteractive/exceptions": "^2.0"
16+
},
17+
"require-dev": {
18+
"phpunit/phpunit": "^9.0",
19+
"squizlabs/php_codesniffer": "^3.2"
1620
},
1721
"autoload": {
1822
"psr-4": {
1923
"TraderInteractive\\Filter\\": "src"
2024
}
2125
},
22-
"require-dev": {
23-
"phpunit/phpunit": "^6.5",
24-
"php-coveralls/php-coveralls": "^2.1"
25-
},
2626
"scripts": {
2727
"lint": "vendor/bin/phpcs",
2828
"test": "vendor/bin/phpunit"

phpunit.xml.dist

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
<phpunit colors="true" forceCoversAnnotation="true">
2-
<testsuites>
3-
<testsuite name="TraderInteractive Library Test Suite">
4-
<directory suffix="Test.php">tests</directory>
5-
</testsuite>
6-
</testsuites>
7-
<filter>
8-
<whitelist>
9-
<directory>src</directory>
10-
</whitelist>
11-
</filter>
12-
<logging>
13-
<log type="coverage-clover" target="./clover.xml"/>
14-
</logging>
1+
<?xml version="1.0"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" forceCoversAnnotation="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory>src</directory>
6+
</include>
7+
<report>
8+
<clover outputFile="./clover.xml"/>
9+
</report>
10+
</coverage>
11+
<testsuites>
12+
<testsuite name="TraderInteractive Library Test Suite">
13+
<directory suffix="Test.php">tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
<logging/>
1517
</phpunit>

tests/ArraysTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,44 +25,44 @@ public function filterBasicPass()
2525
/**
2626
* @test
2727
* @covers ::filter
28-
* @expectedException \TraderInteractive\Exceptions\FilterException
29-
* @expectedExceptionMessage Value '1' is not an array
3028
*/
3129
public function filterFailNotArray()
3230
{
31+
$this->expectException(\TraderInteractive\Exceptions\FilterException::class);
32+
$this->expectExceptionMessage("Value '1' is not an array");
3333
Arrays::filter(1);
3434
}
3535

3636
/**
3737
* @test
3838
* @covers ::filter
39-
* @expectedException \TraderInteractive\Exceptions\FilterException
40-
* @expectedExceptionMessage $value count of 0 is less than 1
4139
*/
4240
public function filterFailEmpty()
4341
{
42+
$this->expectException(\TraderInteractive\Exceptions\FilterException::class);
43+
$this->expectExceptionMessage('$value count of 0 is less than 1');
4444
Arrays::filter([]);
4545
}
4646

4747
/**
4848
* @test
4949
* @covers ::filter
50-
* @expectedException \TraderInteractive\Exceptions\FilterException
51-
* @expectedExceptionMessage $value count of 1 is less than 2
5250
*/
5351
public function filterCountLessThanMin()
5452
{
53+
$this->expectException(\TraderInteractive\Exceptions\FilterException::class);
54+
$this->expectExceptionMessage('$value count of 1 is less than 2');
5555
Arrays::filter([0], 2);
5656
}
5757

5858
/**
5959
* @test
6060
* @covers ::filter
61-
* @expectedException \TraderInteractive\Exceptions\FilterException
62-
* @expectedExceptionMessage $value count of 2 is greater than 1
6361
*/
6462
public function filterCountGreaterThanMax()
6563
{
64+
$this->expectException(\TraderInteractive\Exceptions\FilterException::class);
65+
$this->expectExceptionMessage('$value count of 2 is greater than 1');
6666
Arrays::filter([0, 1], 1, 1);
6767
}
6868

0 commit comments

Comments
 (0)