Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Nov 21, 2020
1 parent e1d57f6 commit 919c01a
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 76 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Expand Up @@ -6,6 +6,5 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
16 changes: 16 additions & 0 deletions .github/bin/composer.sh
@@ -0,0 +1,16 @@
#!/bin/bash

EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
else
php composer-setup.php --install-dir="/usr/bin" --filename=composer
RESULT=$?
rm composer-setup.php
composer config platform.php 5.6.50
exit $RESULT
fi
5 changes: 5 additions & 0 deletions .github/bin/hhvm.sh
@@ -0,0 +1,5 @@
#!/bin/bash

echo "deb https://dl.hhvm.com/ubuntu $(lsb_release -sc)-lts-$1 main" >> /etc/apt/sources.list
apt-get update
apt-get --allow-downgrades --reinstall install hhvm/$(lsb_release -sc)-lts-$1
36 changes: 33 additions & 3 deletions .github/workflows/tests.yml
Expand Up @@ -5,13 +5,13 @@ on:
pull_request:

jobs:
tests:
php:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-20.04

strategy:
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
php: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']

steps:
- name: Checkout Code
Expand Down Expand Up @@ -40,8 +40,38 @@ jobs:
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress --ignore-platform-reqs
command: composer update --no-interaction --no-progress --ignore-platform-req=php
if: "matrix.php >= 8"

- name: Execute PHPUnit
run: vendor/bin/phpunit

hhvm:
name: HHVM ${{ matrix.hhvm }}
runs-on: ubuntu-16.04

strategy:
matrix:
hhvm: ["3.15", "3.18", "3.21", "3.24", "3.27", "3.30"]

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install HHVM
shell: bash
run: sudo .github/bin/hhvm.sh ${{ matrix.hhvm }}

- name: Install Composer
shell: bash
run: sudo .github/bin/composer.sh

- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress

- name: Execute PHPUnit
run: hhvm vendor/bin/phpunit
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -22,7 +22,7 @@
"require-dev": {
"ext-filter": "*",
"ext-pcre": "*",
"phpunit/phpunit": "^4.8.35 || ^5.7.27"
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20"
},
"autoload": {
"psr-4": {
Expand Down
19 changes: 0 additions & 19 deletions tests/Dotenv/DotenvTest.php
Expand Up @@ -121,11 +121,6 @@ public function testDotenvLoadsServerGlobals()
$this->assertEmpty($_ENV['NULL']);
}

/**
* @depends testDotenvLoadsEnvironmentVars
* @depends testDotenvLoadsEnvGlobals
* @depends testDotenvLoadsServerGlobals
*/
public function testDotenvRequiredStringEnvironmentVars()
{
$dotenv = new Dotenv($this->fixturesFolder);
Expand All @@ -134,11 +129,6 @@ public function testDotenvRequiredStringEnvironmentVars()
$this->assertTrue(true); // anything wrong an exception will be thrown
}

/**
* @depends testDotenvLoadsEnvironmentVars
* @depends testDotenvLoadsEnvGlobals
* @depends testDotenvLoadsServerGlobals
*/
public function testDotenvRequiredArrayEnvironmentVars()
{
$dotenv = new Dotenv($this->fixturesFolder);
Expand All @@ -158,11 +148,6 @@ public function testDotenvNestedEnvironmentVars()
$this->assertSame('Special Value', $_ENV['NVAR7']); // nested '.' (dot) variable
}

/**
* @depends testDotenvLoadsEnvironmentVars
* @depends testDotenvLoadsEnvGlobals
* @depends testDotenvLoadsServerGlobals
*/
public function testDotenvAllowedValues()
{
$dotenv = new Dotenv($this->fixturesFolder);
Expand All @@ -172,10 +157,6 @@ public function testDotenvAllowedValues()
}

/**
* @depends testDotenvLoadsEnvironmentVars
* @depends testDotenvLoadsEnvGlobals
* @depends testDotenvLoadsServerGlobals
*
* @expectedException \Dotenv\Exception\ValidationException
* @expectedExceptionMessage One or more environment variables failed assertions: FOO is not an allowed value.
*/
Expand Down
3 changes: 2 additions & 1 deletion tests/Dotenv/ValidatorBooleanTest.php
@@ -1,8 +1,9 @@
<?php

use Dotenv\Dotenv;
use PHPUnit\Framework\TestCase;

class ValidatorBooleanTest extends PHPUnit_Framework_TestCase
class ValidatorBooleanTest extends TestCase
{
/**
* @var string
Expand Down

0 comments on commit 919c01a

Please sign in to comment.