Пример #1
0
function phoromatic_pre_seed_tests_to_install(&$json, $phoromatic_account_settings, &$sys_row)
{
    $suite_writer = new pts_test_suite_writer();
    $suite_writer->add_suite_information('Pre-Seed', '1.0.0', 'Phoromatic', 'System', 'An automated Phoromatic test schedule.');
    $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules_tests WHERE AccountID = :account_id');
    $stmt->bindValue(':account_id', ACCOUNT_ID);
    $result = $stmt->execute();
    $test_count = 0;
    while ($row = $result->fetchArray()) {
        $suite_writer->add_to_suite($row['TestProfile'], null, null);
        $test_count++;
    }
    if ($test_count == 0) {
        return false;
    }
    $json['phoromatic']['task'] = 'install';
    $json['phoromatic']['test_suite'] = $suite_writer->get_xml();
    $json['phoromatic']['settings'] = $phoromatic_account_settings;
    $json['phoromatic']['pre_set_sys_env_vars'] = $sys_row['SystemVariables'];
    echo json_encode($json);
    return true;
}