/** * tests if invoice id gets removed from the billables if the invoice gets deleted */ public function testRemoveInvoiceFromBillables() { if ($this->_dbIsPgsql()) { $this->markTestSkipped('0011670: fix Sales_Invoices Tests with postgresql backend'); } $this->_createFullFixtures(); $i = 0; $date = clone $this->_referenceDate; $date->addHour(3); $date->addMonth(1); $result = $this->_invoiceController->createAutoInvoices($date); $json = new Sales_Frontend_Json(); $invoices = $json->searchInvoices(array(), array()); $this->assertEquals(2, $invoices['totalcount']); foreach ($invoices['results'] as $result) { $ids[] = $result['id']; } $json->deleteInvoices($ids); $taJson = new Timetracker_Frontend_Json(); $tas = $taJson->searchTimeaccounts(array(), array()); $tss = $taJson->searchTimesheets(array(), array()); foreach ($tas['results'] as $t) { $this->assertEquals(NULL, $t['invoice_id']); } foreach ($tss['results'] as $t) { $this->assertEquals(NULL, $t['invoice_id']); } }