Skip to content

Commit ff9ecc0

Browse files
committed
upgrade to phpunit 8
1 parent 0301a34 commit ff9ecc0

22 files changed

+44
-21
lines changed

.github/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ git submodule init
1515
git submodule update
1616
composer install
1717
build/runphp build/gen_test.php
18-
phpunit
18+
build/test
1919
```

build/gen_test.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ function genTestForClass($classname) {
2828
use LightnCandy\\LightnCandy;
2929
use LightnCandy\\Runtime;
3030
use LightnCandy\\SafeString;
31+
use PHPUnit\\Framework\\TestCase;
3132
3233
require_once(__DIR__ . '/test_util.php');
3334
34-
class {$classname}Test extends PHPUnit_Framework_TestCase
35+
class {$classname}Test extends TestCase
3536
{
3637
3738
VAR

build/test

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
vendor/bin/phpunit --bootstrap vendor/autoload.php

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"php": ">=5.4.0"
1515
},
1616
"require-dev": {
17-
"phpunit/phpunit": "4.8.35"
17+
"phpunit/phpunit": "8.0.6"
1818
},
1919
"autoload": {
2020
"psr-4": {

phpunit.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</filter>
1313

1414
<logging>
15-
<log type="coverage-html" target="build/result/coverage" title="lightncandy" charset="UTF-8" />
15+
<log type="coverage-html" target="build/result/coverage" />
1616
<log type="coverage-text" target="php://stdout" />
1717
</logging>
1818

tests/CompilerTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class CompilerTest extends PHPUnit_Framework_TestCase
12+
class CompilerTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Compiler::getFuncName

tests/ContextTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class ContextTest extends PHPUnit_Framework_TestCase
12+
class ContextTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Context::updateHelperTable

tests/EncoderTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class EncoderTest extends PHPUnit_Framework_TestCase
12+
class EncoderTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Encoder::raw

tests/ExporterTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class ExporterTest extends PHPUnit_Framework_TestCase
12+
class ExporterTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Exporter::closure

tests/ExpressionTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class ExpressionTest extends PHPUnit_Framework_TestCase
12+
class ExpressionTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Expression::boolString

tests/LightnCandyTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class LightnCandyTest extends PHPUnit_Framework_TestCase
12+
class LightnCandyTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\LightnCandy::compilePartial

tests/ParserTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class ParserTest extends PHPUnit_Framework_TestCase
12+
class ParserTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Parser::getExpression

tests/PartialTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class PartialTest extends PHPUnit_Framework_TestCase
12+
class PartialTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Partial::prePartial

tests/RuntimeTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class RuntimeTest extends PHPUnit_Framework_TestCase
12+
class RuntimeTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Runtime::debug

tests/SafeStringTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class SafeStringTest extends PHPUnit_Framework_TestCase
12+
class SafeStringTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\SafeString::stripExtendedComments

tests/TokenTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class TokenTest extends PHPUnit_Framework_TestCase
12+
class TokenTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Token::toString

tests/ValidatorTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use LightnCandy\LightnCandy;
66
use LightnCandy\Runtime;
77
use LightnCandy\SafeString;
8+
use PHPUnit\Framework\TestCase;
89

910
require_once(__DIR__ . '/test_util.php');
1011

11-
class ValidatorTest extends PHPUnit_Framework_TestCase
12+
class ValidatorTest extends TestCase
1213
{
1314
/**
1415
* @covers LightnCandy\Validator::delimiter

tests/errorTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
use LightnCandy\LightnCandy;
44
use LightnCandy\Runtime;
5+
use PHPUnit\Framework\TestCase;
6+
57
require_once('tests/helpers_for_test.php');
68

79
$tmpdir = sys_get_temp_dir();
@@ -29,7 +31,7 @@ function stop_catch_error_log() {
2931
}, file($errlog_fn));
3032
}
3133

32-
class errorTest extends PHPUnit_Framework_TestCase
34+
class errorTest extends TestCase
3335
{
3436
public function testException()
3537
{

tests/handlebarsSpecTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use LightnCandy\LightnCandy;
44
use LightnCandy\Runtime;
5+
use PHPUnit\Framework\TestCase;
56

67
$tmpdir = sys_get_temp_dir();
78
$hb_test_flag = LightnCandy::FLAG_HANDLEBARSJS_FULL | LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_EXTHELPER;
@@ -62,7 +63,7 @@ static public function createFrame($data) {
6263
}
6364
}
6465

65-
class HandlebarsSpecTest extends PHPUnit_Framework_TestCase
66+
class HandlebarsSpecTest extends TestCase
6667
{
6768
/**
6869
* @dataProvider jsonSpecProvider

tests/mustacheSpecTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use LightnCandy\LightnCandy;
4+
use PHPUnit\Framework\TestCase;
45

56
$tmpdir = sys_get_temp_dir();
67

@@ -9,7 +10,7 @@ function getFunctionCode($func) {
910
return $v;
1011
}
1112

12-
class MustacheSpecTest extends PHPUnit_Framework_TestCase
13+
class MustacheSpecTest extends TestCase
1314
{
1415
/**
1516
* @dataProvider jsonSpecProvider

tests/regressionTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
use LightnCandy\LightnCandy;
44
use LightnCandy\Runtime;
5+
use PHPUnit\Framework\TestCase;
6+
57
require_once('tests/helpers_for_test.php');
68

79
$tmpdir = sys_get_temp_dir();
810

9-
class regressionTest extends PHPUnit_Framework_TestCase
11+
class regressionTest extends TestCase
1012
{
1113
/**
1214
* @dataProvider issueProvider

tests/usageTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?php
22

33
use LightnCandy\LightnCandy;
4+
use PHPUnit\Framework\TestCase;
5+
46
require_once('tests/helpers_for_test.php');
57

6-
class usageTest extends PHPUnit_Framework_TestCase
8+
class usageTest extends TestCase
79
{
810
/**
911
* @dataProvider compileProvider

0 commit comments

Comments
 (0)