Skip to content

Commit

Permalink
Merge pull request #4 from olssonm/dev
Browse files Browse the repository at this point in the history
Just some cleanup.
  • Loading branch information
olssonm authored Nov 4, 2016
2 parents 2365363 + 1875986 commit f9be099
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 46 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
"dev-master": "2.x-dev"
}
},
"minimum-stability": "stable"
Expand Down
4 changes: 4 additions & 0 deletions src/Http/Controllers/HumansController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

class HumansController extends Controller
{
/**
* Return a text/plain-response with humans-view
* @return response
*/
public function humans()
{
return response()
Expand Down
11 changes: 1 addition & 10 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand All @@ -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()
{
//
}
}
2 changes: 1 addition & 1 deletion src/resources/views/humans.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
71 changes: 37 additions & 34 deletions tests/HumansTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f9be099

Please sign in to comment.