diff --git a/composer.lock b/composer.lock index 122a03843..e56a46991 100644 --- a/composer.lock +++ b/composer.lock @@ -1216,16 +1216,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.15", + "version": "9.6.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" + "reference": "3767b2c56ce02d01e3491046f33466a1ae60a37f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3767b2c56ce02d01e3491046f33466a1ae60a37f", + "reference": "3767b2c56ce02d01e3491046f33466a1ae60a37f", "shasum": "" }, "require": { @@ -1299,7 +1299,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.16" }, "funding": [ { @@ -1315,7 +1315,7 @@ "type": "tidelift" } ], - "time": "2023-12-01T16:55:19+00:00" + "time": "2024-01-19T07:03:14+00:00" }, { "name": "psr/container", diff --git a/tests/e2e/Adapter/Base.php b/tests/e2e/Adapter/Base.php index 801c8b089..a8310eb00 100644 --- a/tests/e2e/Adapter/Base.php +++ b/tests/e2e/Adapter/Base.php @@ -1928,6 +1928,16 @@ public function testArrayAttribute(): void array: true )); + $this->assertEquals(true, $database->createAttribute( + $collection, + 'pref', + Database::VAR_STRING, + size: 16384, + required: false, + signed: false, + filters: ['json'], + )); + try { $database->createDocument($collection, new Document([])); $this->fail('Failed to throw exception'); @@ -1981,6 +1991,12 @@ public function testArrayAttribute(): void 'numbers' => [0, 100, 1000, -1], 'age' => 41, 'tv_show' => 'Everybody Loves Raymond', + 'pref' => [ + 'fname' => 'Joe', + 'lname' => 'Baiden', + 'age' => 80, + 'male' => true, + ], ])); $document = $database->getDocument($collection, 'id1'); @@ -2085,6 +2101,12 @@ public function testArrayAttribute(): void Query::contains('booleans', [false, true]) ]); $this->assertCount(1, $documents); + + // Regular like query on primitive json string data + $documents = $database->find($collection, [ + Query::contains('pref', ['Joe']) + ]); + $this->assertCount(1, $documents); } }