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 833f8af..0a7b85c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ pop-dir ======= -[![Build Status](https://travis-ci.org/popphp/pop-dir.svg?branch=master)](https://travis-ci.org/popphp/pop-dir) +[![Build Status](https://github.com/popphp/pop-dir/workflows/phpunit/badge.svg)](https://github.com/popphp/pop-dir/actions) [![Coverage Status](http://cc.popphp.org/coverage.php?comp=pop-dir)](http://cc.popphp.org/pop-dir/) OVERVIEW diff --git a/composer.json b/composer.json index b5c8297..1a12eb9 100644 --- a/composer.json +++ b/composer.json @@ -18,10 +18,10 @@ } ], "require": { - "php": ">=7.1.0" + "php": ">=7.3.0" }, "require-dev": { - "phpunit/phpunit": "^7.0.0" + "phpunit/phpunit": "^9.0.0" }, "autoload": { "psr-4": { @@ -33,6 +33,9 @@ "Pop\\Dir\\Test\\": "tests/" } }, + "scripts": { + "test": "vendor/bin/phpunit" + }, "extra": { "branch-alias": { "dev-master": "3.1.x-dev" diff --git a/phpunit.xml b/phpunit.xml index 9c3b239..7465366 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,18 +1,17 @@ - - - - tests - - - - - src - - - - - - + + + + src + + + + + + + + tests + + + diff --git a/src/Dir.php b/src/Dir.php index 0c131f2..b594a93 100644 --- a/src/Dir.php +++ b/src/Dir.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\Dir * @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.0 + * @version 3.2.0 */ class Dir implements \ArrayAccess, \Countable, \IteratorAggregate { diff --git a/src/Exception.php b/src/Exception.php index 8158fcc..8f95249 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\Dir * @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.0 + * @version 3.2.0 */ class Exception extends \Exception {} diff --git a/tests/DirTest.php b/tests/DirTest.php index 78ac563..a5b5b39 100644 --- a/tests/DirTest.php +++ b/tests/DirTest.php @@ -129,7 +129,7 @@ public function testCopyTo() $dir = new Dir(__DIR__ . '/copy'); $dir->emptyDir(true); - $this->assertFileNotExists(__DIR__ . '/copy'); + $this->assertFileDoesNotExist(__DIR__ . '/copy'); } public function testEmptyToBadPath() @@ -149,7 +149,7 @@ public function testMagicMethods() $this->assertTrue(isset($dir->{0})); $this->assertTrue(isset($dir->{'test'})); $this->assertTrue($dir->fileExists('test.txt')); - $this->assertContains('test', $dir->{0}); + $this->assertStringContainsString('test', $dir->{0}); } public function testSetException()