From ab8632ff4e4b9b369742574a9e61906290edfd18 Mon Sep 17 00:00:00 2001 From: Nick Sagona Date: Fri, 12 Feb 2021 16:16:50 -0600 Subject: [PATCH] Update version and copyright --- .gitattributes | 1 - .github/workflows/phpunit.yml | 37 +++++++++++++++++++++++++++++++++++ .travis.yml | 13 ------------ LICENSE.TXT | 2 +- README.md | 2 +- composer.json | 11 +++++++---- phpunit.xml | 31 ++++++++++++++--------------- src/Command.php | 6 +++--- src/Console.php | 6 +++--- src/Exception.php | 6 +++--- tests/ConsoleTest.php | 10 +++++----- 11 files changed, 75 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/phpunit.yml delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index 3c5830d..03bf387 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ tests/ export-ignore phpunit.xml export-ignore -.travis.yml export-ignore diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..c01359a --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,37 @@ +name: phpunit + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + #- name: Validate composer.json and composer.lock + # run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + - name: Run test suite + run: composer run-script test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b040dc0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -before_script: - - composer self-update - - composer install -language: php -branches: - only: - - master -php: - - 7.1 -script: - - ./vendor/bin/phpunit -notifications: - email: false diff --git a/LICENSE.TXT b/LICENSE.TXT index 191f9e9..b20d09a 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -1,6 +1,6 @@ BSD 3 Clause License -Copyright (c) 2009-2020, NOLA Interactive, LLC. +Copyright (c) 2009-2021, NOLA Interactive, LLC. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 1950fca..487fe8b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ pop-console =========== -[![Build Status](https://travis-ci.org/popphp/pop-console.svg?branch=master)](https://travis-ci.org/popphp/pop-console) +[![Build Status](https://github.com/popphp/pop-console/workflows/phpunit/badge.svg)](https://github.com/popphp/pop-console/actions) [![Coverage Status](http://cc.popphp.org/coverage.php?comp=pop-console)](http://cc.popphp.org/pop-console/) OVERVIEW diff --git a/composer.json b/composer.json index fdcb906..e5a8496 100644 --- a/composer.json +++ b/composer.json @@ -20,11 +20,11 @@ } ], "require": { - "php": ">=7.1.0", - "popphp/popphp": "^3.3.0" + "php": ">=7.3.0", + "popphp/popphp": "^3.7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0.0" + "phpunit/phpunit": "^9.0.0" }, "autoload": { "psr-4": { @@ -36,9 +36,12 @@ "Pop\\Console\\Test\\": "tests/" } }, + "scripts": { + "test": "vendor/bin/phpunit" + }, "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "3.2.x-dev" } } } diff --git a/phpunit.xml b/phpunit.xml index 178e93e..a23c82c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,18 +1,17 @@ - - - - tests - - - - - src - - - - - - + + + + src + + + + + + + + tests + + + diff --git a/src/Command.php b/src/Command.php index 65e2c7e..f9f5463 100644 --- a/src/Command.php +++ b/src/Command.php @@ -4,7 +4,7 @@ * * @link https://github.com/popphp/popphp-framework * @author Nick Sagona, III - * @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) + * @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com) * @license http://www.popphp.org/license New BSD License */ @@ -19,9 +19,9 @@ * @category Pop * @package Pop\Console * @author Nick Sagona, III - * @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) + * @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com) * @license http://www.popphp.org/license New BSD License - * @version 3.1.1 + * @version 3.2.0 */ class Command { diff --git a/src/Console.php b/src/Console.php index 7830fd1..e9dae1c 100644 --- a/src/Console.php +++ b/src/Console.php @@ -4,7 +4,7 @@ * * @link https://github.com/popphp/popphp-framework * @author Nick Sagona, III - * @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) + * @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com) * @license http://www.popphp.org/license New BSD License */ @@ -21,9 +21,9 @@ * @category Pop * @package Pop\Console * @author Nick Sagona, III - * @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) + * @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com) * @license http://www.popphp.org/license New BSD License - * @version 3.1.1 + * @version 3.2.0 */ class Console { diff --git a/src/Exception.php b/src/Exception.php index 691ffdc..614faed 100644 --- a/src/Exception.php +++ b/src/Exception.php @@ -4,7 +4,7 @@ * * @link https://github.com/popphp/popphp-framework * @author Nick Sagona, III - * @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) + * @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com) * @license http://www.popphp.org/license New BSD License */ @@ -19,8 +19,8 @@ * @category Pop * @package Pop\Console * @author Nick Sagona, III - * @copyright Copyright (c) 2009-2020 NOLA Interactive, LLC. (http://www.nolainteractive.com) + * @copyright Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com) * @license http://www.popphp.org/license New BSD License - * @version 3.1.1 + * @version 3.2.0 */ class Exception extends \Exception {} diff --git a/tests/ConsoleTest.php b/tests/ConsoleTest.php index a0659c1..a4d16c6 100644 --- a/tests/ConsoleTest.php +++ b/tests/ConsoleTest.php @@ -171,23 +171,23 @@ public function testDisplayHelpColors() $console->help(); $result = ob_get_clean(); - $this->assertContains('user', $result); + $this->assertStringContainsString('user', $result); } public function testColor() { $console = new Console(); $string = $console->colorize('Hello World', Console::BOLD_BLUE, Console::RED); - $this->assertContains('[1;34m', $string); - $this->assertContains('[41m', $string); - $this->assertContains('[0m', $string); + $this->assertStringContainsString('[1;34m', $string); + $this->assertStringContainsString('[41m', $string); + $this->assertStringContainsString('[0m', $string); } public function testBadColor() { $console = new Console(); $string = $console->colorize('Hello World', 'BAD_FG', 'BAD_BG'); - $this->assertContains('Hello World', $string); + $this->assertStringContainsString('Hello World', $string); } public function testAppend()