Cassandra\SchemaMetadataIntegrationTest::testDropMaterializedViews PHP Method

testDropMaterializedViews() public method

This test ensures that materialized views are properly handled by the driver.
    public function testDropMaterializedViews()
    {
        // Create the tables
        $this->createTablesForMaterializedViews();
        // Create the materialized views
        $this->createSimpleMaterializedView();
        // Validate the materialized view exists
        $keyspace = $this->session->schema()->keyspace($this->keyspaceName);
        $this->assertCount(1, $keyspace->materializedViews());
        $this->assertNotEmpty($keyspace->materializedView("simple"));
        // Drop the materialized view and validate it no longer exists
        $statement = new SimpleStatement("DROP MATERIALIZED VIEW simple");
        $this->session->execute($statement);
        $keyspace = $this->session->schema()->keyspace($this->keyspaceName);
        $this->assertCount(0, $keyspace->materializedViews());
        $this->assertEmpty($keyspace->materializedView("simple"));
    }