1*a1a3b679SAndreas Boehler<?php 2*a1a3b679SAndreas Boehler 3*a1a3b679SAndreas Boehlernamespace Sabre\CardDAV; 4*a1a3b679SAndreas Boehler 5*a1a3b679SAndreas Boehleruse Sabre\DAV; 6*a1a3b679SAndreas Boehleruse Sabre\DAVACL; 7*a1a3b679SAndreas Boehleruse Sabre\HTTP; 8*a1a3b679SAndreas Boehler 9*a1a3b679SAndreas Boehlerabstract class AbstractPluginTest extends \PHPUnit_Framework_TestCase { 10*a1a3b679SAndreas Boehler 11*a1a3b679SAndreas Boehler /** 12*a1a3b679SAndreas Boehler * @var Sabre\CardDAV\Plugin 13*a1a3b679SAndreas Boehler */ 14*a1a3b679SAndreas Boehler protected $plugin; 15*a1a3b679SAndreas Boehler /** 16*a1a3b679SAndreas Boehler * @var Sabre\DAV\Server 17*a1a3b679SAndreas Boehler */ 18*a1a3b679SAndreas Boehler protected $server; 19*a1a3b679SAndreas Boehler /** 20*a1a3b679SAndreas Boehler * @var Sabre\CardDAV\Backend\Mock; 21*a1a3b679SAndreas Boehler */ 22*a1a3b679SAndreas Boehler protected $backend; 23*a1a3b679SAndreas Boehler 24*a1a3b679SAndreas Boehler function setUp() { 25*a1a3b679SAndreas Boehler 26*a1a3b679SAndreas Boehler $this->backend = new Backend\Mock(); 27*a1a3b679SAndreas Boehler $principalBackend = new DAVACL\PrincipalBackend\Mock(); 28*a1a3b679SAndreas Boehler 29*a1a3b679SAndreas Boehler $tree = array( 30*a1a3b679SAndreas Boehler new AddressBookRoot($principalBackend, $this->backend), 31*a1a3b679SAndreas Boehler new DAVACL\PrincipalCollection($principalBackend) 32*a1a3b679SAndreas Boehler ); 33*a1a3b679SAndreas Boehler 34*a1a3b679SAndreas Boehler $this->plugin = new Plugin(); 35*a1a3b679SAndreas Boehler $this->plugin->directories = array('directory'); 36*a1a3b679SAndreas Boehler $this->server = new DAV\Server($tree); 37*a1a3b679SAndreas Boehler $this->server->sapi = new HTTP\SapiMock(); 38*a1a3b679SAndreas Boehler $this->server->addPlugin($this->plugin); 39*a1a3b679SAndreas Boehler $this->server->debugExceptions = true; 40*a1a3b679SAndreas Boehler 41*a1a3b679SAndreas Boehler } 42*a1a3b679SAndreas Boehler 43*a1a3b679SAndreas Boehler} 44