-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from acquia/ACMS-3658
ACMS-3658: The drs:init:settings command shouldn't be called when DRS or BLT Updated.
- Loading branch information
Showing
13 changed files
with
412 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ drupal: | |
db: | ||
database: mydatabase | ||
multisites: | ||
- acms | ||
- acms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
|
||
namespace Acquia\Drupal\RecommendedSettings\Tests; | ||
|
||
use Acquia\Drupal\RecommendedSettings\Robo\Config\ConfigAwareTrait; | ||
use Acquia\Drupal\RecommendedSettings\Tests\Helpers\NullLogOutputStylers; | ||
use Consolidation\Log\Logger; | ||
use League\Container\Container; | ||
use PHPUnit\Framework\TestCase; | ||
use Psr\Container\ContainerInterface; | ||
use Robo\Collection\CollectionBuilder; | ||
use Robo\Common\BuilderAwareTrait; | ||
use Robo\Common\OutputAwareTrait; | ||
use Robo\Config\Config; | ||
use Robo\Robo; | ||
use Robo\Tasks; | ||
use Symfony\Component\Console\Output\NullOutput; | ||
|
||
/** | ||
* Base commands to test drush commands/tasks. | ||
*/ | ||
abstract class CommandsTestBase extends TestCase { | ||
use BuilderAwareTrait; | ||
use OutputAwareTrait; | ||
use ConfigAwareTrait; | ||
|
||
/** | ||
* Stores an instance of container object. | ||
*/ | ||
protected ContainerInterface $container; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function setUp(): void { | ||
parent::setUp(); | ||
$this->createContainer(); | ||
} | ||
|
||
/** | ||
* Initialize the Container. | ||
* | ||
* @param ContainerInterface|null $container | ||
* An instance of container object or NULL. | ||
*/ | ||
protected function createContainer(?ContainerInterface $container = NULL): void { | ||
if (!$container) { | ||
$container = new Container(); | ||
$output = new NullOutput(); | ||
$this->setOutput($output); | ||
|
||
$config = new Config(); | ||
$this->setConfig($config); | ||
$logger = new Logger($this->output()); | ||
$null_log_output = new NullLogOutputStylers; | ||
$logger->setLogOutputStyler($null_log_output); | ||
$container->add("logger", $logger); | ||
|
||
$app = Robo::createDefaultApplication("acquia/drupal-recommended-settings", "1.0.0"); | ||
Robo::configureContainer($container, $app, $this->getConfig()); | ||
|
||
$tasks = new Tasks(); | ||
$builder = CollectionBuilder::create($container, $tasks); | ||
$this->setBuilder($builder); | ||
$container->add("builder", $builder); | ||
} | ||
$this->container = $container; | ||
} | ||
|
||
/** | ||
* Returns an instance of container object. | ||
*/ | ||
protected function getContainer(): ContainerInterface { | ||
return $this->container; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Acquia\Drupal\RecommendedSettings\Tests\Helpers; | ||
|
||
use Consolidation\Log\SymfonyLogOutputStyler; | ||
|
||
/** | ||
* Class for not logging any error. | ||
*/ | ||
class NullLogOutputStylers extends SymfonyLogOutputStyler { | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
#[Override] | ||
public function error($symfonyStyle, $level, $message, $context): void { | ||
} | ||
|
||
} |
Oops, something went wrong.