summaryrefslogtreecommitdiff
path: root/scripts/dev/generate-phpt/src/gtTestCaseWriter.php
blob: 9438e0f2ea1e5683b8d09eef71856f986e115000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

/**
 * Writes a single test case to a file
 *
 */
class gtTestCaseWriter {

  public static function write($name, $string, $type, $count = 0) {
    if ($type  == 'b') {
    $fileName = $name."_basic.phpt";
    }

    if ($type  == 'e') {
     $fileName = $name."_error.phpt";
    }

    if ($type  == 'v') {
      $fileName = $name."_variation".$count.".phpt";
    }

    $fh = fopen($fileName, 'w');
    fwrite ($fh, $string);
    fclose($fh);
  }
}
?>