mirror of
https://github.com/archtechx/virtualcolumn.git
synced 2025-12-12 12:34:03 +00:00
Test that child models extending a parent that uses VirtualColumn get encoded correctly (#16)
* Test that using different models extending the same class with VirtualColumn doesn't work correctly * Add regression test for faulty logic * Delete unused import * Add migration * Fix migrations * Make the assertions check the intended behavior
This commit is contained in:
parent
0b108903b5
commit
925249bb72
3 changed files with 116 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateBarChildsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('bar_childs', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->string('bar')->nullable();
|
||||
|
||||
$table->json('data')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('bar_childs');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFooChildsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('foo_childs', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->string('foo')->nullable();
|
||||
|
||||
$table->json('data')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('foo_childs');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue