Skip to content

Commit dc008bb

Browse files
authored
Merge pull request #620 from utopia-php/default-boolean
Default boolean
2 parents 2214a7e + 09db63b commit dc008bb

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

tests/e2e/Adapter/Scopes/DocumentTests.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4632,6 +4632,17 @@ public function testUpdateDocuments(): void
46324632
'array' => false,
46334633
'filters' => [],
46344634
]),
4635+
new Document([
4636+
'$id' => ID::custom('boolean'),
4637+
'type' => Database::VAR_BOOLEAN,
4638+
'format' => '',
4639+
'size' => 0,
4640+
'signed' => true,
4641+
'required' => false,
4642+
'default' => false, // not null
4643+
'array' => false,
4644+
'filters' => [],
4645+
]),
46354646
], permissions: [
46364647
Permission::read(Role::any()),
46374648
Permission::create(Role::any()),
@@ -4643,7 +4654,8 @@ public function testUpdateDocuments(): void
46434654
$database->createDocument($collection, new Document([
46444655
'$id' => 'doc' . $i,
46454656
'string' => 'text📝 ' . $i,
4646-
'integer' => $i
4657+
'integer' => $i,
4658+
'boolean' => true
46474659
]));
46484660
}
46494661

@@ -4661,6 +4673,7 @@ public function testUpdateDocuments(): void
46614673

46624674
foreach ($results as $document) {
46634675
$this->assertEquals('text📝 updated', $document->getAttribute('string'));
4676+
$this->assertEquals(true, $document->getAttribute('boolean'));
46644677
}
46654678

46664679
$updatedDocuments = $database->find($collection, [
@@ -4672,6 +4685,7 @@ public function testUpdateDocuments(): void
46724685
foreach ($updatedDocuments as $document) {
46734686
$this->assertEquals('text📝 updated', $document->getAttribute('string'));
46744687
$this->assertGreaterThanOrEqual(5, $document->getAttribute('integer'));
4688+
$this->assertEquals(true, $document->getAttribute('boolean'));
46754689
}
46764690

46774691
$controlDocuments = $database->find($collection, [

0 commit comments

Comments
 (0)