Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.0 Support #9

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 8 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,26 @@ env:
matrix:
fast_finish: true
include:
- php: 5.6
env:
- DEPS=lowest
- php: 5.6
env:
- DEPS=latest
- php: 7
env:
- DEPS=lowest
- php: 7
env:
- DEPS=latest
- php: 7.1
- php: 7.3
env:
- DEPS=lowest
- php: 7.1
- php: 7.3
env:
- DEPS=latest
- CS_CHECK=true
- TEST_COVERAGE=true
- php: 7.2
- php: 7.4
env:
- DEPS=lowest
- php: 7.2
- php: 7.4
env:
- DEPS=latest
- php: 7.3
- php: nightly
env:
- DEPS=lowest
- php: 7.3
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- php: nightly
env:
- DEPS=latest
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"

before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@
"extra": {
},
"require": {
"php": "^5.6 || ^7.0",
"php": "^7.3 || ~8.0.0",
"laminas/laminas-zendframework-bridge": "^1.0"
},
"suggest": {
"ext-iconv": "*",
"ext-mbstring": "*"
},
"require-dev": {
"laminas/laminas-coding-standard": "~1.0.0",
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2"
"phpunit/phpunit": "^9.3"
},
"autoload": {
"psr-4": {
Expand Down
11 changes: 5 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="laminas-escaper Test Suite">
<directory>./test</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
19 changes: 9 additions & 10 deletions test/EscaperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace LaminasTest\Escaper;

use Laminas\Escaper\Escaper;
use Laminas\Escaper\Exception\InvalidArgumentException;
use PHPUnit\Framework\TestCase;

class EscaperTest extends TestCase
Expand Down Expand Up @@ -174,25 +175,23 @@ class EscaperTest extends TestCase
*/
protected $escaper;

public function setUp()
protected function setUp(): void
{
$this->escaper = new Escaper('UTF-8');
}

/**
* @expectedException \Laminas\Escaper\Exception\InvalidArgumentException
* @expectedExceptionMessage Laminas\Escaper\Escaper constructor parameter must be a string, received integer
*/
public function testSettingEncodingToNonStringShouldThrowException()
{
$escaper = new Escaper(1);
$this->expectExceptionMessage(
"Laminas\Escaper\Escaper constructor parameter must be a string, received integer"
);
$this->expectException(InvalidArgumentException::class);
new Escaper(1);
}

/**
* @expectedException \Laminas\Escaper\Exception\InvalidArgumentException
*/
public function testSettingEncodingToEmptyStringShouldThrowException()
{
$this->expectException(InvalidArgumentException::class);
new Escaper('');
}

Expand All @@ -207,7 +206,7 @@ public function testSettingValidEncodingShouldNotThrowExceptions()

public function testSettingEncodingToInvalidValueShouldThrowException()
{
$this->expectException(\Laminas\Escaper\Exception\InvalidArgumentException::class);
$this->expectException(InvalidArgumentException::class);
new Escaper('invalid-encoding');
}

Expand Down