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

Port the test suite to PHP 8 #15

Closed
wants to merge 6 commits into from
Closed
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
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
language: php
sudo: false
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1.0
- 8.2.0
- 8.3.0
# Disable xdebug for PHP >= 7.3
# https://stackoverflow.com/questions/65172031/vendor-bin-phpunit-exited-with-2
before_script:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
},
"type": "library",
"require": {
"php": ">=5.6",
"php": ">=7.0",
"pear/pear-core-minimal": "^1.10.1"
},
"require-dev": {
"phpunit/phpunit": "^4"
"phpunit/phpunit": "^9.3"
}
}
8 changes: 5 additions & 3 deletions tests/AllTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@

class HTML_Template_IT_AllTests
{
private static $runner;

public static function main()
{

PHPUnit_TextUI_TestRunner::run(self::suite());
$runner = new PHPUnit\TextUI\TestRunner;
$runner->run(self::suite());
}

public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite('HTML_Template_IT tests');
$suite = new PHPUnit\Framework\TestSuite('HTML_Template_IT tests');

$suite->addTestSuite('ITTest');
$suite->addTestSuite('ITXTest');
Expand Down
6 changes: 3 additions & 3 deletions tests/ITTest.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php
require_once 'HTML/Template/IT.php';

class ITTest extends PHPUnit_Framework_TestCase
class ITTest extends PHPUnit\Framework\TestCase
{
/**
* An HTML_Template_IT object
* @var object
*/
var $tpl;

function setUp()
protected function setUp(): void
{
$this->tpl = new HTML_Template_IT(dirname(__FILE__) . '/templates');
}

function tearDown()
protected function tearDown(): void
{
unset($this->tpl);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ITXTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static function _numberFormatCallback($float, $decimals)

class ITXTest extends ITTest
{
function setUp()
function setUp(): void
{
$this->tpl = new HTML_Template_ITX(dirname(__FILE__) . '/templates');
}
Expand Down