BaseTestCase: Inherit from `Mockery\Adapter\Phpunit\MockeryTestCase`

This commit is contained in:
Johannes Meyer 2021-04-09 10:11:41 +02:00
parent cb87190138
commit bc1c967dec
4 changed files with 1 additions and 63 deletions

View File

@ -23,7 +23,6 @@ namespace Icinga\Test {
use Exception;
use RuntimeException;
use Mockery;
use PHPUnit_Framework_TestCase;
use Icinga\Application\Icinga;
use Icinga\Data\ConfigObject;
use Icinga\Data\ResourceFactory;
@ -32,7 +31,7 @@ namespace Icinga\Test {
/**
* Class BaseTestCase
*/
abstract class BaseTestCase extends PHPUnit_Framework_TestCase implements DbTest
abstract class BaseTestCase extends Mockery\Adapter\Phpunit\MockeryTestCase implements DbTest
{
/**
* Path to application/

View File

@ -36,10 +36,6 @@ if (file_exists($vendorAutoload)) {
require_once($icingaLibPath . '/Test/ClassLoader.php');
if (! class_exists('PHPUnit_Framework_TestCase')) {
require_once __DIR__ . '/phpunit-compat.php';
}
$loader = new Icinga\Test\ClassLoader();
$loader->registerNamespace('Tests', $testLibraryPath);
$loader->registerNamespace('Icinga', $icingaLibPath);

View File

@ -1,15 +0,0 @@
<?php
/**
* @codingStandardsIgnoreStart
*/
class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase
{
}
interface PHPUnit_Framework_Test extends \PHPUnit\Framework\Test
{
}
interface PHPUnit_Framework_TestListener extends \PHPUnit\Framework\TestListener
{
}

View File

@ -1,42 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */
namespace Tests\Icinga\Regression;
use Icinga\Test\BaseTestCase;
/**
* Class Bug4102
*
* Bogus regression test
*
* @see https://dev.icinga.com/issues/4102
*/
class Bug4102Test extends BaseTestCase
{
/**
* Test class name to match definition
*/
public function testClassName()
{
$class = get_class($this);
$this->assertContains('Bug4102Test', $class);
}
/**
* Test namespace to match definition
*/
public function testNamespace()
{
$namespace = __NAMESPACE__;
$this->assertEquals('Tests\Icinga\Regression', $namespace);
}
/**
* Test phpunit inheritance
*/
public function testInheritance()
{
$this->assertInstanceOf('\PHPUnit_Framework_TestCase', $this);
}
}