Skip to content

Commit

Permalink
Update version and copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Feb 12, 2021
1 parent de2526d commit 6c1699c
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 48 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
tests/ export-ignore
phpunit.xml export-ignore
.travis.yml export-ignore
37 changes: 37 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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/)


Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
}
}
}
31 changes: 15 additions & 16 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="Pop CSV Component PHPUnit Test">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="/tmp/pop-csv-cc" lowUpperBound="35"
highLowerBound="70"/>
<log type="coverage-text" showUncoveredFiles="true"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
<report>
<html outputDirectory="/tmp/pop-csv-cc" lowUpperBound="35" highLowerBound="70"/>
</report>
</coverage>
<testsuites>
<testsuite name="Pop CSV Component PHPUnit Test">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging/>
</phpunit>
6 changes: 3 additions & 3 deletions src/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/popphp/popphp-framework
* @author Nick Sagona, III <dev@nolainteractive.com>
* @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
*/

Expand All @@ -19,9 +19,9 @@
* @category Pop
* @package Pop\Csv
* @author Nick Sagona, III <dev@nolainteractive.com>
* @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
{
Expand Down
6 changes: 3 additions & 3 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @link https://github.com/popphp/popphp-framework
* @author Nick Sagona, III <dev@nolainteractive.com>
* @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
*/

Expand All @@ -19,8 +19,8 @@
* @category Pop
* @package Pop\Csv
* @author Nick Sagona, III <dev@nolainteractive.com>
* @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 {}
14 changes: 7 additions & 7 deletions tests/CsvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}

Expand All @@ -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());
}
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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);
}


Expand All @@ -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);
}

}

0 comments on commit 6c1699c

Please sign in to comment.