public function setUp() { if (!version_compare(PHP_VERSION, '5.4.0', '>=')) { return $this->markTestSkipped('This test uses a model that uses traits.'); } require_once __DIR__ . '/Models/BrokenModel.php'; parent::setUp(); $this->model = new BrokenBlameableModel(); }
public function setUp() { require_once 'Models/CompatibleModel.php'; parent::setUp(); $this->model = new CompatibleBlameableModel(); }
public static function setUpBeforeClass() { if (!isset(self::$app)) { self::$app = AppFactory::create(); } if (!Schema::hasTable('users')) { Schema::create('users', function ($table) { $table->increments('id'); $table->string('name'); }); } DB::insert('insert into users (name) values (?)', array('Test User')); if (!Schema::hasTable('posts')) { Schema::create('posts', function ($table) { $table->increments('id'); $table->string('title'); $table->integer('created_by_id')->unsigned()->nullable(); $table->integer('updated_by_id')->unsigned()->nullable(); $table->integer('deleted_by_id')->unsigned()->nullable(); $table->timestamps(); $table->datetime('deleted_at')->nullable(); $table->foreign('created_by_id')->references('id')->on('users'); $table->foreign('updated_by_id')->references('id')->on('users'); $table->foreign('deleted_by_id')->references('id')->on('users'); }); } }