Skip to content

Commit 454b98e

Browse files
committed
Migrate tests to phpunit > 6
1 parent 798cecd commit 454b98e

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
processIsolation="false"
1010
stopOnFailure="false"
1111
syntaxCheck="false"
12-
bootstrap="vendor/autoload.php"
12+
bootstrap="./tests/bootstrap.php"
1313
>
1414
<testsuites>
1515
<testsuite name="PHP tmpfile Test Suite">

tests/FileTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
use mikehaertl\tmp\File;
33

4-
class FileTest extends \PHPUnit_Framework_TestCase
4+
class FileTest extends \PHPUnit\Framework\TestCase
55
{
66
public function testCanCreateFile()
77
{

tests/bootstrap.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
// Some travis environments use phpunit > 6
3+
$newClass = '\PHPUnit\Framework\TestCase';
4+
$oldClass = '\PHPUnit_Framework_TestCase';
5+
if (!class_exists($newClass) && class_exists($oldClass)) {
6+
class_alias($oldClass, $newClass);
7+
}
8+
9+
require __DIR__ . '/../vendor/autoload.php';
10+

0 commit comments

Comments
 (0)