From 6c1699cabf3895b9985888cec866ef5be6b228a5 Mon Sep 17 00:00:00 2001 From: Nick Sagona Date: Thu, 11 Feb 2021 23:59:57 -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 | 9 ++++++--- phpunit.xml | 31 ++++++++++++++--------------- src/Csv.php | 6 +++--- src/Exception.php | 6 +++--- tests/CsvTest.php | 14 ++++++------- 10 files changed, 73 insertions(+), 48 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 ab22850..f78d600 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ pop-csv ======= -[![Build Status](https://travis-ci.org/popphp/pop-csv.svg?branch=master)](https://travis-ci.org/popphp/pop-csv) +[![Build Status](https://github.com/popphp/pop-csv/workflows/phpunit/badge.svg)](https://github.com/popphp/pop-csv/actions) [![Coverage Status](http://cc.popphp.org/coverage.php?comp=pop-csv)](http://cc.popphp.org/pop-csv/) diff --git a/composer.json b/composer.json index f6ce384..6036be4 100644 --- a/composer.json +++ b/composer.json @@ -17,10 +17,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": { @@ -32,9 +32,12 @@ "Pop\\Csv\\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 6b108bc..a04cf1e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,18 +1,17 @@ - - - - tests - - - - - src - - - - - - + + + + src + + + + + + + + tests + + + diff --git a/src/Csv.php b/src/Csv.php index 5704bd0..e6a9772 100644 --- a/src/Csv.php +++ b/src/Csv.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\Csv * @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.5 + * @version 3.2.0 */ class Csv { diff --git a/src/Exception.php b/src/Exception.php index a8dd3d4..cef9905 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\Csv * @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.5 + * @version 3.2.0 */ class Exception extends \Exception {} diff --git a/tests/CsvTest.php b/tests/CsvTest.php index 11affe8..966af71 100644 --- a/tests/CsvTest.php +++ b/tests/CsvTest.php @@ -90,7 +90,7 @@ public function testSetters() $csv = new Csv(); $csv->setString(file_get_contents(__DIR__ . '/tmp/data.csv')); $csv->setData($data); - $this->assertContains('testuser1', $csv->getString()); + $this->assertStringContainsString('testuser1', $csv->getString()); $this->assertEquals('Bob', $csv->getData()[0]['first_name']); } @@ -99,7 +99,7 @@ public function testGetters() $csv = new Csv(__DIR__ . '/tmp/data.csv'); $csv->unserialize(); $this->assertEquals('testuser1', $csv->getData()[0]['username']); - $this->assertContains('testuser1', $csv->getString()); + $this->assertStringContainsString('testuser1', $csv->getString()); $this->assertTrue($csv->isSerialized()); $this->assertTrue($csv->isUnserialized()); } @@ -113,7 +113,7 @@ public function testUnserializeAndSerialize() $this->assertEquals('testuser1', $data1Ary[0]['username']); $this->assertEquals('testuser1', $data2Ary[0]['username']); $string = new Csv($data1Ary); - $this->assertContains('testuser1,testuser1@test.com', $string->serialize()); + $this->assertStringContainsString('testuser1,testuser1@test.com', $string->serialize()); } public function testSerializeWithAssociativeArray() @@ -135,7 +135,7 @@ public function testSerializeWithAssociativeArray() ] ]; $string = new Csv($data); - $this->assertContains('Bob,"Smith, III"', (string)$string); + $this->assertStringContainsString('Bob,"Smith, III"', (string)$string); } public function testOmit() @@ -156,7 +156,7 @@ public function testOmit() ]; $string = new Csv($data); $csvString = $string->serialize(['omit' => 'first_name']); - $this->assertNotContains('Bob', $csvString); + $this->assertStringNotContainsString('Bob', $csvString); } public function testNewline() @@ -284,7 +284,7 @@ public function testOutputToHttp() ob_start(); $data->outputToHttp('test.csv', false); $result = ob_get_clean(); - $this->assertContains('foo', $result); + $this->assertStringContainsString('foo', $result); } @@ -296,7 +296,7 @@ public function testOutputDataToHttp() ob_start(); Csv::outputDataToHttp([['foo' => 'bar']], [], 'test.csv', false); $result = ob_get_clean(); - $this->assertContains('foo', $result); + $this->assertStringContainsString('foo', $result); } } \ No newline at end of file