示例#1
0
 /**
  * Builds the settings.local.php file.
  */
 public function __construct()
 {
     parent::__construct();
     /** @var DrupalStackHelper $drupalStack */
     $drupalStack = Toolstack::getStackByType('drupal');
     $this->version = $drupalStack->version(Platform::webDir());
 }
示例#2
0
 /**
  * @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);
 }
示例#3
0
 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());
 }
示例#5
0
    /**
     * 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;
        }
    }
示例#6
0
 public function testType()
 {
     /** @var Stacks\Symfony $stack */
     $stack = Toolstack::getStackByType(Stacks\Symfony::TYPE);
     $this->assertEquals($stack->type(), Stacks\Symfony::TYPE);
 }