eloquent-meta/phpunit.php

25 lines
586 B
PHP
Raw Normal View History

<?php
2016-06-25 22:10:21 +00:00
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\Schema\Blueprint;
use Glmdev\Meta\Meta;
require __DIR__ . '/vendor/autoload.php';
date_default_timezone_set('UTC');
2016-06-25 22:10:21 +00:00
/*
* Prepare the db connection (spoofing that shit)
*/
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'sqlite',
'database' => ':memory:',
]);
$capsule->setAsGlobal();
$capsule->bootEloquent();
$capsule->schema()->dropIfExists('metas');
$capsule->schema()->create('metas', function (Blueprint $table) {
$table->timestamps();
Meta::formTable($table);
});