Exemplo n.º 1
0
     behat_util::drop_site();
     // This is only displayed once for parallel install.
     if (empty($run)) {
         mtrace("Acceptance tests site dropped");
     }
 } else {
     if ($options['enable']) {
         if (!empty($parallel)) {
             // Save parallel site info for enable and install options.
             $filepath = behat_config_manager::get_parallel_test_file_path();
             if (!file_put_contents($filepath, $parallel)) {
                 behat_error(BEHAT_EXITCODE_PERMISSIONS, 'File ' . $filepath . ' can not be created');
             }
         }
         // Enable test mode.
         behat_util::start_test_mode($options['run-with-theme'], $options['optimize-runs'], $parallel, $run);
         // This is only displayed once for parallel install.
         if (empty($run)) {
             // Notify user that 2.5 profile has been converted to 3.5.
             if (behat_config_manager::$autoprofileconversion) {
                 mtrace("2.5 behat profile detected, automatically converted to current 3.x format");
             }
             $runtestscommand = behat_command::get_behat_command(true, !empty($run));
             $runtestscommand .= ' --config ' . behat_config_manager::get_behat_cli_config_filepath();
             mtrace("Acceptance tests environment enabled on {$CFG->behat_wwwroot}, to run the tests use: " . PHP_EOL . $runtestscommand);
         }
     } else {
         if ($options['disable']) {
             behat_util::stop_test_mode();
             // This is only displayed once for parallel install.
             if (empty($run)) {
Exemplo n.º 2
0
// Behat utilities.
require_once $CFG->libdir . '/behat/classes/util.php';
require_once $CFG->libdir . '/behat/classes/behat_command.php';
// Run command (only one per time).
if ($options['install']) {
    behat_util::install_site();
    mtrace("Acceptance tests site installed");
} else {
    if ($options['drop']) {
        // Ensure no tests are running.
        test_lock::acquire('behat');
        behat_util::drop_site();
        mtrace("Acceptance tests site dropped");
    } else {
        if ($options['enable']) {
            behat_util::start_test_mode();
            $runtestscommand = behat_command::get_behat_command(true) . ' --config ' . behat_config_manager::get_behat_cli_config_filepath();
            mtrace("Acceptance tests environment enabled, to run the tests use:\n " . $runtestscommand);
        } else {
            if ($options['disable']) {
                behat_util::stop_test_mode();
                mtrace("Acceptance tests environment disabled");
            } else {
                if ($options['diag']) {
                    $code = behat_util::get_behat_status();
                    exit($code);
                } else {
                    echo $help;
                }
            }
        }
Exemplo n.º 3
0
     behat_util::drop_site();
     // This is only displayed once for parallel install.
     if (empty($run)) {
         mtrace("Acceptance tests site dropped");
     }
 } else {
     if ($options['enable']) {
         if (!empty($parallel)) {
             // Save parallel site info for enable and install options.
             $filepath = behat_config_manager::get_parallel_test_file_path();
             if (!file_put_contents($filepath, $parallel)) {
                 behat_error(BEHAT_EXITCODE_PERMISSIONS, 'File ' . $filepath . ' can not be created');
             }
         }
         // Enable test mode.
         behat_util::start_test_mode($options['add-core-features-to-theme'], $options['optimize-runs'], $parallel, $run);
         // This is only displayed once for parallel install.
         if (empty($run)) {
             // Notify user that 2.5 profile has been converted to 3.5.
             if (behat_config_manager::$autoprofileconversion) {
                 mtrace("2.5 behat profile detected, automatically converted to current 3.x format");
             }
             $runtestscommand = behat_command::get_behat_command(true, !empty($run));
             $runtestscommand .= ' --config ' . behat_config_manager::get_behat_cli_config_filepath();
             mtrace("Acceptance tests environment enabled on {$CFG->behat_wwwroot}, to run the tests use: " . PHP_EOL . $runtestscommand);
         }
     } else {
         if ($options['disable']) {
             behat_util::stop_test_mode();
             // This is only displayed once for parallel install.
             if (empty($run)) {