diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c72594f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -sudo: false -dist: trusty - -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - -matrix: - include: - - dist: precise - php: 5.3 - -before_script: - - php -m - - php --info | grep -i 'intl\|icu\|pcre' - -script: phpunit --debug - -notifications: - email: - on_success: never diff --git a/README.md b/README.md index 866a82c..0c9b5e3 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ PHP Command Line Tools ====================== -[![Build Status](https://travis-ci.org/wp-cli/php-cli-tools.png?branch=master)](https://travis-ci.org/wp-cli/php-cli-tools) - A collection of functions and classes to assist with command line development. Requirements - * PHP >= 5.3 + * PHP >= 5.6 Suggested PHP extensions diff --git a/composer.json b/composer.json index 4096d05..112217c 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ } ], "require": { - "php": ">= 5.3.0" + "php": ">= 5.6.0" }, "require-dev": { "roave/security-advisories": "dev-latest", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8b04e40..43a1822 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,16 +1,20 @@ - - - tests/ - tests/ - tests/ - - + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd" + bootstrap="tests/bootstrap.php" + backupGlobals="false" + beStrictAboutCoversAnnotation="true" + beStrictAboutOutputDuringTests="true" + beStrictAboutTestsThatDoNotTestAnything="true" + beStrictAboutTodoAnnotatedTests="true" + colors="true" + verbose="true"> + + tests/ + + + + + lib/ + + diff --git a/tests/test-arguments.php b/tests/Test_Arguments.php similarity index 92% rename from tests/test-arguments.php rename to tests/Test_Arguments.php index 6a69ba3..9f89eda 100644 --- a/tests/test-arguments.php +++ b/tests/Test_Arguments.php @@ -4,12 +4,12 @@ use WP_CLI\Tests\TestCase; /** - * Class TestArguments + * Class Test_Arguments * @todo add more tests to increase coverage * * @backupGlobals enabled */ -class TestArguments extends TestCase +class Test_Arguments extends TestCase { /** * Array of expected settings @@ -91,6 +91,13 @@ public function set_up() 'flags' => $this->flags, 'options' => $this->options ); + + set_error_handler( + static function ( $errno, $errstr ) { + throw new \Exception( $errstr, $errno ); + }, + E_ALL + ); } /** @@ -102,6 +109,7 @@ public function tear_down() $this->options = null; $this->settings = null; self::clearArgv(); + restore_error_handler(); } /** @@ -151,7 +159,7 @@ public function testAddOptions() * * @return array set of args and expected parsed values */ - public function settingsWithValidOptions() + public static function settingsWithValidOptions() { return array( array( @@ -174,7 +182,7 @@ public function settingsWithValidOptions() * * @return array set of args and expected parsed values */ - public function settingsWithMissingOptions() + public static function settingsWithMissingOptions() { return array( array( @@ -193,7 +201,7 @@ public function settingsWithMissingOptions() * * @return array set of args and expected parsed values */ - public function settingsWithMissingOptionsWithDefault() + public static function settingsWithMissingOptionsWithDefault() { return array( array( @@ -207,7 +215,7 @@ public function settingsWithMissingOptionsWithDefault() ); } - public function settingsWithNoOptionsWithDefault() + public static function settingsWithNoOptionsWithDefault() { return array( array( @@ -259,8 +267,8 @@ public function testParseWithValidOptions($cliParams, $expectedValues) */ public function testParseWithMissingOptions($cliParams, $expectedValues) { - $this->expectWarning(); - $this->expectWarningMessage('no value given for --option1'); + $this->expectException(\Exception::class); + $this->expectExceptionMessage('no value given for --option1'); $this->_testParse($cliParams, $expectedValues); } diff --git a/tests/test-cli.php b/tests/Test_Cli.php similarity index 99% rename from tests/test-cli.php rename to tests/Test_Cli.php index bcd5fce..156a509 100644 --- a/tests/test-cli.php +++ b/tests/Test_Cli.php @@ -2,7 +2,8 @@ use cli\Colors; use WP_CLI\Tests\TestCase; -class testsCli extends TestCase { + +class Test_Cli extends TestCase { function set_up() { // Reset enable state diff --git a/tests/test-colors.php b/tests/Test_Colors.php similarity index 81% rename from tests/test-colors.php rename to tests/Test_Colors.php index e6f9d4a..bac23a4 100644 --- a/tests/test-colors.php +++ b/tests/Test_Colors.php @@ -3,12 +3,12 @@ use cli\Colors; use WP_CLI\Tests\TestCase; -class testsColors extends TestCase { +class Test_Colors extends TestCase { /** * @dataProvider dataColors - */ - function testColors( $str, $color ) { + */ + public function testColors( $str, $color ) { // Colors enabled. Colors::enable( true ); @@ -21,7 +21,7 @@ function testColors( $str, $color ) { } } - function dataColors() { + public static function dataColors() { $ret = array(); foreach ( Colors::getColors() as $str => $color ) { $ret[] = array( $str, $color ); diff --git a/tests/test-shell.php b/tests/Test_Shell.php similarity index 96% rename from tests/test-shell.php rename to tests/Test_Shell.php index ff760f9..d2bc71e 100644 --- a/tests/test-shell.php +++ b/tests/Test_Shell.php @@ -4,9 +4,9 @@ use WP_CLI\Tests\TestCase; /** - * Class TestShell + * Class Test_Shell */ -class TestShell extends TestCase { +class Test_Shell extends TestCase { /** * Test getting TERM columns. diff --git a/tests/test-table.php b/tests/Test_Table.php similarity index 99% rename from tests/test-table.php rename to tests/Test_Table.php index 2ad4d1b..538a4a4 100644 --- a/tests/test-table.php +++ b/tests/Test_Table.php @@ -1,6 +1,8 @@