Ejemplo n.º 1
0
    /**
     * (non-PHPdoc)
     * @see Syncroton/Syncroton_TestCase::setUp()
     */
    public function setUp()
    {
        parent::setUp();
        // do initial sync first
        $doc = new DOMDocument();
        $doc->loadXML('<?xml version="1.0" encoding="utf-8"?>
			<!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
			<FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>');
        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
        $folderSync->handle();
        $responseDoc = $folderSync->getResponse();
        #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
        // create a test folder
        $doc = new DOMDocument();
        $doc->loadXML('<?xml version="1.0" encoding="utf-8"?>
			<!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
			<FolderCreate xmlns="uri:FolderHierarchy"><SyncKey>1</SyncKey><ParentId/><DisplayName>Test Folder</DisplayName><Type>14</Type></FolderCreate>');
        $folderCreate = new Syncroton_Command_FolderCreate($doc, $this->_device, null);
        $folderCreate->handle();
        $responseDoc = $folderCreate->getResponse();
        #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
        // parse id of created folder
        $xpath = new DomXPath($responseDoc);
        $xpath->registerNamespace('FolderHierarchy', 'uri:FolderHierarchy');
        $nodes = $xpath->query('//FolderHierarchy:FolderCreate/FolderHierarchy:ServerId');
        $this->_testFolderId = $nodes->item(0)->nodeValue;
    }
Ejemplo n.º 2
0
    public function setUp()
    {
        parent::setUp();
        // do initial sync first
        $doc = new DOMDocument();
        $doc->loadXML('<?xml version="1.0" encoding="utf-8"?>
			<!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
			<FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>');
        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
        $folderSync->handle();
        $responseDoc = $folderSync->getResponse();
    }
Ejemplo n.º 3
0
 public function tearDown()
 {
     parent::tearDown();
     header_remove();
 }
Ejemplo n.º 4
0
 public function setUp()
 {
     parent::setUp();
     $this->_policy = Syncroton_Registry::getPolicyBackend()->create(new Syncroton_Model_Policy(array('description' => 'description', 'policyKey' => '183384384', 'name' => 'PHPUNIT policy', 'allowBluetooth' => null, 'allowSMIMEEncryptionAlgorithmNegotiation' => 0, 'devicePasswordEnabled' => 1)));
     $this->_device->policyId = $this->_policy->id;
 }