Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
name: PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v1
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: Report PHP version
run: php -v
- name: Validate composer.json and composer.lock
run: composer validate
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run style check
run: vendor/bin/phpcs src tests
- name: Run test suite
run: vendor/bin/phpunit
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
],
"require": {
"php" : "^7.1",
"php" : ">=7.1",
"ext-json": "*",

"symfony/yaml" : "^3.4|^4.0|^5.0",
"dflydev/dot-access-data": "^1.1|^2.0"

},
"require-dev": {
"phpunit/phpunit" : "^7.5|^8.0",
"phpunit/phpunit" : "^7.5|^8.0|^9.0",
"vlucas/phpdotenv" : "^4.1",
"symfony/config" : "^3.4|^4.2|^5.0",
"squizlabs/php_codesniffer": "^3.5"
Expand Down
2 changes: 1 addition & 1 deletion tests/Loader/ArrayValuesLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public function testLoad(): void
{
$config = (new ArrayValuesLoader(static::$values))->load();
$this->assertEquals('Pineapple', $config->get('c.p'));
$this->assertEquals(4, count($config));
$this->assertCount(4, $config);
}
}
9 changes: 3 additions & 6 deletions tests/Loader/EnvLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ function ($val) use ($rMethod) {
$this->assertEquals($expected, (new EnvLoader())->load()->getArrayCopy());
}

/**
*
*/
public function testLoadSetsAllValuesToLowerCaseIfSpecified()
{
$this->assertEquals(
Expand Down Expand Up @@ -148,9 +145,9 @@ public function testPrepareValuesSetsScalarsCorrectly()
$values = EnvLoader::loadUsingPrefix('FOOBAR_');
$this->assertSame(2, $values->get('INTEGER'));
$this->assertSame(2.3, $values->get('FLOAT'));
$this->assertSame(true, $values->get('TRUE'));
$this->assertSame(false, $values->get('FALSE'));
$this->assertSame(null, $values->get('NULL'));
$this->assertTrue($values->get('TRUE'));
$this->assertFalse($values->get('FALSE'));
$this->assertNull($values->get('NULL'));
$this->assertSame('somestuff', $values->get('STR'));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Loader/FileLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testLoadReturnsEmptyConfigValuesIfFileNotExistsAndNotRequired():
{
@unlink($this->getTestFilePath()); // remove the file
$values = $this->getLoader(false)->load();
$this->assertEquals(0, count($values));
$this->assertCount(0, $values);
}

public function testLoadThowsExceptionIfFileIsNotReadableAndIsRequired(): void
Expand Down