public function testTestCase()
 {
     $f = new gtFunction('cos');
     $f->setArgumentNames();
     $f->setArgumentLists();
     $f->setInitialisationStatements();
     $optSect = new gtOptionalSections();
     $btc = gtBasicTestCase::getInstance($optSect);
     $btc->setFunction($f);
     $btc->constructTestCase();
     $fs = $btc->toString();
     $this->assertTrue(is_string($fs));
 }
예제 #2
0
    $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')) {
    if ($options->hasOption('c')) {
        $testCase = gtErrorTestCase::getInstance($optionalSections, 'method');
        $testCase->setMethod($method);
    } else {
        $testCase = gtErrorTestCase::getInstance($optionalSections);
        $testCase->setFunction($function);
    }
    $testCase->constructTestCase();
    gtTestCaseWriter::write($name, $testCase->toString(), 'e');