Skip to content

Commit e0a247d

Browse files
committed
Upgrade to codeception 5 and upgrade php requirements
1 parent 1925770 commit e0a247d

File tree

8 files changed

+46
-29
lines changed

8 files changed

+46
-29
lines changed

.github/workflows/php.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: ['ubuntu-latest']
15-
php: ['7.4', '8.0', '8.1', '8.2']
16-
continue-on-error: ${{ matrix.php == '8.2' }}
15+
php: ['8.0', '8.1', '8.2', '8.3']
16+
continue-on-error: ${{ matrix.php == '8.3' }}
1717
steps:
1818
- uses: actions/checkout@v2
1919

@@ -26,16 +26,16 @@ jobs:
2626
run: composer validate
2727

2828
- name: Install dependencies
29-
if: ${{ matrix.php != '8.2' }}
30-
uses: nick-invision/retry@v1
29+
if: ${{ matrix.php != '8.3' }}
30+
uses: nick-invision/retry@v2
3131
with:
3232
timeout_minutes: 5
3333
max_attempts: 3
3434
command: composer update --no-interaction --no-progress
3535

3636
- name: Install Dependencies (ignore platform)
37-
if: ${{ matrix.php == '8.2' }}
38-
uses: nick-invision/retry@v1
37+
if: ${{ matrix.php == '8.3' }}
38+
uses: nick-invision/retry@v2
3939
with:
4040
timeout_minutes: 5
4141
max_attempts: 3

codeception.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ paths:
33
log: tests/_log
44
data: tests/_data
55
helpers: tests/_helpers
6+
output: tests/_output
67
settings:
7-
suite_class: \PHPUnit_Framework_TestSuite
8+
suite_class: \PHPUnit\Framework\TestSuite
89
colors: true
910
memory_limit: 1024M
10-
log: true
11+
log: true

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
"type": "library",
1111
"license": "MIT",
1212
"require": {
13-
"php": "^7.4 || ^8",
13+
"php": "~8.0.0||~8.1.0||~8.2.0||~8.3.0",
1414
"ext-sqlite3": "*"
1515
},
1616
"require-dev": {
17-
"codeception/codeception": "^4"
17+
"codeception/codeception": "^5"
1818
},
19-
"minimum-stability": "dev",
2019
"autoload": {
2120
"psr-4": {
2221
"Udger\\": "src/"

tests/functional/ParserFunctionalTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
namespace tests\Udger;
44

5+
use Codeception\Stub;
6+
use Codeception\Test\Unit;
7+
use FunctionalGuy;
8+
use Udger\Parser;
59
use Udger\ParserInterface;
610

7-
class ParserFunctionalTest extends \Codeception\TestCase\Test
11+
class ParserFunctionalTest extends Unit
812
{
913
/**
10-
* @var \FunctionalGuy
14+
* @var FunctionalGuy
1115
*/
1216
protected $guy;
1317

@@ -19,8 +23,8 @@ class ParserFunctionalTest extends \Codeception\TestCase\Test
1923

2024
protected function _before()
2125
{
22-
$this->parser = new \Udger\Parser(
23-
\Codeception\Util\Stub::makeEmpty("Udger\Helper\IP")
26+
$this->parser = new Parser(
27+
Stub::makeEmpty("Udger\Helper\IP")
2428
);
2529
$this->parser->setDataFile(dirname(__DIR__) . "/fixtures/udgercache/udgerdb_v3.dat");
2630
}

tests/functional/ParserMultipleTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
namespace tests\Udger;
44

5+
use Codeception\Stub;
6+
use Codeception\Test\Unit;
7+
use Udger\Parser;
58
use Udger\ParserInterface;
9+
use UnitGuy;
610

7-
class ParserMultipleTest extends \Codeception\TestCase\Test
11+
class ParserMultipleTest extends Unit
812
{
913

1014
/**
11-
* @var \UnitGuy
15+
* @var UnitGuy
1216
*/
1317
protected $guy;
1418

@@ -20,8 +24,8 @@ class ParserMultipleTest extends \Codeception\TestCase\Test
2024

2125
protected function _before()
2226
{
23-
$this->parser = new \Udger\Parser(
24-
\Codeception\Util\Stub::makeEmpty("Udger\Helper\IP")
27+
$this->parser = new Parser(
28+
Stub::makeEmpty("Udger\Helper\IP")
2529
);
2630
$this->parser->setDataFile(dirname(__DIR__) . "/fixtures/udgercache/udgerdb_v3.dat");
2731
}

tests/unit/Helper/IPTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
namespace tests\Udger\Helper;
44

5+
use Codeception\Test\Unit;
56
use Udger\Helper\IP;
7+
use UnitGuy;
68

79
/**
810
*
911
* @author tiborb
1012
*/
11-
class ParserFactoryTest extends \Codeception\TestCase\Test
13+
class ParserFactoryTest extends Unit
1214
{
1315

1416
/**
15-
* @var \UnitGuy
17+
* @var UnitGuy
1618
*/
1719
protected $guy;
1820

tests/unit/ParserFactoryTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
namespace tests\Udger;
44

5+
use Codeception\Test\Unit;
56
use Udger\ParserFactory;
7+
use UnitGuy;
68

7-
class ParserFactoryTest extends \Codeception\TestCase\Test
9+
class ParserFactoryTest extends Unit
810
{
911

1012
/**
11-
* @var \UnitGuy
13+
* @var UnitGuy
1214
*/
1315
protected $guy;
1416

tests/unit/ParserTest.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
namespace tests\Udger;
44

5-
class ParserTest extends \Codeception\TestCase\Test
5+
use Codeception\Stub;
6+
use Codeception\Test\Unit;
7+
use Exception;
8+
use Udger\Parser;
9+
use UnitGuy;
10+
11+
class ParserTest extends Unit
612
{
713

814
/**
9-
* @var \UnitGuy
15+
* @var UnitGuy
1016
*/
1117
protected $guy;
1218

@@ -18,8 +24,8 @@ class ParserTest extends \Codeception\TestCase\Test
1824

1925
protected function _before()
2026
{
21-
$this->parser = new \Udger\Parser(
22-
\Codeception\Util\Stub::makeEmpty("Udger\Helper\IP")
27+
$this->parser = new Parser(
28+
Stub::makeEmpty("Udger\Helper\IP")
2329
);
2430
#$this->parser->setAccessKey("udger-php-unit");
2531
$this->parser->setDataFile("/dev/null");
@@ -32,7 +38,7 @@ protected function _after()
3238
// tests
3339
public function testSetDataFile()
3440
{
35-
$this->expectException(\Exception::class);
41+
$this->expectException(Exception::class);
3642
$this->assertTrue($this->parser->setDataFile("/this/is/a/missing/path"));
3743
}
3844

@@ -48,7 +54,6 @@ public function testSetIP()
4854

4955
public function testParse()
5056
{
51-
#$this->setExpectedException("Exception");
5257
$this->parser->parse();
5358
}
5459
}

0 commit comments

Comments
 (0)