Fix tests

This commit is contained in:
Bartek Fabiszewski 2019-02-28 11:03:41 +01:00
parent 7456617050
commit 33a9e30625
6 changed files with 71 additions and 14 deletions

View File

@ -41,7 +41,7 @@ abstract class BaseDatabaseTestCase extends PHPUnit_Extensions_Database_TestCase
public static function setUpBeforeClass() {
if (file_exists(__DIR__ . '/../.env')) {
$dotenv = new Dotenv\Dotenv(__DIR__ . '/..');
$dotenv = Dotenv\Dotenv::create(__DIR__ . '/..');
$dotenv->load();
$dotenv->required(['DB_DSN', 'DB_USER', 'DB_PASS']);
}

View File

@ -10,7 +10,7 @@ class UloggerAPITestCase extends BaseDatabaseTestCase {
public function setUp() {
parent::setUp();
if (file_exists(__DIR__ . '/../.env')) {
$dotenv = new Dotenv\Dotenv(__DIR__ . '/..');
$dotenv = Dotenv\Dotenv::create(__DIR__ . '/..');
$dotenv->load();
$dotenv->required(['ULOGGER_URL']);
}

View File

@ -12,7 +12,7 @@ class UloggerDatabaseTestCase extends BaseDatabaseTestCase {
parent::setUpBeforeClass();
if (file_exists(__DIR__ . '/../.env')) {
$dotenv = new Dotenv\Dotenv(__DIR__ . '/..');
$dotenv = Dotenv\Dotenv::create(__DIR__ . '/..');
$dotenv->load();
$dotenv->required(['DB_DSN', 'DB_USER', 'DB_PASS']);
}

View File

@ -3,8 +3,7 @@ language: php
sudo: required
php:
- 5.6
- 7.3
- 7.2
env:
matrix:

View File

@ -8,6 +8,8 @@
"require-dev": {
"phpunit/phpunit": "^5.7",
"vlucas/phpdotenv": "^3.3",
"guzzlehttp/guzzle": "^6.3"
"guzzlehttp/guzzle": "^6.3",
"phpunit/dbunit": "^2.0"
}
}

72
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "d0a42401c92b52fba7604da126e30ef1",
"content-hash": "e0409bcb302c1bef7caa031dafc841a9",
"packages": [
{
"name": "ulrichsg/getopt-php",
@ -604,6 +604,62 @@
],
"time": "2018-08-05T17:53:17+00:00"
},
{
"name": "phpunit/dbunit",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/dbunit.git",
"reference": "5c35d74549c21ba55d0ea74ba89d191a51f8cf25"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/5c35d74549c21ba55d0ea74ba89d191a51f8cf25",
"reference": "5c35d74549c21ba55d0ea74ba89d191a51f8cf25",
"shasum": ""
},
"require": {
"ext-pdo": "*",
"ext-simplexml": "*",
"php": "^5.4 || ^7.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0",
"symfony/yaml": "^2.1 || ^3.0"
},
"bin": [
"dbunit"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "DbUnit port for PHP/PHPUnit to support database interaction testing.",
"homepage": "https://github.com/sebastianbergmann/dbunit/",
"keywords": [
"database",
"testing",
"xunit"
],
"abandoned": true,
"time": "2016-12-02T14:39:14+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "4.0.8",
@ -1658,20 +1714,20 @@
},
{
"name": "symfony/yaml",
"version": "v4.2.3",
"version": "v3.4.22",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "d461670ee145092b7e2a56c1da7118f19cadadb0"
"reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/d461670ee145092b7e2a56c1da7118f19cadadb0",
"reference": "d461670ee145092b7e2a56c1da7118f19cadadb0",
"url": "https://api.github.com/repos/symfony/yaml/zipball/ba11776e9e6c15ad5759a07bffb15899bac75c2d",
"reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": "^5.5.9|>=7.0.8",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
@ -1686,7 +1742,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.2-dev"
"dev-master": "3.4-dev"
}
},
"autoload": {
@ -1713,7 +1769,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2019-01-16T20:35:37+00:00"
"time": "2019-01-16T10:59:17+00:00"
},
{
"name": "vlucas/phpdotenv",