Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit 35b58bb

Browse files
authored
Merge pull request #1 from phpbench/php8
Support PHP 8
2 parents dca2b0e + 6e47984 commit 35b58bb

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
language: php
22

33
php:
4-
- 5.4
5-
- 5.5
6-
- 5.6
7-
- 7.0
8-
- hhvm
4+
- 7.2
5+
- 7.3
6+
- 7.4
7+
- nightly
98

109
sudo: false
1110

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
}
1010
],
1111
"require": {
12-
"php": "^5.4|^7.0",
12+
"php": "^7.2|^8.0",
1313
"ext-dom": "*"
1414
},
1515
"require-dev": {
16-
"phpunit/phpunit": "^4.6"
16+
"phpunit/phpunit": "^8.0|^9.0"
1717
},
1818
"autoload": {
1919
"psr-4": {

tests/Unit/DocumentTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111

1212
namespace PhpBench\Dom\Tests\Unit;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use PhpBench\Dom\Document;
1516

16-
class DocumentTest extends \PHPUnit_Framework_TestCase
17+
class DocumentTest extends TestCase
1718
{
1819
/**
1920
* @var Document
2021
*/
2122
private $document;
2223

23-
public function setUp()
24+
public function setUp(): void
2425
{
2526
$this->document = new Document(1.0);
2627
}
@@ -52,7 +53,7 @@ public function testEvaluate()
5253
public function testCreateRoot()
5354
{
5455
$this->document->createRoot('hello');
55-
$this->assertContains('<hello/>', $this->document->saveXml());
56+
$this->assertStringContainsString('<hello/>', $this->document->saveXml());
5657
}
5758

5859
/**

tests/Unit/ElementTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111

1212
namespace PhpBench\Dom\Tests\Unit;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use PhpBench\Dom\Document;
1516

16-
class ElementTest extends \PHPUnit_Framework_TestCase
17+
class ElementTest extends TestCase
1718
{
1819
private $element;
1920
private $document;
2021

21-
public function setUp()
22+
public function setUp(): void
2223
{
2324
$this->document = new Document();
2425
$this->element = $this->document->createRoot('test');

tests/Unit/XPathTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111

1212
namespace PhpBench\Dom\Tests\Unit;
1313

14+
use PHPUnit\Framework\TestCase;
1415
use PhpBench\Dom\Document;
16+
use PhpBench\Dom\Exception\InvalidQueryException;
1517

16-
class XPathTest extends \PHPUnit_Framework_TestCase
18+
class XPathTest extends TestCase
1719
{
1820
/**
1921
* It should throw an exception if the xpath query is invalid.
20-
*
21-
* @expectedException PhpBench\Dom\Exception\InvalidQueryException
22-
* @expectedExceptionMessage Errors encountered
2322
*/
2423
public function testQueryException()
2524
{
25+
$this->expectException(InvalidQueryException::class);
2626
$this->getDocument()->query('//article[noexistfunc() = "as"]');
2727
}
2828

0 commit comments

Comments
 (0)