Skip to content

Commit 93c273e

Browse files
authored
Merge pull request #22 from ozh/fixtests2
Fix tests (episode 2)
2 parents 8454840 + 300d996 commit 93c273e

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

.travis.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1+
sudo: false
2+
13
language: php
24
php:
3-
- 5.2
45
- 5.3
56
- 5.4
67
- 5.5
78
- 5.6
8-
- 7
9+
- 7.0
10+
- 7.1
911
- hhvm
1012

11-
before_install:
12-
- phpenv global 5.5
13-
- composer require codeclimate/php-test-reporter --dev
14-
- phpenv global "$TRAVIS_PHP_VERSION"
15-
16-
script: ./vendor/bin/phpunit --coverage-text
13+
script: phpunit --coverage-text

composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
"issues": "https://github.com/jakeasmith/http_build_url/issues",
1313
"source": "https://github.com/jakeasmith/http_build_url"
1414
},
15-
"require-dev": {
16-
"phpunit/phpunit": "~3.7"
17-
},
1815
"autoload": {
1916
"files": ["src/http_build_url.php"]
2017
}

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="./vendor/autoload.php" colors="true">
2+
<phpunit bootstrap="./tests/bootstrap.php" colors="true">
33
<testsuites>
44
<testsuite>
55
<directory>./tests</directory>

tests/bootstrap.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
require dirname( __DIR__ ) . '/src/http_build_url.php';
3+
4+
// PHPUnit 6 compatibility for previous versions
5+
if ( class_exists( 'PHPUnit\Runner\Version' ) && version_compare( PHPUnit\Runner\Version::id(), '6.0', '>=' ) ) {
6+
class_alias( 'PHPUnit\Framework\Assert', 'PHPUnit_Framework_Assert' );
7+
class_alias( 'PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase' );
8+
class_alias( 'PHPUnit\Framework\Error\Error', 'PHPUnit_Framework_Error' );
9+
class_alias( 'PHPUnit\Framework\Error\Notice', 'PHPUnit_Framework_Error_Notice' );
10+
class_alias( 'PHPUnit\Framework\Error\Warning', 'PHPUnit_Framework_Error_Warning' );
11+
}
12+
13+
// Past this point, tests will start

0 commit comments

Comments
 (0)