Skip to content

Commit

Permalink
Use PHPUnit 8
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrodzicki committed Apr 17, 2023
1 parent 77dbb6b commit d54d18a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
php-version: [ 5.6, "7.0", 7.1, 7.2, 7.3, 7.4 ]
php-version: [ 7.2, 7.3, 7.4, "8.0", 8.1, 8.2 ]
os: [ ubuntu-latest ]

steps:
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
*.xml

# ignore PHPStorm files
.idea/*
.idea/*

# PHPUnit
/phpunit.xml
.phpunit.result.cache
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ easy inclusion in your projects.
## Requirements

- a server with:
- PHP 5.6 or higher
- PHP 7.2 or higher
- PHP json and PHP cURL modules
- tested on Apache 2.4 with PHP 5.6.1 and cURL 7.42.1 and with PHP 7.4.9 and cURL 7.68.0
- direct network connectivity between this server and the host and port (usually TCP port 8443 or port 443 for
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.2",
"ext-curl": "*",
"ext-json": "*"
},
Expand All @@ -30,7 +30,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": "^8.5"
},
"scripts": {
"test" : [
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
colors="true">
<testsuites>
<testsuite name="Unit tests">
Expand Down
7 changes: 3 additions & 4 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ClientTest extends TestCase
{
private $client;

protected function setUp()
protected function setUp(): void
{
$this->client = new Client('unifi', 'unifi');
}
Expand All @@ -29,9 +29,8 @@ public function testSetSite()

// whitespace (debug mode)
$this->client->set_debug(true);
$this->expectException(\PHPUnit_Framework_Error_Notice::class);
$this->expectExceptionCode(E_USER_NOTICE);
$this->expectExceptionMessage('The provided (short) site name may not contain any spaces');
$this->expectNotice();
$this->expectNoticeMessage('The provided (short) site name may not contain any spaces');
$this->client->set_site(' foobar ');
}
}

0 comments on commit d54d18a

Please sign in to comment.