0011428: support caldav sync token
[tine20] / tests / tine20 / Tinebase / WebDav / Plugin / AbstractBaseTest.php
1 <?php
2 /**
3  * Tine 2.0 - http://www.tine20.org
4  *
5  * @package     Tinebase
6  * @subpackage  WebDav
7  * @license     http://www.gnu.org/licenses/agpl.html
8  * @copyright   Copyright (c) 2015-2015 Metaways Infosystems GmbH (http://www.metaways.de)
9  * @author      Paul Mehrer <p.mehrer@metaways.de>
10  */
11
12 /**
13  * Test helper
14  */
15 require_once 'vendor/sabre/dav/tests/Sabre/HTTP/ResponseMock.php';
16
17
18 /**
19  * Abstract test class for Tinebase_WebDav_Plugin_*
20  */
21 abstract class Tinebase_WebDav_Plugin_AbstractBaseTest extends TestCase
22 {
23     /**
24      *
25      * @var Sabre\DAV\Server
26      */
27     protected $server;
28
29     /**
30      *
31      * @var Sabre\HTTP\ResponseMock
32      */
33     protected $response;
34
35     /**
36      * @var array test objects
37      */
38     protected $objects = array();
39
40     /**
41      * Sets up the fixture.
42      * This method is called before a test is executed.
43      *
44      * @access protected
45      */
46     protected function setUp()
47     {
48         parent::setUp();
49
50         $this->server = new Sabre\DAV\Server(new Tinebase_WebDav_Root());
51
52         $this->response = new Sabre\HTTP\ResponseMock();
53         $this->server->httpResponse = $this->response;
54     }
55
56     /**
57      * Setups a personal calendar
58      */
59     protected function setupCalendarContainer()
60     {
61         $this->objects['initialContainer'] = Tinebase_Container::getInstance()->addContainer(new Tinebase_Model_Container(array(
62             'name'              => Tinebase_Record_Abstract::generateUID(),
63             'type'              => Tinebase_Model_Container::TYPE_PERSONAL,
64             'backend'           => 'Sql',
65             'application_id'    => Tinebase_Application::getInstance()->getApplicationByName('Calendar')->getId(),
66         )));
67         Tinebase_Container::getInstance()->increaseContentSequence($this->objects['initialContainer']);
68     }
69 }