Skip to content

Commit b4983ca

Browse files
Update CollectionsTest.php
Add testCollectionExits
1 parent cefc234 commit b4983ca

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

tests/Integration/Endpoints/CollectionsTest.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,24 @@ public function testCollections(): void
5454
$this->assertEquals('ok', $response['status']);
5555
}
5656

57+
/**
58+
* @throws InvalidArgumentException
59+
*/
60+
public function testCollectionExits(): void
61+
{
62+
$collections = new Collections($this->client);
63+
$collections->setCollectionName('sample-collection');
64+
65+
$response = $collections->create(self::sampleCollectionOption());
66+
$this->assertEquals('ok', $response['status']);
67+
68+
$response = $collections->exists();
69+
$this->assertEquals(true, $response['result']['exists']);
70+
71+
$response = $collections->setCollectionName('sample-collection-that-not-exists')->exists();
72+
$this->assertEquals(false, $response['result']['exists']);
73+
}
74+
5775
public function testCollectionsCluster(): void
5876
{
5977
$collections = new Collections($this->client);
@@ -185,4 +203,4 @@ protected function tearDown(): void
185203
$collections->setCollectionName('sample-collection')->delete();
186204
$collections->setCollectionName('other-collection')->delete();
187205
}
188-
}
206+
}

0 commit comments

Comments
 (0)