Cassandra\SchemaMetadataIntegrationTest::testEnumerateTablesAndColumns PHP Method

testEnumerateTablesAndColumns() public method

This test ensures that driver correctly enumerates over table and column metadata.
    public function testEnumerateTablesAndColumns()
    {
        $keyspaceName = self::generateKeyspaceName("enumerate");
        $tableSchemas = array("table_int_int" => array("key" => "int", "value" => "int"), "table_int_bigint" => array("key" => "int", "value" => "bigint"), "table_decimal_map" => array("key" => "decimal", "value" => "map<bigint, uuid>"));
        $this->createKeyspaceWithSchema($keyspaceName, $tableSchemas);
        $keyspace = $this->session->schema()->keyspace($keyspaceName);
        $this->assertEquals(count($tableSchemas), count($keyspace->tables()));
        foreach ($keyspace->tables() as $table) {
            $tableSchema = $tableSchemas[$table->name()];
            $this->assertEquals(count($tableSchema), count($table->columns()));
            foreach ($table->columns() as $column) {
                $columnType = $tableSchema[$column->name()];
                $this->assertEquals($columnType, (string) $column->type());
            }
        }
    }