Added laravel framework. Bootstrap absolute minimum. Add testing framework that follows Laravel practices. Write simple feature test to test caching.

This commit is contained in:
Taylor Dondich
2017-07-27 14:04:51 -07:00
committed by davidcallizaya
parent 5874fce1b5
commit 6458dc64a1
11 changed files with 2786 additions and 494 deletions

View File

@@ -0,0 +1,17 @@
<?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,19 @@
<?php
namespace Tests\Feature;
use Illuminate\Support\Facades\Cache;
use Tests\TestCase;
class CacheTest extends TestCase
{
/**
* A basic cache example.
*
* @return void
*/
public function testCache()
{
Cache::put('foo', 'bar', 5);
$this->assertEquals('bar', (Cache::get('foo')));
}
}

8
tests/TestCase.php Normal file
View File

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