Beispiel #1
0
 public function testInitialisation()
 {
     $f = new gtFunction('version_compare');
     $f->setArgumentNames();
     $f->setInitialisationStatements();
     $a = $f->getInitialisationStatements();
     $this->assertEquals('$ver1 = ', $a[0]);
     $this->assertEquals('$ver2 = ', $a[1]);
     $this->assertEquals('$oper = ', $a[2]);
 }
 public function testTestCase3()
 {
     $f = new gtFunction('date_sunrise');
     $f->setArgumentNames();
     $f->setArgumentLists();
     $optSect = new gtOptionalSections();
     $vtc = gtVariationTestCase::getInstance($optSect);
     $vtc->setUp($f, 6, 'array');
     $vtc->constructTestCase();
     $fs = $vtc->toString();
     $this->assertTrue(is_string($fs));
 }
 public function testTestCase()
 {
     $f = new gtFunction('cos');
     $f->setArgumentNames();
     $f->setArgumentLists();
     $f->setInitialisationStatements();
     $optSect = new gtOptionalSections();
     $btc = gtErrorTestCase::getInstance($optSect);
     $btc->setFunction($f);
     $btc->constructTestCase();
     $fs = $btc->toString();
     $this->assertTrue(is_string($fs));
 }
Beispiel #4
0
    $optionalSections->setOptions($options);
}
if ($options->hasOption('c')) {
    $name = $options->getOption('c') . "_" . $options->getOption('m');
    $method = new gtMethod($options->getOption('c'), $options->getOption('m'));
    $method->setArgumentNames();
    $method->setArgumentLists();
    $method->setInitialisationStatements();
    $method->setConstructorArgumentNames();
    $method->setConstructorInitStatements();
    $method->setConstructorArgumentList();
}
if ($options->hasOption('f')) {
    $name = $options->getOption('f');
    $function = new gtFunction($name);
    $function->setArgumentNames();
    $function->setArgumentLists();
    $function->setInitialisationStatements();
}
if ($options->hasOption('b')) {
    if ($options->hasOption('c')) {
        $testCase = gtBasicTestCase::getInstance($optionalSections, 'method');
        $testCase->setMethod($method);
    } else {
        $testCase = gtBasicTestCase::getInstance($optionalSections);
        $testCase->setFunction($function);
    }
    $testCase->constructTestCase();
    gtTestCaseWriter::write($name, $testCase->toString(), 'b');
}
if ($options->hasOption('e')) {