Skip to content

Commit

Permalink
test cases added
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapan-Tops committed Dec 27, 2023
1 parent 901a12f commit 8beb158
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/Unit/DatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@
$this->assertCount(1, Testing::query()->whereEncrypted('value', 'testing string')->get());
});

it('can query encrypted datas', function () {
it('can match Sql syntex', function () {
$query = Testing::query()->whereEncrypted('value', 'testing string')->toSql();
echo PHP_EOL . $query . PHP_EOL;
expect($query)->toMatch('/(AES_DECRYPT\(([^\)]+)\))/');
});

it('can search encrypted data', function () {
dd(Testing::query()->whereEncryptedLike('value', 'hello')->first());
$this->assertCount(1, Testing::query()->whereEncryptedLike('value', 'hello')->get());
});

0 comments on commit 8beb158

Please sign in to comment.