/** * Builds the settings.local.php file. */ public function __construct() { parent::__construct(); /** @var DrupalStackHelper $drupalStack */ $drupalStack = Toolstack::getStackByType('drupal'); $this->version = $drupalStack->version(Platform::webDir()); }
/** * @covers \mglaman\Toolstack\Stacks\Composer::getComposerData() */ public function testComposerData() { /** @var Stacks\Composer $stack */ $stack = Toolstack::getStackByType(Stacks\Composer::TYPE); $data = $stack->getComposerData($this->dir); $this->assertEquals(['require' => ['drupal/core' => 'dev-master']], $data); }
public function testBuilt() { /** @var Stacks\Drupal $stack */ $stack = Toolstack::getStackByType(Stacks\Drupal::TYPE); $this->assertTrue($stack->built($this->dir . '/d7')); $this->assertFalse($stack->built($this->dir . '/empty')); }
public function testGetStackByType() { // @todo this should probably be mocked for proper unit testing. $stack = Toolstack::getStackByType(Stacks\Composer::TYPE); $this->assertInstanceOf('\\mglaman\\Toolstack\\Stacks\\StacksInterface', $stack); $stack = Toolstack::getStackByType('SomeRandomey'); $this->assertNull($stack->type()); }
/** * Builds the settings.local.php file. */ public function __construct() { $this->projectName = Platform::projectName(); $this->containerName = Compose::getContainerName(Platform::projectName(), 'mariadb'); /** @var DrupalStackHelper $drupalStack */ $drupalStack = Toolstack::getStackByType('drupal'); $this->version = $drupalStack->version(Platform::webDir()); $this->string = "<?php\n\n"; $this->setSalt(); $this->dbFromLocal(); $this->dbFromDocker(); if ($this->version == DrupalStackHelper::DRUPAL8) { $this->string .= <<<EOT // Configuration directories. \$config_directories = array( CONFIG_ACTIVE_DIRECTORY => '../../../shared/config/active', CONFIG_STAGING_DIRECTORY => '../../../shared/config/staging', ); EOT; } }
public function testType() { /** @var Stacks\Symfony $stack */ $stack = Toolstack::getStackByType(Stacks\Symfony::TYPE); $this->assertEquals($stack->type(), Stacks\Symfony::TYPE); }