You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use Orchestra\Testbench\TestCase as BaseTestCase;
|
|
|
|
abstract class TestCase extends BaseTestCase
|
|
{
|
|
protected $modelName;
|
|
protected $pluralModelName;
|
|
protected $tableName;
|
|
protected $singleModelName;
|
|
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
$this->modelName = 'Item';
|
|
|
|
$this->pluralModelName = str_plural($this->modelName);
|
|
$this->tableName = strtolower($this->pluralModelName);
|
|
$this->singleModelName = strtolower($this->modelName);
|
|
}
|
|
|
|
public function tearDown()
|
|
{
|
|
exec('rm '.app_path($this->modelName.'.php'));
|
|
exec('rm -r '.app_path('Http'));
|
|
exec('rm '.database_path('migrations/*'));
|
|
exec('rm -r '.resource_path('views/'.$this->tableName));
|
|
exec('rm -r '.base_path('routes'));
|
|
exec('rm '.base_path('tests/BrowserKitTest.php'));
|
|
exec('rm -r '.base_path('tests/Feature'));
|
|
exec('rm -r '.base_path('tests/Unit'));
|
|
|
|
parent::tearDown();
|
|
}
|
|
|
|
protected function getPackageProviders($app)
|
|
{
|
|
return ['Luthfi\CrudGenerator\ServiceProvider'];
|
|
}
|
|
}
|