public function testGetTableAndColumnByName()
{
$keyspaceName = self::generateKeyspaceName("by_name");
$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 ($tableSchemas as $tableName => $tableSchema) {
$table = $keyspace->table($tableName);
$this->assertEquals(count($tableSchema), count($table->columns()));
foreach ($tableSchema as $columnName => $columnType) {
$column = $table->column($columnName);
$this->assertEquals($columnType, (string) $column->type());
}
}
}