Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Switch to support only PHP 5.6+ and move PHPUnit up to 5 and 6
Browse files Browse the repository at this point in the history
  • Loading branch information
curry684 committed Feb 7, 2017
1 parent 9e90488 commit bea5585
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 12 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ sudo: false

matrix:
include:
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
- php: hhvm-3.9
dist: trusty

env:
matrix:
- COMPOSER_FLAGS=""
- COMPOSER_FLAGS="--prefer-lowest"

before_script:
- curl --version
- composer self-update
- composer install --no-interaction
- composer update --no-interaction --no-progress $COMPOSER_FLAGS

script:
- ./vendor/bin/phpunit -v
Expand All @@ -23,4 +27,4 @@ after_script:
- php vendor/bin/coveralls -v

after_success:
- if [ $TRAVIS_PHP_VERSION = '7.1' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then sh bin/generate-api; fi
- if [ $TRAVIS_PHP_VERSION = '7.1' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ] && [ $COMPOSER_FLAGS = '']; then sh bin/generate-api; fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you're not familiar with `composer` follow the installation instructions for
## Dependencies

The library uses [Guzzle 6](https://github.com/guzzle/guzzle) as its HTTP communication layer. PHP versions supported
are 5.5, 5.6, 7.0, 7.1 and hhvm.
are 5.6, 7.0, 7.1 and hhvm.

## Basic usage

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"issues": "https://github.com/omines/directadmin/issues"
},
"require": {
"php": ">=5.5.9",
"guzzlehttp/guzzle": "^6.2"
"php": ">=5.6.0",
"guzzlehttp/guzzle": "^6.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^5.7 || ^6.0",
"satooshi/php-coveralls": "dev-master",
"friendsofphp/php-cs-fixer": "^2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/DirectAdmin/AccountManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @author Niels Keurentjes <niels.keurentjes@omines.com>
*/
class AccountManagementTest extends \PHPUnit_Framework_TestCase
class AccountManagementTest extends \PHPUnit\Framework\TestCase
{
/**
* This function is explicitly implemented as setup, not teardown, so in case of failed tests you may investigate
Expand Down
2 changes: 1 addition & 1 deletion tests/DirectAdmin/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @author Niels Keurentjes <niels.keurentjes@omines.com>
*/
class AdminTest extends \PHPUnit_Framework_TestCase
class AdminTest extends \PHPUnit\Framework\TestCase
{
/** @var AdminContext */
private static $master;
Expand Down
2 changes: 1 addition & 1 deletion tests/DirectAdmin/EnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @author Niels Keurentjes <niels.keurentjes@omines.com>
*/
class EnvironmentTest extends \PHPUnit_Framework_TestCase
class EnvironmentTest extends \PHPUnit\Framework\TestCase
{
/**
* @expectedException \Omines\DirectAdmin\DirectAdminException
Expand Down
2 changes: 1 addition & 1 deletion tests/DirectAdmin/ResellerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @author Niels Keurentjes <niels.keurentjes@omines.com>
*/
class ResellerTest extends \PHPUnit_Framework_TestCase
class ResellerTest extends \PHPUnit\Framework\TestCase
{
/** @var AdminContext */
private static $master;
Expand Down
2 changes: 1 addition & 1 deletion tests/DirectAdmin/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @author Niels Keurentjes <niels.keurentjes@omines.com>
*/
class UserTest extends \PHPUnit_Framework_TestCase
class UserTest extends \PHPUnit\Framework\TestCase
{
/** @var AdminContext */
private static $master;
Expand Down
8 changes: 8 additions & 0 deletions tests/phpunit-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/**
* @author Niels Keurentjes <niels.keurentjes@omines.com>>
*/

define('PASSWORD_LENGTH', 16);

function generateTemporaryPassword()
Expand Down Expand Up @@ -53,3 +54,10 @@ function generateTemporaryPassword()

// Include composer autoload
require __DIR__ . str_replace('/', DIRECTORY_SEPARATOR, '/../vendor/autoload.php');

// Polyfill PHPUnit 6.0 both ways
if (!class_exists('\PHPUnit\Framework\TestCase', true)) {
class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
} elseif (!class_exists('\PHPUnit_Framework_TestCase', true)) {
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
}

0 comments on commit bea5585

Please sign in to comment.