Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/Model.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ actor: ModelTester
modules:
enabled:
- \Pimcore\Tests\Support\Helper\Pimcore:
connect_db: true
connect_db: true
- \Pimcore\Tests\Support\Helper\ClassManager
- \Pimcore\Tests\Support\Helper\Model
- \Pimcore\Tests\Support\Helper\CoreModel
4 changes: 2 additions & 2 deletions tests/Service.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ actor: ServiceTester
modules:
enabled:
- \Pimcore\Tests\Support\Helper\Pimcore:
connect_db: true
connect_db: true
- \Pimcore\Tests\Support\Helper\ClassManager
- \Pimcore\Tests\Support\Helper\Model
- \Pimcore\Tests\Support\Helper\CoreModel
54 changes: 54 additions & 0 deletions tests/Support/Helper/CoreModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);

/**
* This source file is available under the terms of the
* Pimcore Open Core License (POCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)
* @license Pimcore Open Core License (POCL)
*/

namespace Pimcore\Tests\Support\Helper;

use Pimcore\Bundle\SeoBundle\Installer;
use Pimcore\Bundle\SeoBundle\Model\Redirect;
use Pimcore\Tests\Support\Util\Autoloader;

class CoreModel extends Model
{
public function _beforeSuite(array $settings = []): void
{
parent::_beforeSuite($settings);
$this->installSeoBundle();
$this->installSimpleBackendSearchBundle();
}

private function installSeoBundle(): void
{
/** @var Pimcore $pimcoreModule */
$pimcoreModule = $this->getModule('\\'.Pimcore::class);

$this->debug('[PimcoreSeoBundle] Running SeoBundle installer');

// install ecommerce framework
$installer = $pimcoreModule->getContainer()->get(Installer::class);
$installer->install();

//explicitly load installed classes so that the new ones are used during tests
Autoloader::load(Redirect::class);
}

private function installSimpleBackendSearchBundle(): void
{
/** @var Pimcore $pimcoreModule */
$pimcoreModule = $this->getModule('\\'.Pimcore::class);

$this->debug('[PimcoreSimpleBackendSearchBundle] Running SimpleBackendSearchBundle installer');

$installer = $pimcoreModule->getContainer()->get(\Pimcore\Bundle\SimpleBackendSearchBundle\Installer::class);
$installer->install();
}
}
31 changes: 0 additions & 31 deletions tests/Support/Helper/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,16 @@
namespace Pimcore\Tests\Support\Helper;

use Exception;
use Pimcore\Bundle\SeoBundle\Installer;
use Pimcore\Bundle\SeoBundle\Model\Redirect;
use Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\ClassDefinition;
use Pimcore\Model\DataObject\Fieldcollection\Definition;
use Pimcore\Tests\Support\Util\Autoloader;

class Model extends AbstractDefinitionHelper
{
public function _beforeSuite(array $settings = []): void
{
DataObject::setHideUnpublished(false);
parent::_beforeSuite($settings);
$this->installSeoBundle();
$this->installSimpleBackendSearchBundle();
}

/**
Expand Down Expand Up @@ -1037,30 +1032,4 @@ public function setupQuantityValueUnits(): void
$this->setupUnit('m');
$this->setupUnit('km');
}

private function installSeoBundle(): void
{
/** @var Pimcore $pimcoreModule */
$pimcoreModule = $this->getModule('\\'.Pimcore::class);

$this->debug('[PimcoreSeoBundle] Running SeoBundle installer');

// install ecommerce framework
$installer = $pimcoreModule->getContainer()->get(Installer::class);
$installer->install();

//explicitly load installed classes so that the new ones are used during tests
Autoloader::load(Redirect::class);
}

private function installSimpleBackendSearchBundle(): void
{
/** @var Pimcore $pimcoreModule */
$pimcoreModule = $this->getModule('\\'.Pimcore::class);

$this->debug('[PimcoreSimpleBackendSearchBundle] Running SimpleBackendSearchBundle installer');

$installer = $pimcoreModule->getContainer()->get(\Pimcore\Bundle\SimpleBackendSearchBundle\Installer::class);
$installer->install();
}
}
2 changes: 1 addition & 1 deletion tests/Unit.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ modules:
connect_db: true
- \Pimcore\Tests\Support\Helper\Unit
- \Pimcore\Tests\Support\Helper\ClassManager
- \Pimcore\Tests\Support\Helper\Model
- \Pimcore\Tests\Support\Helper\CoreModel