Skip to content

Commit

Permalink
Updated composer.json and PHPUnit
Browse files Browse the repository at this point in the history
Updating the PHP version constraint and PHPUnit allows the library to be installed under PHP 8 now
  • Loading branch information
Tobias Köngeter committed Nov 24, 2020
1 parent 89b57f2 commit 9c7b1cb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/composer.lock
/vendor
.idea/
.phpunit.result.cache
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
21 changes: 12 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<phpunit bootstrap="tests/bootstrap.php">
<testsuite>
<directory suffix="Test.php">tests</directory>
</testsuite>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">tests/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
5 changes: 3 additions & 2 deletions tests/QrReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

namespace Khanamiryan\QrCodeTests;

use PHPUnit\Framework\TestCase;
use Zxing\QrReader;

class QrReaderTest extends \PHPUnit\Framework\TestCase
class QrReaderTest extends TestCase
{

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());
}
}
17 changes: 0 additions & 17 deletions tests/QrReaderTest.php~

This file was deleted.

0 comments on commit 9c7b1cb

Please sign in to comment.