Skip to content

Commit

Permalink
Merge pull request #107 from pascalbaljet/php-8.0
Browse files Browse the repository at this point in the history
Support for PHP 8.0
  • Loading branch information
mtibben authored Nov 3, 2020
2 parents 16d7fd5 + 13a9fab commit 642f1e6
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ matrix:
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: 8.0snapshot

before_script:
- composer install
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
}
},
"require-dev": {
"phpunit/phpunit": "~4"
"phpunit/phpunit": "~4|^9.0"
},
"suggest": {
"ext-mbstring": "For best performance",
"symfony/polyfill-mbstring": "If you can't install ext-mbstring"
}
}
}
4 changes: 3 additions & 1 deletion test/BasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class BasicTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class BasicTest extends TestCase
{
public function basicDataProvider() {
return array(
Expand Down
4 changes: 3 additions & 1 deletion test/BlockquoteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class BlockquoteTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class BlockquoteTest extends TestCase
{
public function blockquoteDataProvider()
{
Expand Down
9 changes: 7 additions & 2 deletions test/ConstructorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class ConstructorTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class ConstructorTest extends TestCase
{
public function testConstructor()
{
Expand All @@ -29,7 +31,10 @@ public function testLegacyConstructorThrowsExceptionWhenFromFileIsTrue()
$html = 'Foo';
$options = array('do_links' => 'none');

$this->setExpectedException('InvalidArgumentException');
method_exists($this, 'expectException')
? $this->expectException('InvalidArgumentException')
: $this->setExpectedException('InvalidArgumentException');

$html2text = new Html2Text($html, true, $options);
}
}
4 changes: 3 additions & 1 deletion test/DefinitionListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class DefinitionListTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class DefinitionListTest extends TestCase
{
public function testDefinitionList()
{
Expand Down
4 changes: 3 additions & 1 deletion test/DelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class DelTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class DelTest extends TestCase
{
public function testDel()
{
Expand Down
4 changes: 3 additions & 1 deletion test/HtmlCharsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class HtmlCharsTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class HtmlCharsTest extends TestCase
{
public function testLaquoAndRaquo()
{
Expand Down
4 changes: 3 additions & 1 deletion test/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class ImageTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class ImageTest extends TestCase
{
public function testImageDataProvider() {
return array(
Expand Down
4 changes: 3 additions & 1 deletion test/InsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class InsTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class InsTest extends TestCase
{
public function testIns()
{
Expand Down
4 changes: 3 additions & 1 deletion test/LinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class LinkTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class LinkTest extends TestCase
{
const TEST_HTML = '<a href="http://example.com">Link text</a>';

Expand Down
4 changes: 3 additions & 1 deletion test/ListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class ListTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class ListTest extends TestCase
{
public function testList()
{
Expand Down
4 changes: 3 additions & 1 deletion test/PreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class PreTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class PreTest extends TestCase
{
public function preDataProvider()
{
Expand Down
13 changes: 7 additions & 6 deletions test/PrintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

namespace Html2Text;

class PrintTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class PrintTest extends TestCase
{
const TEST_HTML = 'Hello, &quot;<b>world</b>&quot;';
const EXPECTED = 'Hello, "WORLD"';

public function setUp() {
$this->html = new Html2Text(self::TEST_HTML);
$this->expectOutputString(self::EXPECTED);
}

public function testP()
{
$this->html = new Html2Text(self::TEST_HTML);
$this->html->p();
$this->expectOutputString(self::EXPECTED);
}

public function testPrint_text()
{
$this->html = new Html2Text(self::TEST_HTML);
$this->html->print_text();
$this->expectOutputString(self::EXPECTED);
}
}
4 changes: 3 additions & 1 deletion test/SearchReplaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class SearchReplaceTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class SearchReplaceTest extends TestCase
{
public function searchReplaceDataProvider() {
return array(
Expand Down
4 changes: 3 additions & 1 deletion test/SpanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class SpanTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class SpanTest extends TestCase
{

public function testIgnoreSpans()
Expand Down
4 changes: 3 additions & 1 deletion test/StrToUpperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class StrToUpperTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class StrToUpperTest extends TestCase
{
public function testToUpper()
{
Expand Down
4 changes: 3 additions & 1 deletion test/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Html2Text;

class TableTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class TableTest extends TestCase
{
public function testTable()
{
Expand Down

0 comments on commit 642f1e6

Please sign in to comment.