Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ryanmr
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanmr/466a5bf4ec8b04684ad1 to your computer and use it in GitHub Desktop.
Save ryanmr/466a5bf4ec8b04684ad1 to your computer and use it in GitHub Desktop.
$template = "<b>Test ID:</b> 4.5.{n}<br />
<b>Test Name:</b> Tuition for graduate student in year {year} of Medical School, {res}resident status, 13 credits<br />
<b>Description:</b> Check that a graduate student in year {year} of Medical School, with {res}resident status, taking 13 credits, pays the \${amount} flat fee rate<br />
<b>Inputs:</b> Graduate student, year {year} in program, {res}resident status, 13-credit count<br />
<b>Expected Results:</b> \${amount} tuition fee charged<br />
<b>Initialization:</b> {initialization}<br />
<b>Test Steps:</b> {test steps}<br />
<b>Author:</b> The Bot <b>Date:</b> 2015-03-03<br />
<hr />
<br /><br />
";
$res = array("non-", "");
$prices = array( array(16589, 12624), array(16589, 12624), array(16263, 12376), array(15489, 11900), array(14456, 11366), array(13495, 10859) );
$n = 1;
for ($i = 0; $i < count($res); $i++) {
$r = $res[$i];
$o = $i;
$year = 1;
foreach ($prices as $price) {
$p = $price[$o];
$replace = array("{n}" => $n, "{year}" => $year, "{res}" => $r, "{amount}" => $p);
echo( str_replace(array_keys($replace), array_values($replace), $template) );
$year++;
$n++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment