$car = new OppCarica();
$car->setId(999999);
$car->setOppPolitico($pol);
$car->setTipoCaricaId(2);
$car->setCarica('Ministro dell\'abolizione dei beni Inutili');
$car->setDataInizio('2008-10-10');
$car->save();
$pol_related_news = getRelatedNews($pol);
$n_pol_related_news = count($pol_related_news);
$t->diag("related_news: " . $n_pol_related_news);
$t->ok($n_pol_related_news == 1, 'One news related to the politician');
dumpNews($t, "news related to the politician", $pol_related_news);
$t->diag('Add a group to the charge');
$gruppo = OppGruppoPeer::retrieveByPK(1);
$car_gruppo = new OppCaricaHasGruppo();
$car_gruppo->setOppCarica($car);
$car_gruppo->setOppGruppo($gruppo);
$car_gruppo->setDataInizio('2008-08-20');
$car_gruppo->save();
$pol_related_news = getRelatedNews($pol);
$n_pol_related_news = count($pol_related_news);
$t->ok($n_pol_related_news == 2, 'Two news related to the politician');
dumpNews($t, "news related to the politician", $pol_related_news);
$t->diag('Add a first-signer, at the presentation date');
$firma = new OppCaricaHasAtto();
$firma->setTipo('P');
$firma->setOppCarica($car);
$firma->setOppAtto($obj);
$firma->setData($obj->getDataPres());
$firma->save();
$pol_related_news = getRelatedNews($pol);