Cassandra\SchemaMetadataIntegrationTest::testIteratorSecondaryIndexes PHP Method

testIteratorSecondaryIndexes() public method

This test ensures that secondary indexes are properly handled by the driver.
    public function testIteratorSecondaryIndexes()
    {
        // Create the table and secondary indexes
        $this->createTableForSecondaryIndexes();
        $this->createSimpleSecondaryIndex();
        $this->createCollectionSecondaryIndex();
        // Validate the schema metadata
        $table = $this->session->schema()->keyspace($this->keyspaceName)->table($this->tableNamePrefix);
        $indexes = $table->indexes();
        $this->assertCount(2, $indexes);
        foreach ($indexes as $index) {
            $this->assertTrue($index->name() == "simple" || $index->name() == "collection");
        }
    }