forked from laravel/homestead
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInitScriptTest.php
62 lines (47 loc) · 1.4 KB
/
InitScriptTest.php
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
namespace Tests;
use PHPUnit\Framework\TestCase;
use Tests\Traits\GeneratesTestDirectory;
class InitScriptTest extends TestCase
{
use GeneratesTestDirectory;
/**
* Copies init.sh and resources directory to the temporal directory.
*/
public function setUp()
{
$projectDirectory = __DIR__.'/..';
exec("cp {$projectDirectory}/init.sh ".self::$testDirectory);
exec("cp -r {$projectDirectory}/resources ".self::$testDirectory);
}
/** @test */
public function it_displays_a_success_message()
{
$output = exec('bash init.sh');
$this->assertEquals('Homestead initialized!', $output);
}
/** @test */
public function it_creates_a_homestead_yaml_file()
{
exec('bash init.sh');
$this->assertFileExists(self::$testDirectory.'/Homestead.yaml');
}
/** @test */
public function it_creates_a_homestead_json_file_if_requested()
{
exec('bash init.sh json');
$this->assertFileExists(self::$testDirectory.'/Homestead.json');
}
/** @test */
public function it_creates_an_after_shell_script()
{
exec('bash init.sh');
$this->assertFileExists(self::$testDirectory.'/after.sh');
}
/** @test */
public function it_creates_an_aliases_file()
{
exec('bash init.sh');
$this->assertFileExists(self::$testDirectory.'/aliases');
}
}