Пример #1
0
<?php

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');
/*
 * 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);
});
Пример #2
0
 public function testUuidQuery()
 {
     $model = Meta::create(['meta' => ['name' => 'Tony']]);
     $queried = Meta::withUuid($model->getUuid())->first();
     $this->assertEquals($model->read('name'), $queried->read('name'));
 }