Skip to content

Commit

Permalink
test bucket configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
nekufa committed Dec 23, 2024
1 parent bcf182d commit c3de3f1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Functional/KeyValue/BucketTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,32 @@
namespace Tests\Functional\KeyValue;

use Basis\Nats\KeyValue\Entry;
use Basis\Nats\Stream\Configuration;
use Tests\FunctionalTestCase;

class BucketTest extends FunctionalTestCase
{
public function testBucketConfiguration()
{
$configuration = new Configuration("kv_config");

$bucket = $this->createClient()->getApi()->getBucket('configuration');
$bucket->getConfiguration()
->setHistory(1000)
->setMaxBytes(1024 * 1024)
->setMaxValueSize(1024)
->setReplicas(2)
->setTtl(30)
->configureStream($configuration);

$this->assertSame($configuration->getMaxMessagesPerSubject(), 1000);
$this->assertSame($configuration->getMaxBytes(), 1024 * 1024);
$this->assertSame($configuration->getMaxMessageSize(), 1024);
$this->assertSame($configuration->getReplicas(), 2);
$this->assertSame($configuration->getMaxAge(), 30);
$this->assertSame($configuration->getSubjects(), ["\$KV.configuration.*"]);
}

public function testNullValues()
{
$bucket = $this->createClient()
Expand Down

0 comments on commit c3de3f1

Please sign in to comment.