Skip to content

Commit

Permalink
API phpunit 9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Oct 24, 2021
1 parent 23ba53f commit cba68d0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
language: php

dist: trusty
dist: xenial

matrix:
fast_finish: true
include:
- php: 5.6
- php: 7.3
env: PHPUNIT_TEST=1 PHPCS_TEST=1
- php: 7.0
- php: 7.4
env: PHPUNIT_TEST=1

before_script:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"require": {
"php": "^5.6||^7.0",
"symfony/process": "^3.0 || ^4.0",
"silverstripe/framework": "^4"
"silverstripe/framework": "^4.10"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": "^9"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 5 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
<testsuite name="Default">
<directory>tests</directory>
</testsuite>
<testsuites>
<testsuite name="Default">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
10 changes: 5 additions & 5 deletions tests/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace SilverStripe\Serve\Tests;

use BadMethodCallException;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use SilverStripe\Serve\ServerFactory;
use SilverStripe\Serve\PortChecker;

class ServerTest extends PHPUnit_Framework_TestCase
class ServerTest extends TestCase
{
public function testStartStop()
{
Expand All @@ -25,7 +25,7 @@ public function testStartStop()
$content = file_get_contents($server->getURL() . 'Security/login');

// Check that the login form exists on the displayed page
$this->assertContains('MemberLoginForm_LoginForm', $content);
$this->assertStringContainsString('MemberLoginForm_LoginForm', $content);

// When it stops, it stops listening
$server->stop();
Expand All @@ -41,7 +41,7 @@ public function testStartTwiceFails()
]);

// Start fails because the server is already started
$this->setExpectedException('LogicException');
$this->expectException(\LogicException::class);
$server->start();
}

Expand All @@ -56,7 +56,7 @@ public function testStopTwiceFails()
$server->stop();

// Stop a 2nd fails because the server is already stopped
$this->setExpectedException('LogicException');
$this->expectException(\LogicException::class);
$server->stop();
}

Expand Down

0 comments on commit cba68d0

Please sign in to comment.