/** * tests special auto invoice creation */ public function testSpecialExportInvoice() { $this->_createFullFixtures(); $date = clone $this->_referenceDate; $i = 0; // until 1.7 while ($i < 8) { $this->_invoiceController->createAutoInvoices($date); $date->addMonth(1); $i++; } $definition = dirname(dirname(dirname(dirname(__FILE__)))) . '/tine20/Sales/Export/definitions/invoice_special_ods.xml'; $filter = new Sales_Model_InvoiceFilter(array()); $exporter = new Sales_Export_Ods_Invoice($filter, Sales_Controller_Invoice::getInstance(), array('definitionFilename' => $definition)); $doc = $exporter->generate(); $xml = $this->_getContentXML($doc); $ns = $xml->getNamespaces(true); $spreadsheetXml = $xml->children($ns['office'])->{'body'}->{'spreadsheet'}; // the product should be found here $this->assertEquals('Debitor', (string) $spreadsheetXml->children($ns['table'])->{'table'}->{'table-row'}->{1}->children($ns['table'])->{'table-cell'}->{3}->children($ns['text'])->{0}); }
/** * tests special auto invoice creation */ public function testSpecialExportInvoice() { if ($this->_dbIsPgsql()) { $this->markTestSkipped('0011670: fix Sales_Invoices Tests with postgresql backend'); } $this->_createFullFixtures(); $date = clone $this->_referenceDate; $i = 0; // until 1.7 while ($i < 8) { $this->_invoiceController->createAutoInvoices($date); $date->addMonth(1); $i++; } $definition = dirname(dirname(dirname(dirname(__FILE__)))) . '/tine20/Sales/Export/definitions/invoice_special_ods.xml'; $filter = new Sales_Model_InvoiceFilter(array()); $exporter = new Sales_Export_Ods_Invoice($filter, Sales_Controller_Invoice::getInstance(), array('definitionFilename' => $definition)); $doc = $exporter->generate(); $xml = $this->_getContentXML($doc); $ns = $xml->getNamespaces(true); $spreadsheetXml = $xml->children($ns['office'])->{'body'}->{'spreadsheet'}; $text = $spreadsheetXml->xpath('((.//table:table/table:table-row)[2]/table:table-cell)[4]/text:p'); $text = $text[0]; // the product should be found here $this->assertEquals('Debitor', (string) $text); }