Skip to content

Commit

Permalink
Update CollectionsTest.php
Browse files Browse the repository at this point in the history
Add testCollectionExits
  • Loading branch information
yaroslavpopovic authored Jun 20, 2024
1 parent cefc234 commit b4983ca
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/Integration/Endpoints/CollectionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ public function testCollections(): void
$this->assertEquals('ok', $response['status']);
}

/**
* @throws InvalidArgumentException
*/
public function testCollectionExits(): void
{
$collections = new Collections($this->client);
$collections->setCollectionName('sample-collection');

$response = $collections->create(self::sampleCollectionOption());
$this->assertEquals('ok', $response['status']);

$response = $collections->exists();
$this->assertEquals(true, $response['result']['exists']);

$response = $collections->setCollectionName('sample-collection-that-not-exists')->exists();
$this->assertEquals(false, $response['result']['exists']);
}

public function testCollectionsCluster(): void
{
$collections = new Collections($this->client);
Expand Down Expand Up @@ -185,4 +203,4 @@ protected function tearDown(): void
$collections->setCollectionName('sample-collection')->delete();
$collections->setCollectionName('other-collection')->delete();
}
}
}

0 comments on commit b4983ca

Please sign in to comment.