rafflesargentina /
l5-resource-controller
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | namespace RafflesArgentina\ResourceController; |
||||||
| 4 | |||||||
| 5 | trait BaseTest |
||||||
| 6 | { |
||||||
| 7 | /** |
||||||
| 8 | * Setup the test environment. |
||||||
| 9 | */ |
||||||
| 10 | public function setUp() |
||||||
| 11 | { |
||||||
| 12 | parent::setUp(); |
||||||
| 13 | |||||||
| 14 | gc_disable(); |
||||||
| 15 | |||||||
| 16 | $this->loadMigrationsFrom(__DIR__.'/database/migrations'); |
||||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||||
| 17 | |||||||
| 18 | $this->withFactories(__DIR__.'/factories'); |
||||||
|
0 ignored issues
–
show
It seems like
withFactories() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 19 | |||||||
| 20 | \Route::group( |
||||||
| 21 | [ |
||||||
| 22 | 'middleware' => [], |
||||||
| 23 | 'namespace' => 'RafflesArgentina\ResourceController', |
||||||
| 24 | ], function ($router) { |
||||||
| 25 | $router->resource('test', 'TestController'); |
||||||
| 26 | $router->resource('test2', 'TestUseSoftDeletesController'); |
||||||
| 27 | $router->resource('test3', 'ApiTestController'); |
||||||
| 28 | $router->resource('test4', 'ApiTestUseSoftDeletesController'); |
||||||
| 29 | } |
||||||
| 30 | ); |
||||||
| 31 | |||||||
| 32 | \View::addLocation(__DIR__.'/Resources/Views'); |
||||||
| 33 | } |
||||||
| 34 | |||||||
| 35 | /** |
||||||
| 36 | * Define environment setup. |
||||||
| 37 | * |
||||||
| 38 | * @param \Illuminate\Foundation\Application $app |
||||||
| 39 | * @return void |
||||||
| 40 | */ |
||||||
| 41 | protected function getEnvironmentSetUp($app) |
||||||
| 42 | { |
||||||
| 43 | // Setup default database to use sqlite :memory: |
||||||
| 44 | $app['config']->set('database.default', 'testbench'); |
||||||
| 45 | $app['config']->set( |
||||||
| 46 | 'database.connections.testbench', [ |
||||||
| 47 | 'driver' => 'sqlite', |
||||||
| 48 | 'database' => ':memory:', |
||||||
| 49 | 'prefix' => '', |
||||||
| 50 | ] |
||||||
| 51 | ); |
||||||
| 52 | } |
||||||
| 53 | |||||||
| 54 | /** |
||||||
| 55 | * Get package providers. At a minimum this is the package being tested, but also |
||||||
| 56 | * would include packages upon which our package depends, e.g. Cartalyst/Sentry |
||||||
| 57 | * In a normal app environment these would be added to the 'providers' array in |
||||||
| 58 | * the config/app.php file. |
||||||
| 59 | * |
||||||
| 60 | * @param \Illuminate\Foundation\Application $app |
||||||
| 61 | * |
||||||
| 62 | * @return array |
||||||
| 63 | */ |
||||||
| 64 | protected function getPackageProviders($app) |
||||||
|
0 ignored issues
–
show
The parameter
$app is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||||
| 65 | { |
||||||
| 66 | return [ |
||||||
| 67 | // your package service provider, |
||||||
| 68 | \Orchestra\Database\ConsoleServiceProvider::class, |
||||||
| 69 | ]; |
||||||
| 70 | } |
||||||
| 71 | |||||||
| 72 | /** |
||||||
| 73 | * Get package aliases. In a normal app environment these would be added to |
||||||
| 74 | * the 'aliases' array in the config/app.php file. If your package exposes an |
||||||
| 75 | * aliased facade, you should add the alias here, along with aliases for |
||||||
| 76 | * facades upon which your package depends, e.g. Cartalyst/Sentry. |
||||||
| 77 | * |
||||||
| 78 | * @param \Illuminate\Foundation\Application $app |
||||||
| 79 | * |
||||||
| 80 | * @return array |
||||||
| 81 | */ |
||||||
| 82 | protected function getPackageAliases($app) |
||||||
|
0 ignored issues
–
show
The parameter
$app is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||||
| 83 | { |
||||||
| 84 | return [ |
||||||
| 85 | // |
||||||
| 86 | ]; |
||||||
| 87 | } |
||||||
| 88 | } |
||||||
| 89 |