Example #1
0
}
?>
</div>


<?php 
if (pb_backupbuddy::_POST('skip_database_import') == '1' && pb_backupbuddy::_POST('skip_database_migration') == '1') {
    $fatal_error = false;
    echo '<br><span class="pb_label pb_label-info">Important</span> Database import & migration set to be skipped based on advanced options. Any failures ignored.<br><br>';
}
?>


<div class="test" style="border-bottom: 0;">
	<div class="test_status">
		<?php 
if (false === $fatal_error) {
    test_pass();
} else {
    test_fail();
}
?>
	</div>
	<?php 
if (false !== $fatal_error) {
    echo '<div class="test_title"><b>Overall result failure. Correct errors and re-test.</b></div>';
} else {
    echo '<div class="test_title"><b>Overall result success. Proceed to next step.</b></div>';
}
?>
</div>
Example #2
0
function do_test($filename)
{
    global $result_dir, $verbose, $n_test, $n_pass, $n_fail;
    # Get the test name (xyz) from the filename (/path/to/xyz.ext).
    # This is also used to build the stdout and stderr names.
    # Note: PATHINFO_FILENAME was added in PHP-5.2.
    $test_name = pathinfo($filename, PATHINFO_FILENAME);
    # Make sure the test script exists.
    if (!is_readable($filename)) {
        test_fail($test_name, "Script not found: {$filename}\n");
        return;
    }
    $output_file = $result_dir . DIRECTORY_SEPARATOR . $test_name . '.out';
    $error_file = $result_dir . DIRECTORY_SEPARATOR . $test_name . '.err';
    if ($verbose > 1) {
        lecho("Test: {$test_name}\n" . "  Script: {$filename}\n" . "  Output to: {$output_file}\n" . "  Errors to: {$error_file}\n");
    }
    # Run the test, and handle the result (pass, fail, or skip):
    $n_test++;
    run_test($test_name, $filename, $output_file, $error_file);
}