mirror of
https://github.com/archtechx/virtualcolumn.git
synced 2025-12-12 18:44:04 +00:00
Make running tests work with new PHPUnit version
This commit is contained in:
parent
75718edcfe
commit
0f4d04ee4f
1 changed files with 5 additions and 10 deletions
|
|
@ -18,8 +18,7 @@ class VirtualColumnTest extends TestCase
|
||||||
$this->loadMigrationsFrom(__DIR__ . '/etc/migrations');
|
$this->loadMigrationsFrom(__DIR__ . '/etc/migrations');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
public function testKeysWhichDontHaveTheirOwnColumnGoIntoDataJsonColumn()
|
||||||
public function keys_which_dont_have_their_own_column_go_into_data_json_column()
|
|
||||||
{
|
{
|
||||||
$model = MyModel::create([
|
$model = MyModel::create([
|
||||||
'foo' => 'bar',
|
'foo' => 'bar',
|
||||||
|
|
@ -59,8 +58,7 @@ class VirtualColumnTest extends TestCase
|
||||||
$this->assertSame(null, $model->data);
|
$this->assertSame(null, $model->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
public function testModelIsAlwaysDecodedWhenAccessedByUserEvent()
|
||||||
public function model_is_always_decoded_when_accessed_by_user_event()
|
|
||||||
{
|
{
|
||||||
MyModel::retrieved(function (MyModel $model) {
|
MyModel::retrieved(function (MyModel $model) {
|
||||||
$this->assertFalse($model->dataEncoded);
|
$this->assertFalse($model->dataEncoded);
|
||||||
|
|
@ -90,8 +88,7 @@ class VirtualColumnTest extends TestCase
|
||||||
MyModel::first();
|
MyModel::first();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
public function testColumnNamesAreGeneratedCorrectly()
|
||||||
public function column_names_are_generated_correctly()
|
|
||||||
{
|
{
|
||||||
// FooModel's virtual data column name is 'virtual'
|
// FooModel's virtual data column name is 'virtual'
|
||||||
$virtualColumnName = 'virtual->foo';
|
$virtualColumnName = 'virtual->foo';
|
||||||
|
|
@ -107,8 +104,7 @@ class VirtualColumnTest extends TestCase
|
||||||
$this->assertSame($virtualColumnName, $model->getColumnForQuery('foo'));
|
$this->assertSame($virtualColumnName, $model->getColumnForQuery('foo'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
public function testModelsExtendingAParentModelUsingVirtualcolumnGetEncodedCorrectly()
|
||||||
public function models_extending_a_parent_model_using_virtualcolumn_get_encoded_correctly()
|
|
||||||
{
|
{
|
||||||
// Create a model that extends a parent model using VirtualColumn
|
// Create a model that extends a parent model using VirtualColumn
|
||||||
// 'foo' is a custom column, 'data' is the virtual column
|
// 'foo' is a custom column, 'data' is the virtual column
|
||||||
|
|
@ -130,8 +126,7 @@ class VirtualColumnTest extends TestCase
|
||||||
|
|
||||||
// maybe add an explicit test that the saving() and updating() listeners don't run twice?
|
// maybe add an explicit test that the saving() and updating() listeners don't run twice?
|
||||||
|
|
||||||
/** @test */
|
public function testEncryptedCastsWorkWithVirtualColumn() {
|
||||||
public function encrypted_casts_work_with_virtual_column() {
|
|
||||||
// Custom encrypted castables have to be specified in the $customEncryptedCastables static property
|
// Custom encrypted castables have to be specified in the $customEncryptedCastables static property
|
||||||
MyModel::$customEncryptedCastables = [EncryptedCast::class];
|
MyModel::$customEncryptedCastables = [EncryptedCast::class];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue