From 9c7b1cbe529dcf9b98bd9dc612a995323a5ac816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ko=CC=88ngeter?= Date: Tue, 24 Nov 2020 12:09:43 +0100 Subject: [PATCH 1/2] Updated composer.json and PHPUnit Updating the PHP version constraint and PHPUnit allows the library to be installed under PHP 8 now --- .gitignore | 1 + composer.json | 4 ++-- phpunit.xml.dist | 21 ++++++++++++--------- tests/QrReaderTest.php | 5 +++-- tests/QrReaderTest.php~ | 17 ----------------- 5 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 tests/QrReaderTest.php~ diff --git a/.gitignore b/.gitignore index f567539..716b1f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /composer.lock /vendor .idea/ +.phpunit.result.cache diff --git a/composer.json b/composer.json index 4e75736..9187ebd 100644 --- a/composer.json +++ b/composer.json @@ -18,10 +18,10 @@ } ], "require": { - "php": "^5.6|^7.0" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^9.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7c557c8..f34ef35 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,10 +1,13 @@ - - - tests - - - - src - - + + + + + tests/ + + + + + tests + + diff --git a/tests/QrReaderTest.php b/tests/QrReaderTest.php index 10d2ff3..8d48ec3 100644 --- a/tests/QrReaderTest.php +++ b/tests/QrReaderTest.php @@ -2,9 +2,10 @@ namespace Khanamiryan\QrCodeTests; +use PHPUnit\Framework\TestCase; use Zxing\QrReader; -class QrReaderTest extends \PHPUnit\Framework\TestCase +class QrReaderTest extends TestCase { public function testText1() @@ -12,6 +13,6 @@ public function testText1() $image = __DIR__ . "/qrcodes/hello_world.png"; $qrcode = new QrReader($image); - $this->assertSame("Hello world!", $qrcode->text()); + self::assertSame("Hello world!", $qrcode->text()); } } diff --git a/tests/QrReaderTest.php~ b/tests/QrReaderTest.php~ deleted file mode 100644 index c5ac9c2..0000000 --- a/tests/QrReaderTest.php~ +++ /dev/null @@ -1,17 +0,0 @@ -assertSame("Hello world!", $qrcode->text()); - } -} From c3ea7333010057204c88d0c0f45d4a42bb506f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ko=CC=88ngeter?= Date: Wed, 25 Nov 2020 08:03:04 +0100 Subject: [PATCH 2/2] Changed method call --- tests/QrReaderTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/QrReaderTest.php b/tests/QrReaderTest.php index 8d48ec3..b4c1367 100644 --- a/tests/QrReaderTest.php +++ b/tests/QrReaderTest.php @@ -13,6 +13,6 @@ public function testText1() $image = __DIR__ . "/qrcodes/hello_world.png"; $qrcode = new QrReader($image); - self::assertSame("Hello world!", $qrcode->text()); + $this->assertSame("Hello world!", $qrcode->text()); } }