use generic TestCase function for getTestContainer
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Sep 2014 09:46:22 +0000 (11:46 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Sat, 6 Sep 2014 13:29:57 +0000 (15:29 +0200)
Change-Id: I1bdcbd14604271ddce9e5bd514bb2e2b11fea8fa
Reviewed-on: http://gerrit.tine20.com/customers/1092
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Addressbook/Frontend/CardDAVTest.php

index 02be157..2256ef9 100644 (file)
@@ -32,7 +32,7 @@ class Addressbook_Frontend_CardDAVTest extends TestCase
     {
         $collection = new Addressbook_Frontend_WebDAV(\Sabre\CardDAV\Plugin::ADDRESSBOOK_ROOT . '/' . Tinebase_Core::getUser()->contact_id, true);
         
-        $child = $collection->getChild($this->_getTestContainer()->getId());
+        $child = $collection->getChild($this->_getTestContainer('Addressbook')->getId());
         
         $this->assertTrue($child instanceof Addressbook_Frontend_WebDAV_Container);
     }
@@ -87,21 +87,4 @@ class Addressbook_Frontend_CardDAVTest extends TestCase
     
         $this->assertGreaterThanOrEqual(2, count($children), 'there should be more than one container');
     }
-    
-    /**
-     * create test container
-     * 
-     * @return Tinebase_Model_Container
-     */
-    protected function _getTestContainer()
-    {
-        $container = Tinebase_Container::getInstance()->addContainer(new Tinebase_Model_Container(array(
-            'name'              => Tinebase_Record_Abstract::generateUID(),
-            'type'              => Tinebase_Model_Container::TYPE_PERSONAL,
-            'backend'           => 'Sql',
-            'application_id'    => Tinebase_Application::getInstance()->getApplicationByName('Addressbook')->getId(),
-        )));
-        
-        return $container;
-    }
 }