diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2f38b1a..9b7d954 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -12,8 +12,8 @@ jobs: strategy: matrix: os: ['ubuntu-latest'] - php: ['7.4', '8.0', '8.1', '8.2'] - continue-on-error: ${{ matrix.php == '8.2' }} + php: ['8.0', '8.1', '8.2', '8.3'] + continue-on-error: ${{ matrix.php == '8.3' }} steps: - uses: actions/checkout@v2 @@ -26,16 +26,16 @@ jobs: run: composer validate - name: Install dependencies - if: ${{ matrix.php != '8.2' }} - uses: nick-invision/retry@v1 + if: ${{ matrix.php != '8.3' }} + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 3 command: composer update --no-interaction --no-progress - name: Install Dependencies (ignore platform) - if: ${{ matrix.php == '8.2' }} - uses: nick-invision/retry@v1 + if: ${{ matrix.php == '8.3' }} + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 3 diff --git a/codeception.yml b/codeception.yml index 5014541..bf12c22 100644 --- a/codeception.yml +++ b/codeception.yml @@ -3,8 +3,9 @@ paths: log: tests/_log data: tests/_data helpers: tests/_helpers + output: tests/_output settings: - suite_class: \PHPUnit_Framework_TestSuite + suite_class: \PHPUnit\Framework\TestSuite colors: true memory_limit: 1024M - log: true \ No newline at end of file + log: true diff --git a/composer.json b/composer.json index 410f119..32fa76c 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,12 @@ "type": "library", "license": "MIT", "require": { - "php": "^7.4 || ^8", + "php": "~8.0.0||~8.1.0||~8.2.0||~8.3.0", "ext-sqlite3": "*" }, "require-dev": { - "codeception/codeception": "^4" + "codeception/codeception": "^5" }, - "minimum-stability": "dev", "autoload": { "psr-4": { "Udger\\": "src/" diff --git a/tests/functional/ParserFunctionalTest.php b/tests/functional/ParserFunctionalTest.php index 4985ebe..b59fba5 100644 --- a/tests/functional/ParserFunctionalTest.php +++ b/tests/functional/ParserFunctionalTest.php @@ -2,12 +2,16 @@ namespace tests\Udger; +use Codeception\Stub; +use Codeception\Test\Unit; +use FunctionalGuy; +use Udger\Parser; use Udger\ParserInterface; -class ParserFunctionalTest extends \Codeception\TestCase\Test +class ParserFunctionalTest extends Unit { /** - * @var \FunctionalGuy + * @var FunctionalGuy */ protected $guy; @@ -19,8 +23,8 @@ class ParserFunctionalTest extends \Codeception\TestCase\Test protected function _before() { - $this->parser = new \Udger\Parser( - \Codeception\Util\Stub::makeEmpty("Udger\Helper\IP") + $this->parser = new Parser( + Stub::makeEmpty("Udger\Helper\IP") ); $this->parser->setDataFile(dirname(__DIR__) . "/fixtures/udgercache/udgerdb_v3.dat"); } diff --git a/tests/functional/ParserMultipleTest.php b/tests/functional/ParserMultipleTest.php index 670903b..38a44a6 100644 --- a/tests/functional/ParserMultipleTest.php +++ b/tests/functional/ParserMultipleTest.php @@ -2,13 +2,17 @@ namespace tests\Udger; +use Codeception\Stub; +use Codeception\Test\Unit; +use Udger\Parser; use Udger\ParserInterface; +use UnitGuy; -class ParserMultipleTest extends \Codeception\TestCase\Test +class ParserMultipleTest extends Unit { /** - * @var \UnitGuy + * @var UnitGuy */ protected $guy; @@ -20,8 +24,8 @@ class ParserMultipleTest extends \Codeception\TestCase\Test protected function _before() { - $this->parser = new \Udger\Parser( - \Codeception\Util\Stub::makeEmpty("Udger\Helper\IP") + $this->parser = new Parser( + Stub::makeEmpty("Udger\Helper\IP") ); $this->parser->setDataFile(dirname(__DIR__) . "/fixtures/udgercache/udgerdb_v3.dat"); } diff --git a/tests/unit/Helper/IPTest.php b/tests/unit/Helper/IPTest.php index eb327f0..a968cd2 100644 --- a/tests/unit/Helper/IPTest.php +++ b/tests/unit/Helper/IPTest.php @@ -2,17 +2,19 @@ namespace tests\Udger\Helper; +use Codeception\Test\Unit; use Udger\Helper\IP; +use UnitGuy; /** * * @author tiborb */ -class ParserFactoryTest extends \Codeception\TestCase\Test +class ParserFactoryTest extends Unit { /** - * @var \UnitGuy + * @var UnitGuy */ protected $guy; diff --git a/tests/unit/ParserFactoryTest.php b/tests/unit/ParserFactoryTest.php index 73f1afd..016f3b7 100644 --- a/tests/unit/ParserFactoryTest.php +++ b/tests/unit/ParserFactoryTest.php @@ -2,13 +2,15 @@ namespace tests\Udger; +use Codeception\Test\Unit; use Udger\ParserFactory; +use UnitGuy; -class ParserFactoryTest extends \Codeception\TestCase\Test +class ParserFactoryTest extends Unit { /** - * @var \UnitGuy + * @var UnitGuy */ protected $guy; diff --git a/tests/unit/ParserTest.php b/tests/unit/ParserTest.php index a7712c6..81d9381 100644 --- a/tests/unit/ParserTest.php +++ b/tests/unit/ParserTest.php @@ -2,11 +2,17 @@ namespace tests\Udger; -class ParserTest extends \Codeception\TestCase\Test +use Codeception\Stub; +use Codeception\Test\Unit; +use Exception; +use Udger\Parser; +use UnitGuy; + +class ParserTest extends Unit { /** - * @var \UnitGuy + * @var UnitGuy */ protected $guy; @@ -18,8 +24,8 @@ class ParserTest extends \Codeception\TestCase\Test protected function _before() { - $this->parser = new \Udger\Parser( - \Codeception\Util\Stub::makeEmpty("Udger\Helper\IP") + $this->parser = new Parser( + Stub::makeEmpty("Udger\Helper\IP") ); #$this->parser->setAccessKey("udger-php-unit"); $this->parser->setDataFile("/dev/null"); @@ -32,7 +38,7 @@ protected function _after() // tests public function testSetDataFile() { - $this->expectException(\Exception::class); + $this->expectException(Exception::class); $this->assertTrue($this->parser->setDataFile("/this/is/a/missing/path")); } @@ -48,7 +54,6 @@ public function testSetIP() public function testParse() { - #$this->setExpectedException("Exception"); $this->parser->parse(); } }