diff --git a/.gitignore b/.gitignore index 93c7248..73fd4b1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ vendor build composer.phar composer.lock -.phpunit.result.cache +/.phpunit.cache report .DS_Store *.sublime-project diff --git a/tests/IntegratedTest.php b/tests/IntegratedTest.php index d2f438d..eed81ce 100644 --- a/tests/IntegratedTest.php +++ b/tests/IntegratedTest.php @@ -4,9 +4,9 @@ use Illuminate\Support\Facades\Artisan; -class IntegratedTest extends TestCase +final class IntegratedTest extends TestCase { - public function test_new_package_is_created() + public function test_new_package_is_created(): void { Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']); @@ -14,7 +14,7 @@ public function test_new_package_is_created() $this->assertTrue(is_dir(base_path('packages/MyVendor/MyPackage'))); } - public function test_new_package_symlink_is_created() + public function test_new_package_symlink_is_created(): void { Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']); @@ -28,7 +28,7 @@ public function test_new_package_symlink_is_created() $this->assertTrue(is_link(base_path('vendor/myvendor/mypackage'))); } - public function test_new_package_is_installed() + public function test_new_package_is_installed(): void { Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']); @@ -37,7 +37,7 @@ public function test_new_package_is_installed() $this->assertStringContainsString('MyVendor/MyPackage', $composer); } - public function test_new_package_studly_install() + public function test_new_package_studly_install(): void { Artisan::call('packager:new', ['vendor' => 'my-vendor', 'name' => 'my-package']); @@ -46,14 +46,14 @@ public function test_new_package_studly_install() $this->assertTrue(is_file(base_path('packages/my-vendor/my-package/src/MyPackageServiceProvider.php'))); } - public function test_new_package_name_should_be_valid() + public function test_new_package_name_should_be_valid(): void { Artisan::call('packager:new', ['vendor' => 'my-vendor', 'name' => '1234-Invalid']); $this->seeInConsoleOutput('Package was not created. Please choose a valid name.'); $this->assertFalse(is_file(base_path('packages/my-vendor/4-Invalid/src/1234InvalidServiceProvider.php'))); } - public function test_new_package_name_in_interactive_mode_should_be_valid() + public function test_new_package_name_in_interactive_mode_should_be_valid(): void { $this->artisan('packager:new', ['--i' => true]) ->expectsQuestion('What will be the vendor name?', 'my-vendor') @@ -64,14 +64,14 @@ public function test_new_package_name_in_interactive_mode_should_be_valid() $this->assertFalse(is_file(base_path('packages/my-vendor/4-Invalid/src/1234InvalidServiceProvider.php'))); } - public function test_new_package_vendor_name_should_be_valid() + public function test_new_package_vendor_name_should_be_valid(): void { Artisan::call('packager:new', ['vendor' => '1234-invalid', 'name' => 'my-package']); $this->seeInConsoleOutput('Package was not created. Please choose a valid name.'); $this->assertFalse(is_file(base_path('packages/1234-invalid/my-package/src/MyPackageServiceProvider.php'))); } - public function test_new_package_vendor_name_in_interactive_mode_should_be_valid() + public function test_new_package_vendor_name_in_interactive_mode_should_be_valid(): void { $this->artisan('packager:new', ['--i' => true]) ->expectsQuestion('What will be the vendor name?', '1234-invalid') @@ -82,7 +82,7 @@ public function test_new_package_vendor_name_in_interactive_mode_should_be_valid $this->assertFalse(is_file(base_path('packages/my-vendor/4-Invalid/src/1234InvalidServiceProvider.php'))); } - public function test_new_package_is_installed_from_custom_skeleton() + public function test_new_package_is_installed_from_custom_skeleton(): void { Artisan::call('packager:new', [ 'vendor' => 'AnotherVendor', @@ -95,7 +95,7 @@ public function test_new_package_is_installed_from_custom_skeleton() $this->assertStringContainsString('AnotherVendor/AnotherPackage', $composer); } - public function test_get_package() + public function test_get_package(): void { Artisan::call('packager:get', ['url' => 'https://github.com/Jeroen-G/packager-skeleton', 'vendor' => 'MyVendor', 'name' => 'MyPackage']); @@ -103,7 +103,7 @@ public function test_get_package() $this->seeInConsoleOutput('Package downloaded successfully!'); } - public function test_get_existing_package_with_git() + public function test_get_existing_package_with_git(): void { Artisan::call('packager:git', ['url' => 'https://github.com/Seldaek/monolog', 'vendor' => 'monolog', 'name' => 'monolog']); @@ -112,7 +112,7 @@ public function test_get_existing_package_with_git() $this->assertTrue(is_link(base_path('vendor/monolog/monolog'))); } - public function test_get_existing_package_with_get() + public function test_get_existing_package_with_get(): void { Artisan::call('packager:get', ['url' => 'https://github.com/Seldaek/monolog', 'vendor' => 'monolog', 'name' => 'monolog', '--branch' => 'main']); @@ -121,7 +121,7 @@ public function test_get_existing_package_with_get() $this->assertTrue(is_link(base_path('vendor/monolog/monolog'))); } - public function test_list_packages() + public function test_list_packages(): void { Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']); Artisan::call('packager:list'); @@ -129,7 +129,7 @@ public function test_list_packages() $this->seeInConsoleOutput('MyVendor'); } - public function test_removing_package() + public function test_removing_package(): void { Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']); $this->seeInConsoleOutput('MyVendor'); @@ -138,7 +138,7 @@ public function test_removing_package() $this->seeInConsoleOutput('Package removed successfully!'); } - public function test_new_package_is_uninstalled() + public function test_new_package_is_uninstalled(): void { Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']); Artisan::call('packager:remove', ['vendor' => 'MyVendor', 'name' => 'MyPackage', '--no-interaction' => true]); diff --git a/tests/SkeletonArchiveExtractorsTest.php b/tests/SkeletonArchiveExtractorsTest.php index 15f2eee..e2459c0 100644 --- a/tests/SkeletonArchiveExtractorsTest.php +++ b/tests/SkeletonArchiveExtractorsTest.php @@ -5,9 +5,9 @@ use Illuminate\Config\Repository; use Illuminate\Support\Facades\Artisan; -class SkeletonArchiveExtractorsTest extends TestCase +final class SkeletonArchiveExtractorsTest extends TestCase { - public function test_new_package_is_created_with_tar_gz_skeleton() + public function test_new_package_is_created_with_tar_gz_skeleton(): void { Artisan::call('packager:new', ['vendor' => 'MyVendor', 'name' => 'MyPackage']); diff --git a/tests/TestCase.php b/tests/TestCase.php index 8c020e6..0e50346 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -27,7 +27,7 @@ protected function getBasePath() /** * Setup before each test. */ - public function setUp(): void + protected function setUp(): void { $this->installTestApp(); parent::setUp(); @@ -36,7 +36,7 @@ public function setUp(): void /** * Tear down after each test. */ - public function tearDown(): void + protected function tearDown(): void { $this->uninstallTestApp(); parent::tearDown();