Cleanup tests
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace CachetHQ\Tests\Cachet;
|
namespace CachetHQ\Tests\Cachet;
|
||||||
|
|
||||||
|
use CachetHQ\Cachet\Models\User;
|
||||||
|
use Illuminate\Contracts\Console\Kernel;
|
||||||
use Illuminate\Foundation\Testing\TestCase;
|
use Illuminate\Foundation\Testing\TestCase;
|
||||||
|
|
||||||
abstract class AbstractTestCase extends TestCase
|
abstract class AbstractTestCase extends TestCase
|
||||||
@@ -31,17 +33,20 @@ abstract class AbstractTestCase extends TestCase
|
|||||||
{
|
{
|
||||||
$app = require __DIR__.'/../bootstrap/app.php';
|
$app = require __DIR__.'/../bootstrap/app.php';
|
||||||
|
|
||||||
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
$app->make(Kernel::class)->bootstrap();
|
||||||
|
|
||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Becomes a user.
|
* Become a user.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function beUser()
|
protected function beUser()
|
||||||
{
|
{
|
||||||
$this->user = factory('CachetHQ\Cachet\Models\User')->create();
|
$this->user = factory(User::class)->create();
|
||||||
|
|
||||||
$this->be($this->user);
|
$this->be($this->user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,16 +12,12 @@
|
|||||||
namespace CachetHQ\Tests\Cachet\Functional;
|
namespace CachetHQ\Tests\Cachet\Functional;
|
||||||
|
|
||||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||||
|
use Illuminate\Contracts\Console\Kernel;
|
||||||
|
|
||||||
class CommandTest extends AbstractTestCase
|
class CommandTest extends AbstractTestCase
|
||||||
{
|
{
|
||||||
public function testMigrations()
|
public function testMigrations()
|
||||||
{
|
{
|
||||||
$this->assertSame(0, $this->getKernel()->call('migrate', ['--force' => true]));
|
$this->assertSame(0, $this->app->make(Kernel::class)->call('migrate', ['--force' => true]));
|
||||||
}
|
|
||||||
|
|
||||||
protected function getKernel()
|
|
||||||
{
|
|
||||||
return $this->app->make('Illuminate\Contracts\Console\Kernel');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user