-
Notifications
You must be signed in to change notification settings - Fork 189
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
Zlatoslav Desyatnikov
committed
Oct 10, 2019
1 parent
4842844
commit da12679
Showing
3 changed files
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace JeroenG\Packager\Tests; | ||
|
||
use Illuminate\Support\Facades\Artisan; | ||
|
||
class TestCustomComposerJsonName extends TestCase | ||
{ | ||
public function test_new_package_is_created_with_custom_composer_json() | ||
{ | ||
// Create custom composer.json | ||
$composerJsonPath = self::TEST_APP.'/composer.local.json'; | ||
file_put_contents($composerJsonPath, '{}'); | ||
|
||
Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']); | ||
|
||
$this->seeInConsoleOutput('Package created successfully!'); | ||
|
||
// Check repositories entry in composer.local.json | ||
$composerJsonContent = json_decode(file_get_contents($composerJsonPath), true); | ||
$this->assertArrayHasKey('repositories', $composerJsonContent); | ||
$this->assertIsArray($composerJsonContent['repositories']['myvendor-mypackage']); | ||
} | ||
|
||
protected function getEnvironmentSetUp($app) | ||
{ | ||
$app['config']->set('packager.composer_json_filename', 'composer.local.json'); | ||
} | ||
} |