-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathHandlerTest.php
More file actions
42 lines (36 loc) · 1.44 KB
/
HandlerTest.php
File metadata and controls
42 lines (36 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @file
* Contains \DrupalComposer\DrupalScaffold\Tests\HandlerTest.
*/
namespace DrupalComposer\DrupalScaffold\Tests;
/**
* Tests composer plugin functionality.
*/
class HandlerTest extends BaseTest {
/**
* Tests that files for dev environments are downloaded only in dev mode.
*/
public function testDevFiles() {
$exampleScaffoldFile = $this->tmpDir . DIRECTORY_SEPARATOR . 'index.php';
$developmentScaffoldFile = $this->tmpDir . DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . 'development.services.yml';
$this->assertFileNotExists($exampleScaffoldFile, 'Scaffold file should not exist.');
$this->assertFileNotExists($developmentScaffoldFile, 'Development scaffold file should not exist.');
$this->composer('install --no-dev');
$this->assertFileExists($exampleScaffoldFile, 'Scaffold file should exist.');
$this->assertFileNotExists($developmentScaffoldFile, 'Development scaffold file should not exist.');
$this->composer('drupal:scaffold');
$this->assertFileExists($exampleScaffoldFile, 'Scaffold file should exist.');
$this->assertFileExists($developmentScaffoldFile, 'Development scaffold file should exist.');
}
/**
* Add prefer-stable true to speed up tests.
*
* @return array
*/
protected function composerJSONDefaults() {
$composerJsonDefault = parent::composerJSONDefaults();
$composerJsonDefault['prefer-stable'] = TRUE;
return $composerJsonDefault;
}
}