fixed test Sales_InvoiceControllerTests::testInvoiceRecreation
authorPaul Mehrer <p.mehrer@metaways.de>
Thu, 21 Apr 2016 13:34:38 +0000 (15:34 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 22 Apr 2016 06:59:22 +0000 (08:59 +0200)
Change-Id: I9e02f49d43dc5c09714c9021af7b5e323ae1b666
Reviewed-on: http://gerrit.tine20.com/customers/3071
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Sales/InvoiceControllerTests.php

index e63930d..bb0e50c 100644 (file)
@@ -364,7 +364,7 @@ class Sales_InvoiceControllerTests extends Sales_InvoiceTestCase
 
     public function testInvoiceRecreation()
     {
-        $this->markTestSkipped('FIXME: this fails randomly :(');
+        //$this->markTestSkipped('FIXME: this fails randomly :(');
 
         $result = $this->_createInvoiceUpdateRecreationFixtures();
 
@@ -416,16 +416,17 @@ class Sales_InvoiceControllerTests extends Sales_InvoiceTestCase
         $this->assertEquals(1, $pA->count());
         $pA = $pA->getFirstRecord();
         $pA->interval = 4;
+        sleep(1);
         Sales_Controller_ProductAggregate::getInstance()->update($pA);
         $contract4->title = $contract4->getTitle() . ' changed';
-        sleep(1);
         $this->_contractController->update($contract4);
+        sleep(1);
 
         $this->sharedTimesheet->id = NULL;
         $this->_timesheetController->create($this->sharedTimesheet);
 
         $result = $this->_invoiceController->checkForContractOrInvoiceUpdates();
-        $this->assertEquals(true, (count($result)===2||count($result)===3));
+        $this->assertEquals(2, count($result));
 
         $mapping = $this->_invoiceController->getAutoInvoiceRecreationResults();
         $this->assertEquals(true, isset($mapping[$oldInvoiceId0]));