Ejemplo n.º 1
0
function display_class(Class_Prog $class, TableCreator $table_creator)
{
    $string = "";
    foreach ($class->methods as $meth) {
        $string .= test_row($meth, $table_creator);
    }
    return $string;
}
function test_row(ValidationTest $test, $indentation, TableCreator $table_creator)
{
    $test->with('test', 'requirement', 'children');
    $ret = "";
    $ret .= $table_creator->row(array($table_creator->child_indentation($indentation), $test->public_id(), $test->test->description, $test->requirement == null ? '' : $test->requirement->public_id(), 'success'));
    $nested = $test->children;
    foreach ($nested as $c) {
        $ret .= test_row($c, $indentation + 1, $table_creator);
    }
    return $ret;
}
Ejemplo n.º 3
0
function test_row(Requirement $req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
    $test = $req->with('system_test')->system_test;
    $ret = "";
    if (isset($req->system_test) && (!is_numeric($filter_cat) || $req->category == $filter_cat) && (!is_numeric($filter_pri) || $req->priority == $filter_pri)) {
        $test->with('test');
        $ret .= $table_creator->row(array($test->public_id(), $test->test->description, 'success', $table_creator->anchor($req->public_id(), $req->public_id())));
    }
    $nested = $req->with('requirements')->requirements;
    foreach ($nested as $nreq) {
        $ret .= test_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
    }
    return $ret;
}
Ejemplo n.º 4
0
function test_row(ValidationTest $test, TableCreator $table_creator)
{
    $test->with('children');
    if (!isset($test->children) || count($test->children) == 0) {
        return "";
    }
    $str = "\nAll'utente è richiesto di:\n";
    $str .= $table_creator->begin_list();
    foreach ($test->children as $child) {
        $child->with('test');
        $id = $child->public_id();
        $str .= $table_creator->list_item($table_creator->anchor($id, $child->test->description . " ({$id})"));
        $str .= test_row($child, $table_creator);
    }
    $str .= $table_creator->end_list();
    return $str;
}
Ejemplo n.º 5
0
function test_row(Requirement $req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
    $test = $req->with('system_test')->system_test;
    $validation = $req->with('validation0')->validation0;
    $ret = "";
    $rv = '';
    if (isset($test)) {
        $rv = $test->public_id();
    } else {
        if (isset($validation)) {
            $rv = $validation->name;
        }
    }
    $ret .= $table_creator->row(array($table_creator->child_indentation($indentation), $req->public_id(), $rv));
    $nested = $req->with('requirements')->requirements;
    foreach ($nested as $nreq) {
        $ret .= test_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
    }
    return $ret;
}
Ejemplo n.º 6
0
<?php

/* @var $table_creator TableCreator */
function test_row(TUnitTest $test, TableCreator $table_creator)
{
    $methods = array();
    foreach ($test->methods as $meth) {
        $methods[] = $meth->name . "()";
    }
    if (!empty($methods)) {
        return $table_creator->row(array($test->public_id(), $test->description, implode($methods, "\n\n"), 'Success'));
    }
    return '';
}
$toplevel = TUnitTest::model()->findAll();
$table = $table_creator->begin_table("|p{1cm}|p{5cm}|p{5cm}|p{1.5cm}|") . $table_creator->heading_row(array("Test", "Descrizione", "Metodi", "Stato"));
foreach ($toplevel as $test) {
    $table .= test_row($test, $table_creator);
}
$table .= $table_creator->caption("Tabella descrizione test unità") . $table_creator->end_table();
if ($table_creator->id() != 'html' && !$raw) {
    echo CodeGen::generic_render_code($table, 'latex', true);
} else {
    echo $table;
}