Merge branch 'tine20.com/2012.10' into 2013.03
authorCornelius Weiß <mail@corneliusweiss.de>
Fri, 22 Mar 2013 11:29:03 +0000 (12:29 +0100)
committerCornelius Weiß <mail@corneliusweiss.de>
Fri, 22 Mar 2013 11:29:03 +0000 (12:29 +0100)
1  2 
tests/tine20/Calendar/Controller/EventTests.php
tests/tine20/Tasks/ControllerTest.php
tests/tine20/Tinebase/UserTest.php
tine20/Tinebase/Model/ModificationLog.php

@@@ -225,9 -229,8 +225,9 @@@ class Tasks_ControllerTest extends PHPU
       * try to update the same task twice with the same values, should be resolved by concurrency handling
       * 
       * @see 0007108: inspect and solve concurrency conflicts when setting lead relations
 +     * @see 0000996: add changes in relations/linked objects to modlog/history
       */
-     public function testConcurrencyDateTime()
+     public function testConcurrencyDateTimeSameValues()
      {
          if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . " 1. Update");
          $utask = $this->testUpdateTask();
          $resolvableConcurrencyTask->summary = 'Update of test task 1';
          $this->_controller->update($resolvableConcurrencyTask);
          
 -        sleep(1);
          if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . " 3. Update");
 -        $resolvableConcurrencyTask = clone $utask;
 -        $resolvableConcurrencyTask->last_modified_time = Tinebase_DateTime::now()->addHour(-1);
 -        $resolvableConcurrencyTask->due = $resolvableConcurrencyTask->due;
 -        $resolvableConcurrencyTask->percent = 50;
 -        $resolvableConcurrencyTask->summary = 'Update of test task 1';
 -        $this->_controller->update($resolvableConcurrencyTask);
 +        $resolvableConcurrencyTask2 = clone $utask;
 +        $resolvableConcurrencyTask2->due = $resolvableConcurrencyTask->due;
 +        $resolvableConcurrencyTask2->percent = 50;
 +        $resolvableConcurrencyTask2->summary = 'Update of test task 1';
 +        
 +        try {
 +            $updatedTask = $this->_controller->update($resolvableConcurrencyTask2);
 +            $this->assertEquals($resolvableConcurrencyTask2->due, $updatedTask->due);
 +        } catch (Tinebase_Timemachine_Exception_ConcurrencyConflict $ttecc) {
 +            $this->fail($ttecc);
 +        }
      }
      
+     public function testConcurrencyDateTimeResolveable()
+     {
+         $utask = $this->testUpdateTask();
+         
+         $resolvableConcurrencyTask = clone $utask;
+         $resolvableConcurrencyTask->due = $utask->due->addMonth(1);
+         $this->_controller->update($resolvableConcurrencyTask);
+         
+         $resolvableConcurrencyTask2 = clone $utask;
+         $resolvableConcurrencyTask2->summary = 'Update of test task 1';
+         
+         try {
+             $updatedTask = $this->_controller->update($resolvableConcurrencyTask2);
+             $this->assertEquals($resolvableConcurrencyTask->due, $updatedTask->due);
+         } catch (Tinebase_Timemachine_Exception_ConcurrencyConflict $ttecc) {
+             $this->fail($ttecc);
+         }
+     }
+     
      /**
       * test if non resolvable concurrency problem gets detected
       *
Simple merge