Skip to content

Commit

Permalink
Improving ServiceProvider stub and removing trailing spaces (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
spekulatius authored Oct 1, 2020
1 parent d633114 commit 3f20ee2
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/Commands/Crud/ModelMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function ' . $relationship->name . '()
}
';
}
return "{$fillable}
return "{$fillable}
{$rel}";
}

Expand Down
4 changes: 2 additions & 2 deletions app/Commands/Crud/stubs/tests/test-web.stub
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DummyClass extends TestCase
->assertOk()
->assertSee($DummyModelName->DummyModelFieldName);
}

/** @test */
public function user_can_see_create_page_of_DummyModelName()
{
Expand All @@ -49,7 +49,7 @@ class DummyClass extends TestCase
$this->get(route('DummyModelName.show', $DummyModelName->id))
->assertSee($DummyModelName->DummyModelFieldName);
}

/** @test */
public function user_can_visit_DummyModelName_update_page()
{
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/Foundation/stubs/listener-queued-duck.stub
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
class DummyClass implements ShouldQueue
{
use InteractsWithQueue;

/**
* Create the event listener.
*
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/Standalone/stubs/License.stub
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) StudlyDummyVendor<mailto:DummyAuthorEmail>
Copyright (c) StudlyDummyVendor<mailto:DummyAuthorEmail>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/Standalone/stubs/Phpunit.stub
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">

<testsuites>
<testsuite name=":service_name Test Suite">
<directory>tests</directory>
Expand Down
14 changes: 11 additions & 3 deletions app/Commands/Standalone/stubs/ServiceProvider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class StudlyDummyPackageNameServiceProvider extends ServiceProvider
public function boot()
{
$this->mergeConfigFrom(__DIR__ . '/../config/StudlyDummyPackageName.php', 'LowerCaseDummyPackageName');
$this->publishThings();

$this->publishConfig();

// $this->loadViewsFrom(__DIR__.'/resources/views', 'LowerCaseDummyPackageName');
// $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
// $this->registerRoutes();
Expand Down Expand Up @@ -60,11 +62,17 @@ class StudlyDummyPackageNameServiceProvider extends ServiceProvider
});
}

public function publishThings(){
/**
* Publish Config
*
* @return void
*/
public function publishConfig()
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__ . '/../config/StudlyDummyPackageName.php' => config_path('StudlyDummyPackageName.php'),
], 'config');
}
}
}
}
4 changes: 2 additions & 2 deletions app/Commands/TestDir/stubs/TestCase.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class TestCase extends BaseTestCase
parent::setUp();
$this->withoutExceptionHandling();
$this->artisan('migrate', ['--database' => 'testing']);

$this->loadMigrationsFrom(__DIR__ . '/../src/database/migrations');
$this->loadLaravelMigrations(['--database' => 'testing']);

$this->withFactories(__DIR__.'/../src/database/factories');
}

Expand Down

0 comments on commit 3f20ee2

Please sign in to comment.