public function testShouldReturnTrue() { $clusterManager = $this->createBucket("sample1"); $schemaBuilder = $this->connection->getSchemaBuilder(); $this->assertTrue($schemaBuilder->hasColumn("sample1", "testing")); $this->assertTrue($schemaBuilder->hasColumns("sample1", ["testing"])); $this->removeBucket($clusterManager, "sample1"); }
public function testBlueprintSchemaBuildAndDropIndexes() { $schema = $this->connection->getSchemaBuilder(); $schema->create('sample', function (\Ytake\LaravelCouchbase\Schema\Blueprint $blueprint) { $blueprint->primaryIndex(); $blueprint->index(["message"], "secondary"); $blueprint->dropPrimary(); $blueprint->dropIndex("secondary"); }); $indexes = $this->connection->openBucket('sample')->manager()->listN1qlIndexes(); foreach ($indexes as $index) { $this->assertNotSame('sample', $index->keyspace); } $this->removeBucket($this->connection->manager(), 'sample'); sleep(5); }