Merge branch '2013.10'
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 6 Dec 2013 11:01:20 +0000 (12:01 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 6 Dec 2013 11:01:20 +0000 (12:01 +0100)
Conflicts:
tests/tine20/Calendar/TestCase.php

1  2 
tests/tine20/Calendar/TestCase.php
tests/tine20/Courses/JsonTest.php

@@@ -75,10 -70,29 +70,10 @@@ abstract class Calendar_TestCase extend
       */
      public function setUp()
      {
-         $this->_transactionId = Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
+         parent::setUp();
+         
          $this->_backend = new Calendar_Backend_Sql();
 -        
 -        $this->_personas = Zend_Registry::get('personas');
 -        foreach ($this->_personas as $loginName => $user) {
 -            $defaultCalendarId = Tinebase_Core::getPreference('Calendar')->getValueForUser(Calendar_Preference::DEFAULTCALENDAR, $user->getId());
 -            $this->_personasContacts[$loginName] = Addressbook_Controller_Contact::getInstance()->getContactByUserId($user->getId());
 -            $this->_personasDefaultCals[$loginName] = Tinebase_Container::getInstance()->getContainerById($defaultCalendarId);
 -        }
 -        
          $this->_testUser = Tinebase_Core::getUser();
 -        $this->_testUserContact = Addressbook_Controller_Contact::getInstance()->getContactByUserId($this->_testUser->getId());
 -        $this->_testCalendar = Tinebase_Container::getInstance()->addContainer(new Tinebase_Model_Container(array(
 -            'name'           => 'PHPUnit test calendar',
 -            'type'           => Tinebase_Model_Container::TYPE_PERSONAL,
 -            'owner_id'       => Tinebase_Core::getUser(),
 -            'backend'        => $this->_backend->getType(),
 -            'application_id' => Tinebase_Application::getInstance()->getApplicationByName('Calendar')->getId()
 -        ), true));
 -        
 -        $this->_testCalendars = new Tinebase_Record_RecordSet('Tinebase_Model_Container');
 -        $this->_testCalendars->addRecord($this->_testCalendar);
      }
      
      /**
       */
      public function tearDown()
      {
+         parent::tearDown();
+         
          Calendar_Controller_Event::getInstance()->sendNotifications(false);
          
-         if ($this->_transactionId) {
-             Tinebase_TransactionManager::getInstance()->rollBack();
-         } elseif ($this->_testCalendar !== NULL) {
 -        if (! $this->_transactionId) {
++        if (! $this->_transactionId && $this->_testCalendar !== NULL) {
              $events = $this->_backend->search(new Calendar_Model_EventFilter(array(
                  array('field' => 'container_id', 'operator' => 'in', 'value' => $this->_testCalendars->getId()),
              )), new Tinebase_Model_Pagination(array()));
Simple merge