Skip to content
Permalink
Browse files

[Tests] Provided autoconfiguration for API integration tests (#2534)

  • Loading branch information...
alongosz committed Feb 19, 2019
1 parent c53d48d commit 9e06bc9e004efb5a8173dbb844b4ce7407dbaf30
Showing with 7 additions and 5 deletions.
  1. +7 −5 Repository/Tests/BaseTest.php
@@ -11,6 +11,7 @@
use Doctrine\DBAL\Connection;
use eZ\Publish\API\Repository\Exceptions\ContentFieldValidationException;
use eZ\Publish\API\Repository\Tests\PHPUnitConstraint\ValidationErrorOccurs as PHPUnitConstraintValidationErrorOccurs;
use eZ\Publish\API\Repository\Tests\SetupFactory\Legacy;
use eZ\Publish\API\Repository\Values\Content\Language;
use EzSystems\EzPlatformSolrSearchEngine\Tests\SetupFactory\LegacySetupFactory as LegacySolrSetupFactory;
use PHPUnit\Framework\TestCase;
@@ -162,12 +163,13 @@ protected function getRepository($initialInitializeFromScratch = true)
protected function getSetupFactory()
{
if (null === $this->setupFactory) {
$setupClass = getenv('setupFactory');
if (false === ($setupClass = getenv('setupFactory'))) {
$setupClass = Legacy::class;
putenv("setupFactory=${setupClass}");
}
if (false === $setupClass) {
throw new \ErrorException(
'Missing mandatory environment variable "setupFactory", this should normally be set in the relevant phpunit-integration-*.xml file and refer to a setupFactory for the given StorageEngine/SearchEngine in use'
);
if (false === ($fixtureDir = getenv('fixtureDir'))) {
putenv('fixtureDir=Legacy');
}
if (false === class_exists($setupClass)) {

0 comments on commit 9e06bc9

Please sign in to comment.
You can’t perform that action at this time.