$target_testproject->name = 'Testplan Class Unit Test';
$target_testproject->color = '';
$target_testproject->options = new stdClass();
$target_testproject->options->requirement_mgmt = 1;
$target_testproject->options->priority_mgmt = 1;
$target_testproject->options->automated_execution = 1;
$target_testproject->notes = 'Created to run testplan unit tests on ';
$target_testproject->active = 1;
$target_testproject->tcasePrefix = 'TPlanUnitTest';
// Create a test project that will be Test plan parent
$tproject_mgr = new testproject($db);
$info = $tproject_mgr->get_by_name($target_testproject->name);
if (!is_null($info)) {
    $name = $info[0]['name'];
    echo "TestProject with name <b><i>{$name}</i></b> exists!<br>Will be deleted and re-created";
    $tproject_mgr->delete($info[0]['id']);
}
$testproject_id = $tproject_mgr->create($target_testproject->name, $target_testproject->color, $target_testproject->options, $target_testproject->notes, $target_testproject->active, $target_testproject->tcasePrefix);
$testplan = new stdClass();
$testplan->name = 'Test Plan Code Testing';
$testplan->notes = 'Test Plan created running Code Testing code by TestLink Development Team';
echo "<pre> {$object_class} - create(\$name,\$notes,\$testproject_id)";
echo "</pre>";
echo "<pre> {$object_class} - create('{$testplan->name}','{$testplan->notes}',{$testproject_id})";
echo "</pre>";
$testplan->id = $obj_mgr->create($testplan->name, $testplan->notes, $testproject_id);
$info = $obj_mgr->get_by_id($testplan->id);
new dBug($info);
// ---------------------------------------------------------------------------------------------------------
// Build Manager
// ---------------------------------------------------------------------------------------------------------