From fc65225a93bd8c0e5255427ad45ae5e91ad48d06 Mon Sep 17 00:00:00 2001 From: Marcus Olsson Date: Fri, 4 Nov 2016 09:15:20 +0100 Subject: [PATCH 1/2] Minor cleanup and corrections. --- src/Http/Controllers/HumansController.php | 4 ++ src/ServiceProvider.php | 11 +--- src/resources/views/humans.blade.php | 2 +- tests/HumansTest.php | 71 ++++++++++++----------- 4 files changed, 43 insertions(+), 45 deletions(-) diff --git a/src/Http/Controllers/HumansController.php b/src/Http/Controllers/HumansController.php index 28f379d..3b9c601 100644 --- a/src/Http/Controllers/HumansController.php +++ b/src/Http/Controllers/HumansController.php @@ -6,6 +6,10 @@ class HumansController extends Controller { + /** + * Return a text/plain-response with humans-view + * @return response + */ public function humans() { return response() diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 30fa5ae..d7f6688 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -9,6 +9,7 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider */ public function boot(\Illuminate\Routing\Router $router) { + // Unless routes are cached, load the routes.php-file if (! $this->app->routesAreCached()) { require __DIR__ . '/Http/routes.php'; } @@ -21,14 +22,4 @@ public function boot(\Illuminate\Routing\Router $router) __DIR__ . '/resources/stubs' => resource_path('views/vendor/humans'), ], 'views'); } - - /** - * Register any package services. - * - * @return void - */ - public function register() - { - // - } } diff --git a/src/resources/views/humans.blade.php b/src/resources/views/humans.blade.php index 9da3c35..a22f991 100644 --- a/src/resources/views/humans.blade.php +++ b/src/resources/views/humans.blade.php @@ -2,7 +2,7 @@ If you have not yet run: -$ php artisan vendor:publish --provider="Olssonm\Humans\ServiceProvider" + $ php artisan vendor:publish --provider="Olssonm\Humans\ServiceProvider" Please do so. A customizable humans.blade.php will then be placed in your views-directory -> /vendor/humans/humans.txt. diff --git a/tests/HumansTest.php b/tests/HumansTest.php index 844e696..ef2c225 100644 --- a/tests/HumansTest.php +++ b/tests/HumansTest.php @@ -7,41 +7,44 @@ class HumansTest extends \Orchestra\Testbench\TestCase { + /** + * Setup + */ public function setUp() - { - parent::setUp(); - } - - /** - * Load the package - * @return array the packages - */ - protected function getPackageProviders($app) - { - return [ - 'Olssonm\Humans\ServiceProvider' - ]; - } + { + parent::setUp(); + } + + /** + * Load the package + * @return array the packages + */ + protected function getPackageProviders($app) + { + return [ + 'Olssonm\Humans\ServiceProvider' + ]; + } /** * Test a default visit * @test */ - public function testVisitDefault() - { - $this->visit('/humans.txt') - ->see('This is the default humans.txt-template'); - } + public function testVisitDefault() + { + $this->visit('/humans.txt') + ->see('This is the default humans.txt-template'); + } /** * Test a default visit using named route * @test */ - public function testVisitDefaultNamed() - { - $this->visit(route('humans.txt')) - ->see('This is the default humans.txt-template'); - } + public function testVisitDefaultNamed() + { + $this->visit(route('humans.txt')) + ->see('This is the default humans.txt-template'); + } /** * Test to publish vendor assets @@ -79,21 +82,21 @@ public function testVendorPublish() * Test an installed visit * @test */ - public function testVisitInstalled() - { - $this->visit('/humans.txt') - ->see('Developer: Joe Doe'); - } + public function testVisitInstalled() + { + $this->visit('/humans.txt') + ->see('Developer: Joe Doe'); + } /** * Test an installed visit * @test */ - public function testVisitInstalledNamed() - { - $this->visit(route('humans.txt')) - ->see('Developer: Joe Doe'); - } + public function testVisitInstalledNamed() + { + $this->visit(route('humans.txt')) + ->see('Developer: Joe Doe'); + } /** * Tear down and remove files From 1875986f013448f185534ab181dd22370b41aa67 Mon Sep 17 00:00:00 2001 From: Marcus Olsson Date: Fri, 4 Nov 2016 09:15:31 +0100 Subject: [PATCH 2/2] Set the correct branch-alias for composer. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b23401d..89c0156 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "2.x-dev" } }, "minimum-stability": "stable"