This commit is contained in:
Marcel Pociot
2020-04-14 21:19:23 +02:00
commit 2b03398f40
48 changed files with 8099 additions and 0 deletions

22
tests/CreatesApplication.php Executable file
View File

@@ -0,0 +1,22 @@
<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
trait CreatesApplication
{
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
return $app;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
class InspiringCommandTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testInspiringCommand()
{
$this->artisan('inspiring')
->expectsOutput('Simplicity is the ultimate sophistication.')
->assertExitCode(0);
}
}

10
tests/TestCase.php Executable file
View File

@@ -0,0 +1,10 @@
<?php
namespace Tests;
use LaravelZero\Framework\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
}

View File

@@ -0,0 +1,18 @@
<?php
namespace Tests\Unit;
use Tests\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
}