Skip to content

Commit

Permalink
Move stubs directory to the project root (#518)
Browse files Browse the repository at this point in the history
* Move stubs directory to the `/resources
This allows to keep only php files in the src/ directory and actually
it is more friendly for people looking for the stubs files to find
them in the project root.
  • Loading branch information
roberto-aguilar authored and svpernova09 committed Mar 13, 2017
1 parent de8a70f commit 4afb6ee
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/MakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function vagrantfileExists()
*/
protected function createVagrantfile()
{
copy(__DIR__.'/stubs/LocalizedVagrantfile', "{$this->basePath}/Vagrantfile");
copy(__DIR__.'/../resources/LocalizedVagrantfile', "{$this->basePath}/Vagrantfile");
}

/**
Expand All @@ -143,7 +143,7 @@ protected function aliasesFileExists()
*/
protected function createAliasesFile()
{
copy(__DIR__.'/stubs/aliases', "{$this->basePath}/aliases");
copy(__DIR__.'/../resources/aliases', "{$this->basePath}/aliases");
}

/**
Expand All @@ -163,7 +163,7 @@ protected function afterShellScriptExists()
*/
protected function createAfterShellScript()
{
copy(__DIR__.'/stubs/after.sh', "{$this->basePath}/after.sh");
copy(__DIR__.'/../resources/after.sh', "{$this->basePath}/after.sh");
}

/**
Expand All @@ -190,7 +190,7 @@ protected function createSettingsFile($format, $options)

$filename = $this->exampleSettingsExists($format) ?
"{$this->basePath}/Homestead.{$format}.example" :
__DIR__."/stubs/Homestead.{$format}";
__DIR__."/../resources/Homestead.{$format}";

$settings = $SettingsClass::fromFile($filename);

Expand Down
10 changes: 5 additions & 5 deletions tests/MakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function a_vagrantfile_is_created_if_it_does_not_exists()
);
$this->assertEquals(
file_get_contents(self::$testFolder.DIRECTORY_SEPARATOR.'Vagrantfile'),
file_get_contents(__DIR__.'/../src/stubs/LocalizedVagrantfile')
file_get_contents(__DIR__.'/../resources/LocalizedVagrantfile')
);
}

Expand Down Expand Up @@ -102,7 +102,7 @@ public function an_aliases_file_is_created_if_requested()
file_exists(self::$testFolder.DIRECTORY_SEPARATOR.'aliases')
);
$this->assertEquals(
file_get_contents(__DIR__.'/../src/stubs/aliases'),
file_get_contents(__DIR__.'/../resources/aliases'),
file_get_contents(self::$testFolder.DIRECTORY_SEPARATOR.'aliases')
);
}
Expand Down Expand Up @@ -142,7 +142,7 @@ public function an_after_shell_script_is_created_if_requested()
file_exists(self::$testFolder.DIRECTORY_SEPARATOR.'after.sh')
);
$this->assertEquals(
file_get_contents(__DIR__.'/../src/stubs/after.sh'),
file_get_contents(__DIR__.'/../resources/after.sh'),
file_get_contents(self::$testFolder.DIRECTORY_SEPARATOR.'after.sh')
);
}
Expand Down Expand Up @@ -327,7 +327,7 @@ public function a_homestead_yaml_settings_is_created_from_a_homestead_yaml_examp
public function a_homestead_yaml_settings_created_from_a_homestead_yaml_example_can_override_the_ip_address()
{
copy(
__DIR__.'/../src/stubs/Homestead.yaml',
__DIR__.'/../resources/Homestead.yaml',
self::$testFolder.DIRECTORY_SEPARATOR.'Homestead.yaml.example'
);

Expand Down Expand Up @@ -369,7 +369,7 @@ public function a_homestead_json_settings_is_created_from_a_homestead_json_examp
public function a_homestead_json_settings_created_from_a_homestead_json_example_can_override_the_ip_address()
{
copy(
__DIR__.'/../src/stubs/Homestead.json',
__DIR__.'/../resources/Homestead.json',
self::$testFolder.DIRECTORY_SEPARATOR.'Homestead.json.example'
);

Expand Down
2 changes: 1 addition & 1 deletion tests/Settings/JsonSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function tearDown()
/** @test */
public function it_can_be_created_from_a_filename()
{
$settings = JsonSettings::fromFile(__DIR__.'/../../src/stubs/Homestead.json');
$settings = JsonSettings::fromFile(__DIR__.'/../../resources/Homestead.json');

$attributes = $settings->toArray();
$this->assertEquals('192.168.10.10', $attributes['ip']);
Expand Down
2 changes: 1 addition & 1 deletion tests/Settings/YamlSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function tearDown()
/** @test */
public function it_can_be_created_from_a_filename()
{
$settings = YamlSettings::fromFile(__DIR__.'/../../src/stubs/Homestead.yaml');
$settings = YamlSettings::fromFile(__DIR__.'/../../resources/Homestead.yaml');

$attributes = $settings->toArray();
$this->assertEquals('192.168.10.10', $attributes['ip']);
Expand Down

0 comments on commit 4afb6ee

Please sign in to comment.