<?php

declare(strict_types=1);

/*
 * This file is part of SolidInvoice project.
 *
 * (c) 2013-2017 Pierre du Plessis <info@customscripts.co.za>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace SolidInvoice\CoreBundle\Tests;

use SolidInvoice\Kernel;
use Doctrine\ORM\EntityManager;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Container;

abstract class KernelAwareTest extends TestCase
{
    use MockeryPHPUnitIntegration;

    /**
     * @var Kernel
     */
    protected $kernel;

    /**
     * @var EntityManager
     */
    protected $entityManager;

    /**
     * @var Container
     */
    protected $container;

    public function setUp(): void
    {
        $this->kernel = new Kernel('test', true);
        $this->kernel->boot();

        $this->container = $this->kernel->getContainer();

        parent::setUp();
    }

    public function tearDown(): void
    {
        $this->kernel->shutdown();

        parent::tearDown();
    }
}

<?php

declare(strict_types=1);

/*
 * This file is part of SolidInvoice project.
 *
 * (c) 2013-2017 Pierre du Plessis <info@customscripts.co.za>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace SolidInvoice\CoreBundle\Tests;

use AppKernel;
use Doctrine\ORM\EntityManager;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Container;

require_once __DIR__.'/../../../app/AppKernel.php';

abstract class KernelAwareTest extends TestCase
{
    use MockeryPHPUnitIntegration;

    /**
     * @var AppKernel
     */
    protected $kernel;

    /**
     * @var EntityManager
     */
    protected $entityManager;

    /**
     * @var Container
     */
    protected $container;

    public function setUp(): void
    {
        $this->kernel = new AppKernel('test', true);
        $this->kernel->boot();

        $this->container = $this->kernel->getContainer();

        parent::setUp();
    }

    public function tearDown(): void
    {
        $this->kernel->shutdown();

        parent::tearDown();
    }
}

--- 
+++ 
@@ -13,20 +13,18 @@
 
 namespace SolidInvoice\CoreBundle\Tests;
 
-use AppKernel;
+use SolidInvoice\Kernel;
 use Doctrine\ORM\EntityManager;
 use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
 use PHPUnit\Framework\TestCase;
 use Symfony\Component\DependencyInjection\Container;
-
-require_once __DIR__.'/../../../app/AppKernel.php';
 
 abstract class KernelAwareTest extends TestCase
 {
     use MockeryPHPUnitIntegration;
 
     /**
-     * @var AppKernel
+     * @var Kernel
      */
     protected $kernel;
 
@@ -42,7 +40,7 @@
 
     public function setUp(): void
     {
-        $this->kernel = new AppKernel('test', true);
+        $this->kernel = new Kernel('test', true);
         $this->kernel->boot();
 
         $this->container = $this->kernel->getContainer();
Fix KernalAwareTest to use the correct kernel
