Cassandra\RetryPolicyIntegrationTest::testFallThroughPolicyWrite PHP Method

testFallThroughPolicyWrite() public method

This test will ensure that the PHP driver supports the ability to provide any exception that occurs when executing statements. This test will ensure that a WriteTimeoutException occurs when a consistency level cannot be achieved.
    public function testFallThroughPolicyWrite()
    {
        // Create the retry policy (RF = 3 with 1 node)
        $policy = new RetryPolicy\Fallthrough();
        // Iterate over each statement type
        foreach (range(1, 3) as $statementType) {
            // Determine if the statement type should be skipped
            if ($statementType == self::BATCH_STATEMENT && version_compare(\Cassandra::CPP_DRIVER_VERSION, "2.2.3") < 0) {
                if (Integration::isDebug()) {
                    fprintf(STDOUT, "Skipping Batch Statements in %s: Issue fixed in DataStax C/C++ v2.2.3" . PHP_EOL, $this->getName());
                }
            } else {
                // Create an exception during write
                $this->insert($statementType, $policy, 0, self::NUMBER_OF_INSERTS, \Cassandra::CONSISTENCY_ALL);
            }
        }
    }