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