mirror of
https://github.com/archtechx/virtualcolumn.git
synced 2025-12-12 09:34:04 +00:00
Test that with encrypted casts, the encrypted values are saved in the DB
This commit is contained in:
parent
65f9000328
commit
eb56f6cc5f
1 changed files with 3 additions and 0 deletions
|
|
@ -146,11 +146,14 @@ class VirtualColumnTest extends TestCase
|
|||
'null_value' => null, // 'encrypted'
|
||||
]);
|
||||
|
||||
$databaseRecord = json_decode(DB::select('SELECT data FROM my_models')[0]->data);
|
||||
|
||||
foreach($encryptedAttributes as $key => $expectedValue) {
|
||||
$savedValue = $model->getAttributes()[$key]; // Encrypted
|
||||
|
||||
if ($savedValue !== null) {
|
||||
$this->assertTrue($model->valueEncrypted($savedValue));
|
||||
$this->assertEquals($savedValue, $databaseRecord->$key); // Encrypted in DB
|
||||
$this->assertNotEquals($expectedValue, $savedValue);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue