revert and fix phpunit
This commit is contained in:
parent
beb64c6470
commit
b671dd3e1c
4 changed files with 41 additions and 33 deletions
|
|
@ -32,8 +32,6 @@
|
|||
</testsuites>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
|
||||
<env name="DB_CONNECTION" value="sqlite"/>
|
||||
<env name="DB_DATABASE" value=":memory:"/>
|
||||
<env name="DB_CONNECTION" value="testing"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
|
|
|
|||
|
|
@ -15,37 +15,9 @@ use Kwaadpepper\Enum\Tests\Enums\NotRoutableEnum;
|
|||
use Kwaadpepper\Enum\Tests\Models\Alarm;
|
||||
use Kwaadpepper\Enum\Tests\Models\Journal;
|
||||
use Kwaadpepper\Enum\Tests\Models\Report;
|
||||
use Orchestra\Testbench\TestCase;
|
||||
|
||||
class BaseEnumRoutableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Setup custom phpunit catch for deprecated error cathing.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
set_error_handler(
|
||||
static function ($errno, $errstr) {
|
||||
throw new \Exception($errstr, $errno);
|
||||
},
|
||||
E_ALL
|
||||
);
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore phpunit handler
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
restore_error_handler();
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines aliases
|
||||
*
|
||||
|
|
@ -78,7 +50,6 @@ class BaseEnumRoutableTest extends TestCase
|
|||
{
|
||||
// phpcs:enable
|
||||
return [
|
||||
\Illuminate\Log\LogServiceProvider::class,
|
||||
\Kwaadpepper\Enum\EnumServiceProvider::class,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ use Kwaadpepper\Enum\Tests\Enums\DuplicatedLabels;
|
|||
use Kwaadpepper\Enum\Tests\Enums\DuplicatedValues;
|
||||
use Kwaadpepper\Enum\Tests\Enums\ForceStringsFromInteger;
|
||||
use Kwaadpepper\Enum\Tests\Models\Report;
|
||||
use Orchestra\Testbench\TestCase;
|
||||
|
||||
class BaseEnumTest extends TestCase
|
||||
{
|
||||
|
|
|
|||
40
tests/TestCase.php
Normal file
40
tests/TestCase.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace Kwaadpepper\Enum\Tests;
|
||||
|
||||
abstract class TestCase extends \Orchestra\Testbench\TestCase
|
||||
{
|
||||
/**
|
||||
* Automatically loads environment file if available.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $loadEnvironmentVariables = false;
|
||||
|
||||
/**
|
||||
* Setup custom phpunit catch for deprecated error cathing.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
set_error_handler(
|
||||
static function ($errno, $errstr) {
|
||||
throw new \Exception($errstr, $errno);
|
||||
},
|
||||
E_ALL
|
||||
);
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore phpunit handler
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
restore_error_handler();
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue