Started working on a test suite
Signed-off-by: Graham Campbell <graham@cachethq.io>
This commit is contained in:
committed by
Graham Campbell
parent
c2b69ff547
commit
7b3f6fee26
29
tests/AbstractTestCase.php
Normal file
29
tests/AbstractTestCase.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Cachet HQ <support@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet;
|
||||
|
||||
use GrahamCampbell\TestBench\AbstractAppTestCase;
|
||||
|
||||
abstract class AbstractTestCase extends AbstractAppTestCase
|
||||
{
|
||||
/**
|
||||
* Get the service provider class.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Foundation\Application $app
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getServiceProviderClass($app)
|
||||
{
|
||||
return 'CachetHQ\Cachet\Providers\AppServiceProvider';
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Cachet HQ <support@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic functional test example.
|
||||
*/
|
||||
public function testBasicExample()
|
||||
{
|
||||
$true = true;
|
||||
|
||||
$this->assertTrue($true);
|
||||
}
|
||||
}
|
||||
27
tests/Functional/CommandTest.php
Normal file
27
tests/Functional/CommandTest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Cachet HQ <support@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Functional;
|
||||
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
class CommandTest extends AbstractTestCase
|
||||
{
|
||||
public function testMigrations()
|
||||
{
|
||||
$this->assertSame(0, $this->getKernel()->call('migrate', ['--force' => true]));
|
||||
}
|
||||
|
||||
protected function getKernel()
|
||||
{
|
||||
return $this->app->make('Illuminate\Contracts\Console\Kernel');
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Cachet HQ <support@cachethq.io>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
{
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
* @return \Illuminate\Foundation\Application
|
||||
*/
|
||||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__.'/../bootstrap/app.php';
|
||||
|
||||
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
||||
|
||||
return $app;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user