Skip to content

Commit

Permalink
Merge pull request #88 from happyDemon/composer-test
Browse files Browse the repository at this point in the history
Added test that validates a new package is added to composer.json
  • Loading branch information
Jeroen-G committed Dec 22, 2019
2 parents 8aabcaa + 01aa982 commit 5be28b9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/IntegratedTest.php
Expand Up @@ -13,6 +13,15 @@ public function test_new_package_is_created()
$this->seeInConsoleOutput('Package created successfully!');
}

public function test_new_package_is_installed()
{
Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']);

$composer = file_get_contents(base_path('composer.json'));

$this->assertStringContainsString('MyVendor/MyPackage', $composer);
}

public function test_get_existing_package()
{
Artisan::call('packager:get',
Expand All @@ -37,4 +46,14 @@ public function test_removing_package()
Artisan::call('packager:remove', ['vendor' => 'MyVendor', 'name' => 'MyPackage', '--no-interaction' => true]);
$this->seeInConsoleOutput('Package removed successfully!');
}

public function test_new_package_is_uninstalled()
{
Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']);
Artisan::call('packager:remove', ['vendor' => 'MyVendor', 'name' => 'MyPackage', '--no-interaction' => true]);

$composer = file_get_contents(base_path('composer.json'));

$this->assertStringNotContainsString('MyVendor/MyPackage', $composer);
}
}

0 comments on commit 5be28b9

Please sign in to comment.