2020-05-14 23:43:02 +02:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace MonarcAppFo\Tests\Integration;
|
|
|
|
|
|
|
|
use Laminas\ServiceManager\ServiceManager;
|
|
|
|
use Laminas\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;
|
|
|
|
|
|
|
|
abstract class AbstractIntegrationTestCase extends AbstractHttpControllerTestCase
|
|
|
|
{
|
2020-05-18 23:56:07 +02:00
|
|
|
/** @var string */
|
|
|
|
protected $testPath;
|
|
|
|
|
2020-05-14 23:43:02 +02:00
|
|
|
protected function setUp(): void
|
|
|
|
{
|
2020-05-18 23:56:07 +02:00
|
|
|
$this->testPath = getenv('TESTS_DIR');
|
|
|
|
|
|
|
|
$this->setApplicationConfig(require dirname($this->testPath) . '/config/application.config.php');
|
2020-05-14 23:43:02 +02:00
|
|
|
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$this->configureServiceManager($this->getApplicationServiceLocator());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function setUpBeforeClass(): void
|
|
|
|
{
|
|
|
|
// Creates the DB with initial data, executes all the migrations.
|
|
|
|
shell_exec(getenv('TESTS_DIR') . '/scripts/setup_db.sh');
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function tearDownAfterClass(): void
|
|
|
|
{
|
2020-05-18 23:56:07 +02:00
|
|
|
shell_exec(getenv('TESTS_DIR') . '/scripts/clean_client_database.sh');
|
|
|
|
}
|
|
|
|
|
|
|
|
protected static function createMyPrintTestData(): void
|
|
|
|
{
|
|
|
|
shell_exec(getenv('TESTS_DIR') . '/scripts/insert_my_print_anrs.sh');
|
2020-05-14 23:43:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function configureServiceManager(ServiceManager $serviceManager)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|