-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lander Vanderstraeten
committed
Feb 27, 2019
1 parent
a23e8db
commit 4a45a25
Showing
10 changed files
with
205 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
|
||
namespace spec\GrumPHP\Util; | ||
|
||
use GrumPHP\Util\ComposerFile; | ||
use PhpSpec\ObjectBehavior; | ||
|
||
class ComposerFileSpec extends ObjectBehavior | ||
{ | ||
function it_is_initializable() | ||
{ | ||
$this->beConstructedWith([ | ||
'config' => [ | ||
'sort-packages' => true, | ||
] | ||
]); | ||
$this->shouldHaveType(ComposerFile::class); | ||
} | ||
|
||
function it_should_create_itself_from_a_composer_file_location() | ||
{ | ||
$this->beConstructedThrough('createFrom', ['composer.json']); | ||
$this->ensureProjectBinDirInSystemPath()->shouldBe(true); | ||
} | ||
|
||
function it_should_have_a_default_bin_dir() | ||
{ | ||
$this->beConstructedWith([ | ||
'config' => [ | ||
'sort-packages' => true, | ||
] | ||
]); | ||
|
||
$this->getBinDir()->shouldBe('vendor/bin'); | ||
} | ||
|
||
function it_should_have_a_custom_bin_dir() | ||
{ | ||
$this->beConstructedWith([ | ||
'config' => [ | ||
'sort-packages' => true, | ||
'bin-dir' => 'bin' | ||
] | ||
]); | ||
|
||
$this->getBinDir()->shouldBe('bin'); | ||
} | ||
|
||
function it_should_have_a_default_config_path() | ||
{ | ||
$this->beConstructedWith([ | ||
'config' => [ | ||
'sort-packages' => true, | ||
] | ||
]); | ||
|
||
$this->getConfigDefaultPath()->shouldBe(null); | ||
} | ||
|
||
function it_should_have_a_custom_config_path() | ||
{ | ||
$this->beConstructedWith([ | ||
'config' => [ | ||
'sort-packages' => true, | ||
], | ||
'extra' => [ | ||
'grumphp' => [ | ||
'config-default-path' => 'some/folder' | ||
] | ||
] | ||
]); | ||
|
||
$this->getConfigDefaultPath()->shouldBe('some/folder'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.