renamed Syncope to Syncroton
authorLars Kneschke <l.kneschke@metaways.de>
Sun, 18 Mar 2012 09:37:38 +0000 (10:37 +0100)
committerLars Kneschke <l.kneschke@metaways.de>
Sun, 18 Mar 2012 09:37:38 +0000 (10:37 +0100)
74 files changed:
docs/syncroton.sql [moved from docs/syncope.sql with 100% similarity]
lib/Syncroton/Backend/Content.php [moved from lib/Syncope/Backend/Content.php with 66% similarity]
lib/Syncroton/Backend/Device.php [moved from lib/Syncope/Backend/Device.php with 75% similarity]
lib/Syncroton/Backend/Folder.php [moved from lib/Syncope/Backend/Folder.php with 69% similarity]
lib/Syncroton/Backend/IContent.php [moved from lib/Syncope/Backend/IContent.php with 61% similarity]
lib/Syncroton/Backend/IDevice.php [moved from lib/Syncope/Backend/IDevice.php with 67% similarity]
lib/Syncroton/Backend/IFolder.php [moved from lib/Syncope/Backend/IFolder.php with 67% similarity]
lib/Syncroton/Backend/ISyncState.php [moved from lib/Syncope/Backend/ISyncState.php with 64% similarity]
lib/Syncroton/Backend/SyncState.php [moved from lib/Syncope/Backend/SyncState.php with 68% similarity]
lib/Syncroton/Command/FolderCreate.php [moved from lib/Syncope/Command/FolderCreate.php with 71% similarity]
lib/Syncroton/Command/FolderDelete.php [moved from lib/Syncope/Command/FolderDelete.php with 75% similarity]
lib/Syncroton/Command/FolderSync.php [moved from lib/Syncope/Command/FolderSync.php with 93% similarity]
lib/Syncroton/Command/FolderUpdate.php [moved from lib/Syncope/Command/FolderUpdate.php with 100% similarity]
lib/Syncroton/Command/GetAttachment.php [moved from lib/Syncope/Command/GetAttachment.php with 94% similarity]
lib/Syncroton/Command/GetItemEstimate.php [moved from lib/Syncope/Command/GetItemEstimate.php with 94% similarity]
lib/Syncroton/Command/Interface.php [moved from lib/Syncope/Command/Interface.php with 82% similarity]
lib/Syncroton/Command/ItemOperations.php [moved from lib/Syncope/Command/ItemOperations.php with 87% similarity]
lib/Syncroton/Command/MoveItems.php [moved from lib/Syncope/Command/MoveItems.php with 81% similarity]
lib/Syncroton/Command/Options.php [moved from lib/Syncope/Command/Options.php with 93% similarity]
lib/Syncroton/Command/Ping.php [moved from lib/Syncope/Command/Ping.php with 93% similarity]
lib/Syncroton/Command/Provision.php [moved from lib/Syncope/Command/Provision.php with 98% similarity]
lib/Syncroton/Command/Search.php [moved from lib/Syncope/Command/Search.php with 93% similarity]
lib/Syncroton/Command/SendMail.php [moved from lib/Syncope/Command/SendMail.php with 97% similarity]
lib/Syncroton/Command/Settings.php [moved from lib/Syncope/Command/Settings.php with 96% similarity]
lib/Syncroton/Command/SmartForward.php [moved from lib/Syncope/Command/SmartForward.php with 93% similarity]
lib/Syncroton/Command/SmartReply.php [moved from lib/Syncope/Command/SmartReply.php with 92% similarity]
lib/Syncroton/Command/Sync.php [moved from lib/Syncope/Command/Sync.php with 95% similarity]
lib/Syncroton/Command/Wbxml.php [moved from lib/Syncope/Command/Wbxml.php with 75% similarity]
lib/Syncroton/Data/AData.php [moved from lib/Syncope/Data/AData.php with 60% similarity]
lib/Syncroton/Data/Calendar.php [moved from lib/Syncope/Data/Calendar.php with 84% similarity]
lib/Syncroton/Data/Contacts.php [moved from lib/Syncope/Data/Contacts.php with 82% similarity]
lib/Syncroton/Data/Email.php [moved from lib/Syncope/Data/Email.php with 88% similarity]
lib/Syncroton/Data/Factory.php [moved from lib/Syncope/Data/Factory.php with 67% similarity]
lib/Syncroton/Data/IData.php [moved from lib/Syncope/Data/IData.php with 82% similarity]
lib/Syncroton/Data/Tasks.php [moved from lib/Syncope/Data/Tasks.php with 86% similarity]
lib/Syncroton/Exception/NotFound.php [moved from lib/Syncope/Exception/NotFound.php with 76% similarity]
lib/Syncroton/Exception/UnexpectedValue.php [moved from lib/Syncope/Exception/UnexpectedValue.php with 72% similarity]
lib/Syncroton/Model/Content.php [moved from lib/Syncope/Model/Content.php with 81% similarity]
lib/Syncroton/Model/Device.php [moved from lib/Syncope/Model/Device.php with 90% similarity]
lib/Syncroton/Model/Folder.php [moved from lib/Syncope/Model/Folder.php with 88% similarity]
lib/Syncroton/Model/IContent.php [moved from lib/Syncope/Model/IContent.php with 92% similarity]
lib/Syncroton/Model/IDevice.php [moved from lib/Syncope/Model/IDevice.php with 94% similarity]
lib/Syncroton/Model/IFolder.php [moved from lib/Syncope/Model/IFolder.php with 92% similarity]
lib/Syncroton/Model/ISyncState.php [moved from lib/Syncope/Model/ISyncState.php with 91% similarity]
lib/Syncroton/Model/SyncState.php [moved from lib/Syncope/Model/SyncState.php with 87% similarity]
lib/Syncroton/Registry.php [moved from lib/Syncope/Registry.php with 91% similarity]
lib/Syncroton/Server.php [moved from lib/Syncope/Server.php with 88% similarity]
lib/Syncroton/TransactionManager.php [moved from lib/Syncope/TransactionManager.php with 89% similarity]
lib/Syncroton/TransactionManagerInterface.php [moved from lib/Syncope/TransactionManagerInterface.php with 85% similarity]
tests/Syncope/Command/ATestCase.php [deleted file]
tests/Syncope/Command/AllTests.php [deleted file]
tests/Syncroton/AllTests.php [moved from tests/Syncope/AllTests.php with 63% similarity]
tests/Syncroton/Backend/AllTests.php [moved from tests/Syncope/Backend/AllTests.php with 60% similarity]
tests/Syncroton/Backend/ContentTests.php [moved from tests/Syncope/Backend/ContentTests.php with 72% similarity]
tests/Syncroton/Backend/DeviceTests.php [moved from tests/Syncope/Backend/DeviceTests.php with 74% similarity]
tests/Syncroton/Backend/FolderTests.php [moved from tests/Syncope/Backend/FolderTests.php with 74% similarity]
tests/Syncroton/Backend/SyncStateTests.php [moved from tests/Syncope/Backend/SyncStateTests.php with 81% similarity]
tests/Syncroton/Command/ATestCase.php [new file with mode: 0644]
tests/Syncroton/Command/AllTests.php [new file with mode: 0755]
tests/Syncroton/Command/FolderCreateTests.php [moved from tests/Syncope/Command/FolderCreateTests.php with 86% similarity]
tests/Syncroton/Command/FolderDeleteTests.php [moved from tests/Syncope/Command/FolderDeleteTests.php with 85% similarity]
tests/Syncroton/Command/FolderSyncTests.php [moved from tests/Syncope/Command/FolderSyncTests.php with 84% similarity]
tests/Syncroton/Command/GetItemEstimateTests.php [moved from tests/Syncope/Command/GetItemEstimateTests.php with 85% similarity]
tests/Syncroton/Command/ItemOperationsTests.php [moved from tests/Syncope/Command/ItemOperationsTests.php with 83% similarity]
tests/Syncroton/Command/MoveItemsTests.php [moved from tests/Syncope/Command/MoveItemsTests.php with 83% similarity]
tests/Syncroton/Command/PingTests.php [moved from tests/Syncope/Command/PingTests.php with 84% similarity]
tests/Syncroton/Command/ProvisionTests.php [moved from tests/Syncope/Command/ProvisionTests.php with 79% similarity]
tests/Syncroton/Command/SearchTests.php [moved from tests/Syncope/Command/SearchTests.php with 84% similarity]
tests/Syncroton/Command/SettingsTests.php [moved from tests/Syncope/Command/SettingsTests.php with 86% similarity]
tests/Syncroton/Command/SyncTests.php [moved from tests/Syncope/Command/SyncTests.php with 87% similarity]
tests/Syncroton/Data/AllTests.php [moved from tests/Syncope/Data/AllTests.php with 72% similarity]
tests/Syncroton/Data/ContactsTests.php [moved from tests/Syncope/Data/ContactsTests.php with 79% similarity]
tests/Syncroton/ServerTests.php [moved from tests/Syncope/ServerTests.php with 92% similarity]
tests/bootstrap.php

similarity index 100%
rename from docs/syncope.sql
rename to docs/syncroton.sql
similarity index 66%
rename from lib/Syncope/Backend/Content.php
rename to lib/Syncroton/Backend/Content.php
index a974086..b601178 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Tine 2.0
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @author      Lars Kneschke <l.kneschke@metaways.de>
 /**
  * sql backend class for the folder state
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  */
-class Syncope_Backend_Content implements Syncope_Backend_IContent
+class Syncroton_Backend_Content implements Syncroton_Backend_IContent
 {
     /**
      * the database adapter
@@ -27,7 +27,7 @@ class Syncope_Backend_Content implements Syncope_Backend_IContent
     
     protected $_tablePrefix;
     
-    public function __construct(Zend_Db_Adapter_Abstract $_db, $_tablePrefix = 'syncope_')
+    public function __construct(Zend_Db_Adapter_Abstract $_db, $_tablePrefix = 'Syncroton_')
     {
         $this->_db          = $_db;
         $this->_tablePrefix = $_tablePrefix;
@@ -36,15 +36,15 @@ class Syncope_Backend_Content implements Syncope_Backend_IContent
     /**
      * create new content state
      *
-     * @param Syncope_Model_IContent $_state
-     * @return Syncope_Model_IContent
+     * @param Syncroton_Model_IContent $_state
+     * @return Syncroton_Model_IContent
      */
-    public function create(Syncope_Model_IContent $_state)
+    public function create(Syncroton_Model_IContent $_state)
     {
         $id = sha1(mt_rand(). microtime());
         
-        $deviceId = $_state->device_id instanceof Syncope_Model_IDevice ? $_state->device_id->id : $_state->device_id;
-        $folderId = $_state->folder_id instanceof Syncope_Model_IFolder ? $_state->folder_id->id : $_state->folder_id;
+        $deviceId = $_state->device_id instanceof Syncroton_Model_IDevice ? $_state->device_id->id : $_state->device_id;
+        $folderId = $_state->folder_id instanceof Syncroton_Model_IFolder ? $_state->folder_id->id : $_state->folder_id;
         
         $this->_db->insert($this->_tablePrefix . 'content', array(
             'id'               => $id, 
@@ -63,11 +63,11 @@ class Syncope_Backend_Content implements Syncope_Backend_IContent
      * mark state as deleted. The state gets removed finally, 
      * when the synckey gets validated during next sync.
      * 
-     * @param Syncope_Model_IContent|string $_id
+     * @param Syncroton_Model_IContent|string $_id
      */
     public function delete($_id)
     {
-        $id = $_id instanceof Syncope_Model_IContent ? $_id->id : $_id;
+        $id = $_id instanceof Syncroton_Model_IContent ? $_id->id : $_id;
         
         $this->_db->update($this->_tablePrefix . 'content', array(
             'is_deleted' => 1
@@ -79,8 +79,8 @@ class Syncope_Backend_Content implements Syncope_Backend_IContent
     
     /**
      * @param string  $_id
-     * @throws Syncope_Exception_NotFound
-     * @return Syncope_Model_IContent
+     * @throws Syncroton_Exception_NotFound
+     * @return Syncroton_Model_IContent
      */
     public function get($_id)
     {
@@ -89,10 +89,10 @@ class Syncope_Backend_Content implements Syncope_Backend_IContent
             ->where('id = ?', $_id);
     
         $stmt = $this->_db->query($select);
-        $state = $stmt->fetchObject('Syncope_Model_Content');
+        $state = $stmt->fetchObject('Syncroton_Model_Content');
         
-        if (! $state instanceof Syncope_Model_IContent) {
-            throw new Syncope_Exception_NotFound('id not found');
+        if (! $state instanceof Syncroton_Model_IContent) {
+            throw new Syncroton_Exception_NotFound('id not found');
         }
         
         if (!empty($state->creation_time)) {
@@ -103,15 +103,15 @@ class Syncope_Backend_Content implements Syncope_Backend_IContent
     }
     
     /**
-     * @param Syncope_Model_IDevice|string $_deviceId
-     * @param Syncope_Model_IFolder|string $_folderId
+     * @param Syncroton_Model_IDevice|string $_deviceId
+     * @param Syncroton_Model_IFolder|string $_folderId
      * @param string $_contentId
-     * @return Syncope_Model_IContent
+     * @return Syncroton_Model_IContent
      */
     public function getContentState($_deviceId, $_folderId, $_contentId)
     {
-        $deviceId = $_deviceId instanceof Syncope_Model_IDevice ? $_deviceId->id : $_deviceId;
-        $folderId = $_folderId instanceof Syncope_Model_IFolder ? $_folderId->id : $_folderId;
+        $deviceId = $_deviceId instanceof Syncroton_Model_IDevice ? $_deviceId->id : $_deviceId;
+        $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->id : $_folderId;
     
         $select = $this->_db->select()
             ->from($this->_tablePrefix . 'content')
@@ -121,10 +121,10 @@ class Syncope_Backend_Content implements Syncope_Backend_IContent
             ->where($this->_db->quoteIdentifier('is_deleted') . ' = ?', 0);
     
         $stmt = $this->_db->query($select);
-        $state = $stmt->fetchObject('Syncope_Model_Content');
+        $state = $stmt->fetchObject('Syncroton_Model_Content');
         
-        if (! $state instanceof Syncope_Model_IContent) {
-            throw new Syncope_Exception_NotFound('id not found');
+        if (! $state instanceof Syncroton_Model_IContent) {
+            throw new Syncroton_Exception_NotFound('id not found');
         }
         
         if (!empty($state->creation_time)) {
@@ -137,14 +137,14 @@ class Syncope_Backend_Content implements Syncope_Backend_IContent
     /**
      * get array of ids which got send to the client for a given class
      *
-     * @param Syncope_Model_IDevice|string $_deviceId
-     * @param Syncope_Model_IFolder|string $_folderId
+     * @param Syncroton_Model_IDevice|string $_deviceId
+     * @param Syncroton_Model_IFolder|string $_folderId
      * @return array
      */
     public function getFolderState($_deviceId, $_folderId)
     {
-        $deviceId = $_deviceId instanceof Syncope_Model_IDevice ? $_deviceId->id : $_deviceId;
-        $folderId = $_folderId instanceof Syncope_Model_IFolder ? $_folderId->id : $_folderId;
+        $deviceId = $_deviceId instanceof Syncroton_Model_IDevice ? $_deviceId->id : $_deviceId;
+        $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->id : $_folderId;
                 
         $select = $this->_db->select()
             ->from($this->_tablePrefix . 'content', 'contentid')
@@ -161,13 +161,13 @@ class Syncope_Backend_Content implements Syncope_Backend_IContent
     /**
      * reset list of stored id
      *
-     * @param Syncope_Model_IDevice|string $_deviceId
-     * @param Syncope_Model_IFolder|string $_folderId
+     * @param Syncroton_Model_IDevice|string $_deviceId
+     * @param Syncroton_Model_IFolder|string $_folderId
      */
     public function resetState($_deviceId, $_folderId)
     {
-        $deviceId = $_deviceId instanceof Syncope_Model_IDevice ? $_deviceId->id : $_deviceId;
-        $folderId = $_folderId instanceof Syncope_Model_IFolder ? $_folderId->id : $_folderId;
+        $deviceId = $_deviceId instanceof Syncroton_Model_IDevice ? $_deviceId->id : $_deviceId;
+        $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->id : $_folderId;
          
         $where = array(
             $this->_db->quoteInto($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId),
similarity index 75%
rename from lib/Syncope/Backend/Device.php
rename to lib/Syncroton/Backend/Device.php
index 36a25b3..63c0bdd 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -15,7 +15,7 @@
  * @package     Backend
  */
  
-class Syncope_Backend_Device implements Syncope_Backend_IDevice
+class Syncroton_Backend_Device implements Syncroton_Backend_IDevice
 {
     /**
      * the database adapter
@@ -26,7 +26,7 @@ class Syncope_Backend_Device implements Syncope_Backend_IDevice
     
     protected $_tablePrefix;
     
-    public function __construct(Zend_Db_Adapter_Abstract $_db, $_tablePrefix = 'syncope_')
+    public function __construct(Zend_Db_Adapter_Abstract $_db, $_tablePrefix = 'Syncroton_')
     {
         $this->_db          = $_db;
         $this->_tablePrefix = $_tablePrefix;
@@ -35,10 +35,10 @@ class Syncope_Backend_Device implements Syncope_Backend_IDevice
     /**
      * create new device
      * 
-     * @param Syncope_Model_IDevice $_device
-     * @return Syncope_Model_IDevice
+     * @param Syncroton_Model_IDevice $_device
+     * @return Syncroton_Model_IDevice
      */
-    public function create(Syncope_Model_IDevice $_device)
+    public function create(Syncroton_Model_IDevice $_device)
     {
         $id = sha1(mt_rand(). microtime());
         
@@ -59,8 +59,8 @@ class Syncope_Backend_Device implements Syncope_Backend_IDevice
     
     /**
      * @param string  $_id
-     * @throws Syncope_Exception_NotFound
-     * @return Syncope_Model_IDevice
+     * @throws Syncroton_Exception_NotFound
+     * @return Syncroton_Model_IDevice
      */
     public function get($_id)
     {
@@ -69,10 +69,10 @@ class Syncope_Backend_Device implements Syncope_Backend_IDevice
             ->where('id = ?', $_id);
             
         $stmt = $this->_db->query($select);
-        $device = $stmt->fetchObject('Syncope_Model_Device');
+        $device = $stmt->fetchObject('Syncroton_Model_Device');
         
-        if (! $device instanceof Syncope_Model_IDevice) {
-            throw new Syncope_Exception_NotFound('id not found');
+        if (! $device instanceof Syncroton_Model_IDevice) {
+            throw new Syncroton_Exception_NotFound('id not found');
         }
         
         return $device;
@@ -83,8 +83,8 @@ class Syncope_Backend_Device implements Syncope_Backend_IDevice
      * 
      * @param  string  $userId
      * @param  string  $deviceId
-     * @throws Syncope_Exception_NotFound
-     * @return Syncope_Model_Device
+     * @throws Syncroton_Exception_NotFound
+     * @return Syncroton_Model_Device
      */
     public function getUserDevice($ownerId, $deviceId)
     {
@@ -94,10 +94,10 @@ class Syncope_Backend_Device implements Syncope_Backend_IDevice
             ->where('deviceid = ?', $deviceId);
         
         $stmt = $this->_db->query($select);
-        $device = $stmt->fetchObject('Syncope_Model_Device');
+        $device = $stmt->fetchObject('Syncroton_Model_Device');
         
-        if (! $device instanceof Syncope_Model_IDevice) {
-            throw new Syncope_Exception_NotFound('device not found');
+        if (! $device instanceof Syncroton_Model_IDevice) {
+            throw new Syncroton_Exception_NotFound('device not found');
         }
         
         return $device;
@@ -105,14 +105,14 @@ class Syncope_Backend_Device implements Syncope_Backend_IDevice
     
     public function delete($_id)
     {
-        $id = $_id instanceof Syncope_Model_IDevice ? $_id->id : $id;
+        $id = $_id instanceof Syncroton_Model_IDevice ? $_id->id : $id;
         
         $result = $this->_db->delete($this->_tablePrefix . 'device', array('id = ?' => $id));
         
         return (bool) $result;
     }
     
-    public function update(Syncope_Model_IDevice $_device)
+    public function update(Syncroton_Model_IDevice $_device)
     {
         $this->_db->update($this->_tablePrefix . 'device', array(
             'acsversion'   => $_device->acsversion,
similarity index 69%
rename from lib/Syncope/Backend/Folder.php
rename to lib/Syncroton/Backend/Folder.php
index 254c5e7..8a52597 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Tine 2.0
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @author      Lars Kneschke <l.kneschke@metaways.de>
 /**
  * sql backend class for the folder state
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  */
-class Syncope_Backend_Folder implements Syncope_Backend_IFolder
+class Syncroton_Backend_Folder implements Syncroton_Backend_IFolder
 {
     /**
      * the database adapter
@@ -27,7 +27,7 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
     
     protected $_tablePrefix;
     
-    public function __construct(Zend_Db_Adapter_Abstract $_db, $_tablePrefix = 'syncope_')
+    public function __construct(Zend_Db_Adapter_Abstract $_db, $_tablePrefix = 'Syncroton_')
     {
         $this->_db = $_db;
         
@@ -37,19 +37,19 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
     /**
      * create new folder state
      *
-     * @param Syncope_Model_IFolder $_folder
-     * @return Syncope_Model_IFolder
+     * @param Syncroton_Model_IFolder $_folder
+     * @return Syncroton_Model_IFolder
      */
-    public function create(Syncope_Model_IFolder $_folder)
+    public function create(Syncroton_Model_IFolder $_folder)
     {
         $id = sha1(mt_rand(). microtime());
-        $deviceId = $_folder->device_id instanceof Syncope_Model_IDevice ? $_folder->device_id->id : $_folder->device_id;
+        $deviceId = $_folder->device_id instanceof Syncroton_Model_IDevice ? $_folder->device_id->id : $_folder->device_id;
     
         $this->_db->insert($this->_tablePrefix . 'folder', array(
             'id'             => $id, 
             'device_id'      => $deviceId,
             'class'          => $_folder->class,
-            'folderid'       => $_folder->folderid instanceof Syncope_Model_IFolder ? $_folder->folderid->id : $_folder->folderid,
+            'folderid'       => $_folder->folderid instanceof Syncroton_Model_IFolder ? $_folder->folderid->id : $_folder->folderid,
             'parentid'       => $_folder->parentid,
             'displayname'    => $_folder->displayname,
             'type'           => $_folder->type,
@@ -62,7 +62,7 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
     
     public function delete($_id)
     {
-        $id = $_id instanceof Syncope_Model_IFolder ? $_id->id : $_id;
+        $id = $_id instanceof Syncroton_Model_IFolder ? $_id->id : $_id;
     
         $result = $this->_db->delete($this->_tablePrefix . 'folder', array('id = ?' => $id));
     
@@ -71,8 +71,8 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
     
     /**
      * @param string  $_id
-     * @throws Syncope_Exception_NotFound
-     * @return Syncope_Model_IFolder
+     * @throws Syncroton_Exception_NotFound
+     * @return Syncroton_Model_IFolder
      */
     public function get($_id)
     {
@@ -81,10 +81,10 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
             ->where('id = ?', $_id);
     
         $stmt = $this->_db->query($select);
-        $state = $stmt->fetchObject('Syncope_Model_Folder');
+        $state = $stmt->fetchObject('Syncroton_Model_Folder');
         
-        if (! $state instanceof Syncope_Model_IFolder) {
-            throw new Syncope_Exception_NotFound('id not found');
+        if (! $state instanceof Syncroton_Model_IFolder) {
+            throw new Syncroton_Exception_NotFound('id not found');
         }
         
         if (!empty($state->creation_time)) {
@@ -97,12 +97,12 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
     /**
      * delete all stored folderId's for given device
      *
-     * @param Syncope_Model_Device|string $_deviceId
+     * @param Syncroton_Model_Device|string $_deviceId
      * @param string $_class
      */
     public function resetState($_deviceId)
     {
-        $deviceId = $_deviceId instanceof Syncope_Model_IDevice ? $_deviceId->id : $_deviceId;
+        $deviceId = $_deviceId instanceof Syncroton_Model_IDevice ? $_deviceId->id : $_deviceId;
          
         $where = array(
             $this->_db->quoteInto($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId)
@@ -111,9 +111,9 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
         $this->_db->delete($this->_tablePrefix . 'folder', $where);
     }
     
-    public function update(Syncope_Model_IFolder $_folder)
+    public function update(Syncroton_Model_IFolder $_folder)
     {
-        $deviceId = $_folder->device_id instanceof Syncope_Model_IDevice ? $_folder->device_id->id : $_folder->device_id;
+        $deviceId = $_folder->device_id instanceof Syncroton_Model_IDevice ? $_folder->device_id->id : $_folder->device_id;
     
         $this->_db->update($this->_tablePrefix . 'folder', array(
             'lastfiltertype'     => $_folder->lastfiltertype
@@ -127,13 +127,13 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
     /**
      * get array of ids which got send to the client for a given class
      *
-     * @param Syncope_Model_Device|string $_deviceId
+     * @param Syncroton_Model_Device|string $_deviceId
      * @param string $_class
      * @return array
      */
     public function getFolderState($_deviceId, $_class)
     {
-        $deviceId = $_deviceId instanceof Syncope_Model_IDevice ? $_deviceId->id : $_deviceId;
+        $deviceId = $_deviceId instanceof Syncroton_Model_IDevice ? $_deviceId->id : $_deviceId;
         
         $select = $this->_db->select()
             ->from($this->_tablePrefix . 'folder')
@@ -143,7 +143,7 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
         $result = array();
         
         $stmt = $this->_db->query($select);
-        while ($row = $stmt->fetchObject("Syncope_Model_Folder")) {
+        while ($row = $stmt->fetchObject("Syncroton_Model_Folder")) {
             $result[$row->folderid] = $row; 
         }
         
@@ -153,13 +153,13 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
     /**
      * get folder indentified by $_folderId
      *
-     * @param  Syncope_Model_Device|string  $_deviceId
+     * @param  Syncroton_Model_Device|string  $_deviceId
      * @param  string                       $_folderId
-     * @return Syncope_Model_IFolder
+     * @return Syncroton_Model_IFolder
      */
     public function getFolder($_deviceId, $_folderId)
     {
-        $deviceId = $_deviceId instanceof Syncope_Model_IDevice ? $_deviceId->id : $_deviceId;
+        $deviceId = $_deviceId instanceof Syncroton_Model_IDevice ? $_deviceId->id : $_deviceId;
         
         $select = $this->_db->select()
             ->from($this->_tablePrefix . 'folder')
@@ -167,10 +167,10 @@ class Syncope_Backend_Folder implements Syncope_Backend_IFolder
             ->where($this->_db->quoteIdentifier('folderid') . ' = ?', $_folderId);
         
         $stmt = $this->_db->query($select);
-        $folder = $stmt->fetchObject('Syncope_Model_Folder');
+        $folder = $stmt->fetchObject('Syncroton_Model_Folder');
         
-        if (! $folder instanceof Syncope_Model_IFolder) {
-            throw new Syncope_Exception_NotFound('folder not found');
+        if (! $folder instanceof Syncroton_Model_IFolder) {
+            throw new Syncroton_Exception_NotFound('folder not found');
         }
         
         if (!empty($folder->creation_time)) {
similarity index 61%
rename from lib/Syncope/Backend/IContent.php
rename to lib/Syncroton/Backend/IContent.php
index d5dfa8a..b4e0f64 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Tine 2.0
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @author      Lars Kneschke <l.kneschke@metaways.de>
 /**
  * sql backend class for the folder state
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  */
-interface Syncope_Backend_IContent
+interface Syncroton_Backend_IContent
 {
     /**
      * create new content state
      *
-     * @param Syncope_Model_IContent $_contentState
-     * @return Syncope_Model_IContent
+     * @param Syncroton_Model_IContent $_contentState
+     * @return Syncroton_Model_IContent
      */
-    public function create(Syncope_Model_IContent $_contentState);
+    public function create(Syncroton_Model_IContent $_contentState);
         
     /**
      * mark state as deleted. The state gets removed finally, 
      * when the synckey gets validated during next sync.
      * 
-     * @param Syncope_Model_IContent|string $_id
+     * @param Syncroton_Model_IContent|string $_id
      */
     public function delete($_id);
     
     /**
-     * @param Syncope_Model_IDevice|string $_deviceId
-     * @param Syncope_Model_IFolder|string $_folderId
+     * @param Syncroton_Model_IDevice|string $_deviceId
+     * @param Syncroton_Model_IFolder|string $_folderId
      * @param string $_contentId
-     * @return Syncope_Model_IContent
+     * @return Syncroton_Model_IContent
      */
     public function getContentState($_deviceId, $_folderId, $_contentId);
 }
similarity index 67%
rename from lib/Syncope/Backend/IDevice.php
rename to lib/Syncroton/Backend/IDevice.php
index b0085b0..27fc0b6 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @package     Backend
  */
  
-interface Syncope_Backend_IDevice
+interface Syncroton_Backend_IDevice
 {
     /**
     * Create a new device
     *
-    * @param  Syncope_Model_IDevice $_device
-    * @return Syncope_Model_IDevice
+    * @param  Syncroton_Model_IDevice $_device
+    * @return Syncroton_Model_IDevice
     */
-    public function create(Syncope_Model_IDevice $_device);
+    public function create(Syncroton_Model_IDevice $_device);
     
     /**
      * Deletes one or more existing devices
@@ -37,22 +37,22 @@ interface Syncope_Backend_IDevice
      * Return a single device
      *
      * @param string $_id
-     * @return Syncope_Model_IDevice
+     * @return Syncroton_Model_IDevice
      */
     public function get($_id);
     
     /**
      * @param unknown_type $userId
      * @param unknown_type $deviceId
-     * @return Syncope_Model_IDevice
+     * @return Syncroton_Model_IDevice
      */
     public function getUserDevice($userId, $deviceId);
     
     /**
      * Upates an existing persistent record
      *
-     * @param  Syncope_Model_IDevice $_device
-     * @return Syncope_Model_IDevice
+     * @param  Syncroton_Model_IDevice $_device
+     * @return Syncroton_Model_IDevice
      */
-    public function update(Syncope_Model_IDevice $_device);    
+    public function update(Syncroton_Model_IDevice $_device);    
 }
similarity index 67%
rename from lib/Syncope/Backend/IFolder.php
rename to lib/Syncroton/Backend/IFolder.php
index 77b09f8..12c0f02 100755 (executable)
@@ -2,7 +2,7 @@
 /**
  * Tine 2.0
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @author      Lars Kneschke <l.kneschke@metaways.de>
 /**
  * sql backend class for the folder state
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  */
-interface Syncope_Backend_IFolder
+interface Syncroton_Backend_IFolder
 {
     /**
-     * @param Syncope_Model_IFolder $_folder
-     * @return Syncope_Model_IFolder
+     * @param Syncroton_Model_IFolder $_folder
+     * @return Syncroton_Model_IFolder
      */
-    public function create(Syncope_Model_IFolder $_folder);
+    public function create(Syncroton_Model_IFolder $_folder);
     
     public function delete($_id);
     
@@ -31,16 +31,16 @@ interface Syncope_Backend_IFolder
     /**
      * get folder indentified by $_folderId
      *
-     * @param  Syncope_Model_Device|string  $_deviceId
+     * @param  Syncroton_Model_Device|string  $_deviceId
      * @param  string                       $_folderId
-     * @return Syncope_Model_IFolder
+     * @return Syncroton_Model_IFolder
      */
     public function getFolder($_deviceId, $_folderId);
     
     /**
      * get array of ids which got send to the client for a given class
      *
-     * @param Syncope_Model_Device $_deviceId
+     * @param Syncroton_Model_Device $_deviceId
      * @param string $_class
      * @return array
      */
@@ -49,10 +49,10 @@ interface Syncope_Backend_IFolder
     /**
      * delete all stored folderId's for given device
      *
-     * @param Syncope_Model_Device $_deviceId
+     * @param Syncroton_Model_Device $_deviceId
      * @param string $_class
      */
     public function resetState($_deviceId);
     
-    public function update(Syncope_Model_IFolder $_folder);
+    public function update(Syncroton_Model_IFolder $_folder);
 }
similarity index 64%
rename from lib/Syncope/Backend/ISyncState.php
rename to lib/Syncroton/Backend/ISyncState.php
index e5a29ed..860c7f4 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Tine 2.0
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @author      Lars Kneschke <l.kneschke@metaways.de>
 /**
  * sql backend class for the folder state
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  */
-interface Syncope_Backend_ISyncState
+interface Syncroton_Backend_ISyncState
 {
     /**
      * create new sync state
      *
-     * @param Syncope_Model_ISyncState $_syncState
-     * @return Syncope_Model_ISyncState
+     * @param Syncroton_Model_ISyncState $_syncState
+     * @return Syncroton_Model_ISyncState
      */
-    public function create(Syncope_Model_ISyncState $_syncState);
+    public function create(Syncroton_Model_ISyncState $_syncState);
     
     public function resetState($_deviceId, $_type);
     
-    public function update(Syncope_Model_ISyncState $_syncState);
+    public function update(Syncroton_Model_ISyncState $_syncState);
     
     /**
      * get array of ids which got send to the client for a given class
      *
-     * @param Syncope_Model_Device $_deviceId
+     * @param Syncroton_Model_Device $_deviceId
      * @param string $_class
      * @return array
      */
similarity index 68%
rename from lib/Syncope/Backend/SyncState.php
rename to lib/Syncroton/Backend/SyncState.php
index 290550e..b965e6d 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Tine 2.0
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @author      Lars Kneschke <l.kneschke@metaways.de>
 /**
  * sql backend class for the folder state
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Backend
  */
-class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
+class Syncroton_Backend_SyncState implements Syncroton_Backend_ISyncState
 {
     /**
      * the database adapter
@@ -27,7 +27,7 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
     
     protected $_tablePrefix;
     
-    public function __construct(Zend_Db_Adapter_Abstract $_db, $_tablePrefix = 'syncope_')
+    public function __construct(Zend_Db_Adapter_Abstract $_db, $_tablePrefix = 'Syncroton_')
     {
         $this->_db          = $_db;
         $this->_tablePrefix = $_tablePrefix;
@@ -36,18 +36,18 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
     /**
      * create new sync state
      *
-     * @param Syncope_Model_ISyncState $_syncState
-     * @return Syncope_Model_SyncState
+     * @param Syncroton_Model_ISyncState $_syncState
+     * @return Syncroton_Model_SyncState
      */
-    public function create(Syncope_Model_ISyncState $_syncState, $_keepPreviousSyncState = true)
+    public function create(Syncroton_Model_ISyncState $_syncState, $_keepPreviousSyncState = true)
     {
         $id = sha1(mt_rand(). microtime());
-        $deviceId = $_syncState->device_id instanceof Syncope_Model_IDevice ? $_syncState->device_id->id : $_syncState->device_id;
+        $deviceId = $_syncState->device_id instanceof Syncroton_Model_IDevice ? $_syncState->device_id->id : $_syncState->device_id;
     
         $this->_db->insert($this->_tablePrefix . 'synckey', array(
             'id'          => $id, 
             'device_id'   => $deviceId,
-            'type'        => $_syncState->type instanceof Syncope_Model_IFolder ? $_syncState->type->id : $_syncState->type,
+            'type'        => $_syncState->type instanceof Syncroton_Model_IFolder ? $_syncState->type->id : $_syncState->type,
             'counter'     => $_syncState->counter,
             'lastsync'    => $_syncState->lastsync->format('Y-m-d H:i:s'),
             'pendingdata' => isset($_syncState->pendingdata) && is_array($_syncState->pendingdata) ? Zend_Json::encode($_syncState->pendingdata) : null
@@ -63,7 +63,7 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
         return $state;
     }
     
-    protected function _deleteOtherStates(Syncope_Model_ISyncState $_state)
+    protected function _deleteOtherStates(Syncroton_Model_ISyncState $_state)
     {
         // remove all other synckeys
         $where = array(
@@ -80,8 +80,8 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
     
     /**
      * @param string  $_id
-     * @throws Syncope_Exception_NotFound
-     * @return Syncope_Model_SyncState
+     * @throws Syncroton_Exception_NotFound
+     * @return Syncroton_Model_SyncState
      */
     public function get($_id)
     {
@@ -90,11 +90,11 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
             ->where('id = ?', $_id);
     
         $stmt = $this->_db->query($select);
-        $state = $stmt->fetchObject('Syncope_Model_SyncState');
+        $state = $stmt->fetchObject('Syncroton_Model_SyncState');
         $stmt = null; # see https://bugs.php.net/bug.php?id=44081
         
-        if (! $state instanceof Syncope_Model_ISyncState) {
-            throw new Syncope_Exception_NotFound('id not found');
+        if (! $state instanceof Syncroton_Model_ISyncState) {
+            throw new Syncroton_Exception_NotFound('id not found');
         }
         
         $this->_convertFields($state);
@@ -102,7 +102,7 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
         return $state;
     }
     
-    protected function _convertFields(Syncope_Model_SyncState $state)
+    protected function _convertFields(Syncroton_Model_SyncState $state)
     {
         if (!empty($state->lastsync)) {
             $state->lastsync = new DateTime($state->lastsync, new DateTimeZone('utc'));
@@ -115,14 +115,14 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
     /**
      * always returns the latest syncstate
      * 
-     * @param  Syncope_Model_IDevice|string  $_deviceId
-     * @param  Syncope_Model_IFolder|string  $_folderId
-     * @return Syncope_Model_SyncState
+     * @param  Syncroton_Model_IDevice|string  $_deviceId
+     * @param  Syncroton_Model_IFolder|string  $_folderId
+     * @return Syncroton_Model_SyncState
      */
     public function getSyncState($_deviceId, $_folderId)
     {
-        $deviceId = $_deviceId instanceof Syncope_Model_IDevice ? $_deviceId->id : $_deviceId;
-        $folderId = $_folderId instanceof Syncope_Model_IFolder ? $_folderId->id : $_folderId;
+        $deviceId = $_deviceId instanceof Syncroton_Model_IDevice ? $_deviceId->id : $_deviceId;
+        $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->id : $_folderId;
     
         $select = $this->_db->select()
             ->from($this->_tablePrefix . 'synckey')
@@ -132,11 +132,11 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
             ->limit(1);
         
         $stmt = $this->_db->query($select);
-        $state = $stmt->fetchObject('Syncope_Model_SyncState');
+        $state = $stmt->fetchObject('Syncroton_Model_SyncState');
         $stmt = null; # see https://bugs.php.net/bug.php?id=44081
         
-        if (! $state instanceof Syncope_Model_ISyncState) {
-            throw new Syncope_Exception_NotFound('id not found');
+        if (! $state instanceof Syncroton_Model_ISyncState) {
+            throw new Syncroton_Exception_NotFound('id not found');
         }
         
         $this->_convertFields($state);
@@ -147,13 +147,13 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
     /**
      * delete all stored synckeys for given type
      *
-     * @param  Syncope_Model_IDevice|string  $_deviceId
-     * @param  Syncope_Model_IFolder|string  $_folderId
+     * @param  Syncroton_Model_IDevice|string  $_deviceId
+     * @param  Syncroton_Model_IFolder|string  $_folderId
      */
     public function resetState($_deviceId, $_folderId)
     {
-        $deviceId = $_deviceId instanceof Syncope_Model_IDevice ? $_deviceId->id : $_deviceId;
-        $folderId = $_folderId instanceof Syncope_Model_IFolder ? $_folderId->id : $_folderId;
+        $deviceId = $_deviceId instanceof Syncroton_Model_IDevice ? $_deviceId->id : $_deviceId;
+        $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->id : $_folderId;
          
         $where = array(
             $this->_db->quoteInto($this->_db->quoteIdentifier('device_id') . ' = ?', $deviceId),
@@ -163,9 +163,9 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
         $this->_db->delete($this->_tablePrefix . 'synckey', $where);
     }
     
-    public function update(Syncope_Model_ISyncState $_syncState)
+    public function update(Syncroton_Model_ISyncState $_syncState)
     {
-        $deviceId = $_syncState->device_id instanceof Syncope_Model_IDevice ? $_syncState->device_id->id : $_syncState->device_id;
+        $deviceId = $_syncState->device_id instanceof Syncroton_Model_IDevice ? $_syncState->device_id->id : $_syncState->device_id;
         
         $this->_db->update($this->_tablePrefix . 'synckey', array(
             'counter'     => $_syncState->counter,
@@ -181,14 +181,14 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
     /**
      * get array of ids which got send to the client for a given class
      *
-     * @param  Syncope_Model_IDevice|string  $_deviceId
-     * @param  Syncope_Model_IFolder|string  $_folderId
-     * @return Syncope_Model_SyncState
+     * @param  Syncroton_Model_IDevice|string  $_deviceId
+     * @param  Syncroton_Model_IFolder|string  $_folderId
+     * @return Syncroton_Model_SyncState
      */
     public function validate($_deviceId, $_folderId, $_syncKey)
     {
-        $deviceId = $_deviceId instanceof Syncope_Model_IDevice ? $_deviceId->id : $_deviceId;
-        $folderId = $_folderId instanceof Syncope_Model_IFolder ? $_folderId->id : $_folderId;
+        $deviceId = $_deviceId instanceof Syncroton_Model_IDevice ? $_deviceId->id : $_deviceId;
+        $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->id : $_folderId;
         
         $select = $this->_db->select()
             ->from($this->_tablePrefix . 'synckey')
@@ -197,10 +197,10 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
             ->where($this->_db->quoteIdentifier('type')      . ' = ?', $folderId);
         
         $stmt = $this->_db->query($select);
-        $state = $stmt->fetchObject('Syncope_Model_SyncState');
+        $state = $stmt->fetchObject('Syncroton_Model_SyncState');
         $stmt = null; # see https://bugs.php.net/bug.php?id=44081
         
-        if (! $state instanceof Syncope_Model_ISyncState) {
+        if (! $state instanceof Syncroton_Model_ISyncState) {
             return false;
         }
 
@@ -214,12 +214,12 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
             ->where($this->_db->quoteIdentifier('type') . ' = ?', $folderId);
         
         $stmt = $this->_db->query($select);
-        $moreRecentState = $stmt->fetchObject('Syncope_Model_SyncState');
+        $moreRecentState = $stmt->fetchObject('Syncroton_Model_SyncState');
         $stmt = null; # see https://bugs.php.net/bug.php?id=44081
         
         // found more recent synckey => the last sync repsone got not received by the client
-        if ($moreRecentState instanceof Syncope_Model_ISyncState) {
-            // undelete entries marked as deleted in syncope_content table
+        if ($moreRecentState instanceof Syncroton_Model_ISyncState) {
+            // undelete entries marked as deleted in Syncroton_content table
             $this->_db->update($this->_tablePrefix . 'content', array(
                 'is_deleted'  => 0,
             ), array(
@@ -229,7 +229,7 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
                 'is_deleted = ?'       => 1
             ));
             
-            // remove entries added during latest sync in syncope_content table
+            // remove entries added during latest sync in Syncroton_content table
             $this->_db->delete($this->_tablePrefix . 'content', array(
                 'device_id = ?'        => $deviceId,
                 'folder_id = ?'        => $folderId,
@@ -237,7 +237,7 @@ class Syncope_Backend_SyncState implements Syncope_Backend_ISyncState
             ));
             
         } else {
-            // finaly delete all entries marked for removal in syncope_content table    
+            // finaly delete all entries marked for removal in Syncroton_content table    
             $this->_db->delete($this->_tablePrefix . 'content', array(
                 'device_id = ?'  => $deviceId,
                 'folder_id = ?'  => $folderId,
similarity index 71%
rename from lib/Syncope/Command/FolderCreate.php
rename to lib/Syncroton/Command/FolderCreate.php
index ec2e617..3d24fbd 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync FolderSync command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_FolderCreate extends Syncope_Command_Wbxml 
+class Syncroton_Command_FolderCreate extends Syncroton_Command_Wbxml 
 {        
     protected $_defaultNameSpace    = 'uri:FolderHierarchy';
     protected $_documentElement     = 'FolderCreate';
     
     protected $_classes             = array(
-        Syncope_Data_Factory::CLASS_CALENDAR,
-        Syncope_Data_Factory::CLASS_CONTACTS,
-        Syncope_Data_Factory::CLASS_EMAIL,
-        Syncope_Data_Factory::CLASS_TASKS
+        Syncroton_Data_Factory::CLASS_CALENDAR,
+        Syncroton_Data_Factory::CLASS_CONTACTS,
+        Syncroton_Data_Factory::CLASS_EMAIL,
+        Syncroton_Data_Factory::CLASS_TASKS
     );
     
     /**
@@ -54,20 +54,20 @@ class Syncope_Command_FolderCreate extends Syncope_Command_Wbxml
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " synckey is $this->_syncKey");        
         
         switch((int)$xml->Type) {
-            case Syncope_Command_FolderSync::FOLDERTYPE_CALENDAR_USER_CREATED:
-                $this->_class = Syncope_Data_Factory::CLASS_CALENDAR;
+            case Syncroton_Command_FolderSync::FOLDERTYPE_CALENDAR_USER_CREATED:
+                $this->_class = Syncroton_Data_Factory::CLASS_CALENDAR;
                 break;
                 
-            case Syncope_Command_FolderSync::FOLDERTYPE_CONTACT_USER_CREATED:
-                $this->_class = Syncope_Data_Factory::CLASS_CONTACTS;
+            case Syncroton_Command_FolderSync::FOLDERTYPE_CONTACT_USER_CREATED:
+                $this->_class = Syncroton_Data_Factory::CLASS_CONTACTS;
                 break;
                 
-            case Syncope_Command_FolderSync::FOLDERTYPE_MAIL_USER_CREATED:
-                $this->_class = Syncope_Data_Factory::CLASS_EMAIL;
+            case Syncroton_Command_FolderSync::FOLDERTYPE_MAIL_USER_CREATED:
+                $this->_class = Syncroton_Data_Factory::CLASS_EMAIL;
                 break;
                 
-            case Syncope_Command_FolderSync::FOLDERTYPE_TASK_USER_CREATED:
-                $this->_class = Syncope_Data_Factory::CLASS_TASKS;
+            case Syncroton_Command_FolderSync::FOLDERTYPE_TASK_USER_CREATED:
+                $this->_class = Syncroton_Data_Factory::CLASS_TASKS;
                 break;
         }
         
@@ -84,20 +84,20 @@ class Syncope_Command_FolderCreate extends Syncope_Command_Wbxml
         if($this->_syncState == false) {
             if ($this->_logger instanceof Zend_Log) 
                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . " INVALID synckey");
-            $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncope_Command_FolderSync::STATUS_INVALID_SYNC_KEY));
+            $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY));
         } else {
             $this->_syncState->counter++;
             
-            $dataController = Syncope_Data_Factory::factory($this->_class, $this->_device, $this->_syncTimeStamp);
+            $dataController = Syncroton_Data_Factory::factory($this->_class, $this->_device, $this->_syncTimeStamp);
             
             $folder = $dataController->createFolder($this->_parentId, $this->_displayName, $this->_type);
             
             // create xml output
-            $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status',   Syncope_Command_FolderSync::STATUS_SUCCESS));
+            $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status',   Syncroton_Command_FolderSync::STATUS_SUCCESS));
             $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'SyncKey',  $this->_syncState->counter));
             $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'ServerId', $folder['folderId']));
 
-            $folder = new Syncope_Model_Folder(array(
+            $folder = new Syncroton_Model_Folder(array(
                 'device_id'         => $this->_device,
                 'class'             => $this->_class,
                 'folderid'          => $folder['folderId'],
similarity index 75%
rename from lib/Syncope/Command/FolderDelete.php
rename to lib/Syncroton/Command/FolderDelete.php
index 4fb1dfd..0eb1d34 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync FolderDelete command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_FolderDelete extends Syncope_Command_Wbxml 
+class Syncroton_Command_FolderDelete extends Syncroton_Command_Wbxml 
 {        
     protected $_defaultNameSpace    = 'uri:FolderHierarchy';
     protected $_documentElement     = 'FolderDelete';
     
     protected $_classes             = array(
-        Syncope_Data_Factory::CLASS_CALENDAR,
-        Syncope_Data_Factory::CLASS_CONTACTS,
-        Syncope_Data_Factory::CLASS_EMAIL,
-        Syncope_Data_Factory::CLASS_TASKS
+        Syncroton_Data_Factory::CLASS_CALENDAR,
+        Syncroton_Data_Factory::CLASS_CONTACTS,
+        Syncroton_Data_Factory::CLASS_EMAIL,
+        Syncroton_Data_Factory::CLASS_TASKS
     );
     
     protected $_serverId;
     
     /**
-     * @var Syncope_Model_ISyncState
+     * @var Syncroton_Model_ISyncState
      */
     protected $_syncState;
     
@@ -53,12 +53,12 @@ class Syncope_Command_FolderDelete extends Syncope_Command_Wbxml
         try {
             $this->_folder = $this->_folderBackend->getFolder($this->_device, $folderId);
             
-            $dataController = Syncope_Data_Factory::factory($this->_folder->class, $this->_device, $this->_syncTimeStamp);
+            $dataController = Syncroton_Data_Factory::factory($this->_folder->class, $this->_device, $this->_syncTimeStamp);
             
             $dataController->deleteFolder($this->_folder);
             $this->_folderBackend->delete($this->_folder);
             
-        } catch (Syncope_Exception_NotFound $senf) {
+        } catch (Syncroton_Exception_NotFound $senf) {
             if ($this->_logger instanceof Zend_Log)
                 $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $senf->getMessage());
         }
@@ -76,19 +76,19 @@ class Syncope_Command_FolderDelete extends Syncope_Command_Wbxml
         if($this->_syncState == false) {
             if ($this->_logger instanceof Zend_Log)
                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . " INVALID synckey");
-            $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncope_Command_FolderSync::STATUS_INVALID_SYNC_KEY));
+            $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY));
         } else {
-            if ($this->_folder instanceof Syncope_Model_IFolder) {
+            if ($this->_folder instanceof Syncroton_Model_IFolder) {
                 $this->_syncState->counter++;
                 
                 // create xml output
-                $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncope_Command_FolderSync::STATUS_SUCCESS));
+                $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_SUCCESS));
                 $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'SyncKey', $this->_syncState->counter));
                 
                 $this->_syncStateBackend->update($this->_syncState);
             } else {
                 // create xml output
-                $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncope_Command_FolderSync::STATUS_FOLDER_NOT_FOUND));
+                $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_FOLDER_NOT_FOUND));
                 $folderDelete->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'SyncKey', $this->_syncState->counter));
             }
         }
similarity index 93%
rename from lib/Syncope/Command/FolderSync.php
rename to lib/Syncroton/Command/FolderSync.php
index 8c7196d..0a7bb47 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync FolderSync command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_FolderSync extends Syncope_Command_Wbxml 
+class Syncroton_Command_FolderSync extends Syncroton_Command_Wbxml 
 {
     const STATUS_SUCCESS                = 1;
     const STATUS_FOLDER_EXISTS          = 2;
@@ -56,10 +56,10 @@ class Syncope_Command_FolderSync extends Syncope_Command_Wbxml
     protected $_documentElement     = 'FolderSync';
     
     protected $_classes             = array(
-        Syncope_Data_Factory::CLASS_CALENDAR,
-        Syncope_Data_Factory::CLASS_CONTACTS,
-        Syncope_Data_Factory::CLASS_EMAIL,
-        Syncope_Data_Factory::CLASS_TASKS
+        Syncroton_Data_Factory::CLASS_CALENDAR,
+        Syncroton_Data_Factory::CLASS_CONTACTS,
+        Syncroton_Data_Factory::CLASS_EMAIL,
+        Syncroton_Data_Factory::CLASS_TASKS
     );
 
     /**
@@ -80,7 +80,7 @@ class Syncope_Command_FolderSync extends Syncope_Command_Wbxml
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " synckey is $syncKey");
         
         if ($syncKey == 0) {
-            $this->_syncState = new Syncope_Model_SyncState(array(
+            $this->_syncState = new Syncroton_Model_SyncState(array(
                 'device_id' => $this->_device,
                 'counter'   => 0,
                 'type'      => 'FolderSync',
@@ -90,7 +90,7 @@ class Syncope_Command_FolderSync extends Syncope_Command_Wbxml
             // reset state of foldersync
             $this->_syncStateBackend->resetState($this->_device, 'FolderSync');
         } else {
-            if (($this->_syncState = $this->_syncStateBackend->validate($this->_device, 'FolderSync', $syncKey)) instanceof Syncope_Model_SyncState) {
+            if (($this->_syncState = $this->_syncStateBackend->validate($this->_device, 'FolderSync', $syncKey)) instanceof Syncroton_Model_SyncState) {
                 $this->_syncState->lastsync = $this->_syncTimeStamp;
             } else  {
                 $this->_syncStateBackend->resetState($this->_device, 'FolderSync');
@@ -120,7 +120,7 @@ class Syncope_Command_FolderSync extends Syncope_Command_Wbxml
             
             foreach($this->_classes as $class) {
                 try {
-                    $dataController = Syncope_Data_Factory::factory($class, $this->_device, $this->_syncTimeStamp);
+                    $dataController = Syncroton_Data_Factory::factory($class, $this->_device, $this->_syncTimeStamp);
                 } catch (Zend_Exception $ze) {
                     // backend not defined
                     if ($this->_logger instanceof Zend_Log)
@@ -148,7 +148,7 @@ class Syncope_Command_FolderSync extends Syncope_Command_Wbxml
                     if (isset($clientFolders[$serverFolderId])) {
                         $adds[] = $clientFolders[$serverFolderId];
                     } else {
-                        $adds[] = new Syncope_Model_Folder(array(
+                        $adds[] = new Syncroton_Model_Folder(array(
                             'device_id'         => $this->_device,
                             'class'             => $class,
                             'folderid'          => $serverFolders[$serverFolderId]['folderId'],
similarity index 94%
rename from lib/Syncope/Command/GetAttachment.php
rename to lib/Syncroton/Command/GetAttachment.php
index 78d45b2..7713498 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2010-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class documentation
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
  
-class Syncope_Command_GetAttachment
+class Syncroton_Command_GetAttachment
 {
     /**
      *
similarity index 94%
rename from lib/Syncope/Command/GetItemEstimate.php
rename to lib/Syncroton/Command/GetItemEstimate.php
index ae0a1cc..89d558f 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync GetItemEstimate command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_GetItemEstimate extends Syncope_Command_Wbxml 
+class Syncroton_Command_GetItemEstimate extends Syncroton_Command_Wbxml 
 {
     const STATUS_SUCCESS                = 1;
     const STATUS_INVALID_COLLECTION     = 2;
@@ -59,7 +59,7 @@ class Syncope_Command_GetItemEstimate extends Syncope_Command_Wbxml
                 $collectionData['folder']->lastfiltertype = $collectionData['filterType'];
                 
                 if($collectionData['syncKey'] === 0) {
-                    $collectionData['syncState'] = new Syncope_Model_SyncState(array(
+                    $collectionData['syncState'] = new Syncroton_Model_SyncState(array(
                         'device_id' => $this->_device,
                         'counter'   => 0,
                         'type'      => $collectionData['folder'],
@@ -73,7 +73,7 @@ class Syncope_Command_GetItemEstimate extends Syncope_Command_Wbxml
                 } else {
                     $collectionData['syncState'] = $this->_syncStateBackend->validate($this->_device, $collectionData['folder'], $collectionData['syncKey']);
                 }
-            } catch (Syncope_Exception_NotFound $senf) {
+            } catch (Syncroton_Exception_NotFound $senf) {
                 if ($this->_logger instanceof Zend_Log)
                     $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $senf->getMessage());
             }
@@ -84,7 +84,7 @@ class Syncope_Command_GetItemEstimate extends Syncope_Command_Wbxml
     
     /**
      * (non-PHPdoc)
-     * @see Syncope_Command_Wbxml::getResponse()
+     * @see Syncroton_Command_Wbxml::getResponse()
      */
     public function getResponse()
     {
@@ -104,7 +104,7 @@ class Syncope_Command_GetItemEstimate extends Syncope_Command_Wbxml
                 $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'CollectionId', $collectionData['collectionId']));
                 $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Estimate', 0));
                 
-            } elseif (! ($collectionData['syncState'] instanceof Syncope_Model_ISyncState)) {
+            } elseif (! ($collectionData['syncState'] instanceof Syncroton_Model_ISyncState)) {
                 if ($this->_logger instanceof Zend_Log)
                     $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " invalid synckey ${collectionData['syncKey']} provided");
                 /*
@@ -125,7 +125,7 @@ class Syncope_Command_GetItemEstimate extends Syncope_Command_Wbxml
                 $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'CollectionId', $collectionData['collectionId']));  
                 $collection->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Estimate', 1));                                              
             } else {
-                $dataController = Syncope_Data_Factory::factory($collectionData['folder']->class, $this->_device, $this->_syncTimeStamp);
+                $dataController = Syncroton_Data_Factory::factory($collectionData['folder']->class, $this->_device, $this->_syncTimeStamp);
                 
                 $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Status', self::STATUS_SUCCESS));
                 $collection = $response->appendChild($this->_outputDom->createElementNS('uri:ItemEstimate', 'Collection'));
similarity index 82%
rename from lib/Syncope/Command/Interface.php
rename to lib/Syncroton/Command/Interface.php
index cb8b519..af1d2a0 100644 (file)
  * @subpackage  ActiveSync
  */
  
-interface Syncope_Command_Interface 
+interface Syncroton_Command_Interface 
 {
     /**
      * the constructor
      *
      * @param  mixed                    $_requestBody
      */
-    public function __construct($_requestBody, Syncope_Model_IDevice $_device, $_policyKey);
+    public function __construct($_requestBody, Syncroton_Model_IDevice $_device, $_policyKey);
     
     /**
      * process the XML file and add, change, delete or fetches data 
similarity index 87%
rename from lib/Syncope/Command/ItemOperations.php
rename to lib/Syncroton/Command/ItemOperations.php
index cf1de52..851b18c 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync ItemOperations command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_ItemOperations extends Syncope_Command_Wbxml 
+class Syncroton_Command_ItemOperations extends Syncroton_Command_Wbxml 
 {        
     const STATUS_SUCCESS        = 1;
     const STATUS_PROTOCOL_ERROR = 2;
@@ -95,7 +95,7 @@ class Syncope_Command_ItemOperations extends Syncope_Command_Wbxml
         
         $itemOperations = $this->_outputDom->documentElement;
         
-        $itemOperations->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncope_Command_ItemOperations::STATUS_SUCCESS));
+        $itemOperations->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_SUCCESS));
         
         $response = $itemOperations->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Response'));
         
@@ -103,13 +103,13 @@ class Syncope_Command_ItemOperations extends Syncope_Command_Wbxml
             $fetchTag = $response->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Fetch'));
             
             try {
-                $dataController = Syncope_Data_Factory::factory($fetch['store'], $this->_device, $this->_syncTimeStamp);
+                $dataController = Syncroton_Data_Factory::factory($fetch['store'], $this->_device, $this->_syncTimeStamp);
                 
                 if (isset($fetch['collectionId'])) {
                     $properties = $this->_outputDom->createElementNS('uri:ItemOperations', 'Properties');
                     $dataController->appendXML($properties, $fetch, $fetch['serverId']);
                     
-                    $fetchTag->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncope_Command_ItemOperations::STATUS_SUCCESS));
+                    $fetchTag->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_SUCCESS));
                     $fetchTag->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'CollectionId', $fetch['collectionId']));
                     $fetchTag->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'ServerId',     $fetch['serverId']));
                     $fetchTag->appendChild($properties);
@@ -118,14 +118,14 @@ class Syncope_Command_ItemOperations extends Syncope_Command_Wbxml
                     $properties = $this->_outputDom->createElementNS('uri:ItemOperations', 'Properties');
                     $dataController->appendFileReference($properties, $fetch['fileReference']);
                     
-                    $fetchTag->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncope_Command_ItemOperations::STATUS_SUCCESS));
+                    $fetchTag->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_SUCCESS));
                     $fetchTag->appendChild($this->_outputDom->createElementNS('uri:AirSyncBase', 'FileReference', $fetch['fileReference']));
                     $fetchTag->appendChild($properties);
                 }
             } catch (Tinebase_Exception_NotFound $e) {
-                $response->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncope_Command_ItemOperations::STATUS_ITEM_FAILED_CONVERSION));
+                $response->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_ITEM_FAILED_CONVERSION));
             } catch (Exception $e) {
-                $response->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncope_Command_ItemOperations::STATUS_SERVER_ERROR));
+                $response->appendChild($this->_outputDom->createElementNS('uri:ItemOperations', 'Status', Syncroton_Command_ItemOperations::STATUS_SERVER_ERROR));
             }
         }
         
similarity index 81%
rename from lib/Syncope/Command/MoveItems.php
rename to lib/Syncroton/Command/MoveItems.php
index b497454..f6d31af 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync MoveItem command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_MoveItems extends Syncope_Command_Wbxml 
+class Syncroton_Command_MoveItems extends Syncroton_Command_Wbxml 
 {        
     const STATUS_INVALID_SOURCE         = 1;
     const STATUS_INVALID_DESTINATION    = 2;
@@ -64,26 +64,26 @@ class Syncope_Command_MoveItems extends Syncope_Command_Wbxml
             
             try {
                 $sourceFolder      = $this->_folderBackend->getFolder($this->_device, $move['srcFldId']);
-            } catch (Syncope_Exception_NotFound $senf) {
+            } catch (Syncroton_Exception_NotFound $senf) {
                 $sourceFolder = null;
             }
             
             try {
                 $destinationFolder = $this->_folderBackend->getFolder($this->_device, $move['dstFldId']);
-            } catch (Syncope_Exception_NotFound $senf) {
+            } catch (Syncroton_Exception_NotFound $senf) {
                 $destinationFolder = null;
             }
                 
             if ($sourceFolder === null) {
-                $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'Status', Syncope_Command_MoveItems::STATUS_INVALID_SOURCE));
+                $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'Status', Syncroton_Command_MoveItems::STATUS_INVALID_SOURCE));
             } else if ($destinationFolder === null) {
-                $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'Status', Syncope_Command_MoveItems::STATUS_INVALID_DESTINATION));
+                $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'Status', Syncroton_Command_MoveItems::STATUS_INVALID_DESTINATION));
             } else {
-                $dataController    = Syncope_Data_Factory::factory($sourceFolder->class, $this->_device, $this->_syncTimeStamp);
+                $dataController    = Syncroton_Data_Factory::factory($sourceFolder->class, $this->_device, $this->_syncTimeStamp);
                 
                 $newId             = $dataController->moveItem($move['srcFldId'], $move['srcMsgId'], $move['dstFldId']);
                 
-                $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'Status', Syncope_Command_MoveItems::STATUS_SUCCESS));
+                $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'Status', Syncroton_Command_MoveItems::STATUS_SUCCESS));
                 $response->appendChild($this->_outputDom->createElementNS('uri:Move', 'DstMsgId', $newId));
             }
         }
similarity index 93%
rename from lib/Syncope/Command/Options.php
rename to lib/Syncroton/Command/Options.php
index 01599bc..3b16522 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync http options request
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_Options
+class Syncroton_Command_Options
 {
     /**
      * this function generates the response for the client
similarity index 93%
rename from lib/Syncope/Command/Ping.php
rename to lib/Syncroton/Command/Ping.php
index 1321e53..4626891 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync Ping command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_Ping extends Syncope_Command_Wbxml 
+class Syncroton_Command_Ping extends Syncroton_Command_Wbxml 
 {
     const STATUS_NO_CHANGES_FOUND           = 1;
     const STATUS_CHANGES_FOUND              = 2;
@@ -35,7 +35,7 @@ class Syncope_Command_Ping extends Syncope_Command_Wbxml
     /**
      * Enter description here...
      *
-     * @var Syncope_Backend_StandAlone_Abstract
+     * @var Syncroton_Backend_StandAlone_Abstract
      */
     protected $_dataBackend;
 
@@ -73,7 +73,7 @@ class Syncope_Command_Ping extends Syncope_Command_Wbxml
                         $folder = $this->_folderBackend->getFolder($this->_device, (string)$folderXml->Id);
                         
                         $folders[] = $folder;                
-                    } catch (Syncope_Exception_NotFound $senf) {
+                    } catch (Syncroton_Exception_NotFound $senf) {
                         if ($this->_logger instanceof Zend_Log) 
                             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $senf->getMessage());
                         $status = self::STATUS_FOLDER_NOT_FOUND;
@@ -101,14 +101,14 @@ class Syncope_Command_Ping extends Syncope_Command_Wbxml
             
             do {
                 foreach((array) $folders as $folder) {
-                    $dataController = Syncope_Data_Factory::factory($folder->class, $this->_device, $this->_syncTimeStamp);
+                    $dataController = Syncroton_Data_Factory::factory($folder->class, $this->_device, $this->_syncTimeStamp);
                     
                     try {
                         $syncState = $this->_syncStateBackend->getSyncState($this->_device, $folder);
 
                         $foundChanges = !!$dataController->getCountOfChanges($this->_contentStateBackend, $folder, $syncState);
                         
-                    } catch (Syncope_Exception_NotFound $e) {
+                    } catch (Syncroton_Exception_NotFound $e) {
                         // folder got never synchronized to client
                         if ($this->_logger instanceof Zend_Log) 
                             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage());
similarity index 98%
rename from lib/Syncope/Command/Provision.php
rename to lib/Syncroton/Command/Provision.php
index 9734684..4cc3a60 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync FolderSync command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_Provision extends Syncope_Command_Wbxml
+class Syncroton_Command_Provision extends Syncroton_Command_Wbxml
 {
     protected $_defaultNameSpace = 'uri:Provision';
     protected $_documentElement  = 'Provision';
similarity index 93%
rename from lib/Syncope/Command/Search.php
rename to lib/Syncroton/Command/Search.php
index 03e62b6..221c078 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync Search command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_Search extends Syncope_Command_Wbxml 
+class Syncroton_Command_Search extends Syncroton_Command_Wbxml 
 {        
     const STATUS_SUCCESS      = 1;
     const STATUS_SERVER_ERROR = 3;
similarity index 97%
rename from lib/Syncope/Command/SendMail.php
rename to lib/Syncroton/Command/SendMail.php
index 6507c07..7b69f12 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync Sendmail command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_SendMail
+class Syncroton_Command_SendMail
 {
     /**
      * the incoming mail
similarity index 96%
rename from lib/Syncope/Command/Settings.php
rename to lib/Syncroton/Command/Settings.php
index efb2885..a6ead75 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync Settings command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_Settings extends Syncope_Command_Wbxml 
+class Syncroton_Command_Settings extends Syncroton_Command_Wbxml 
 {
     const STATUS_SUCCESS                = 1;
     const STATUS_PROTOCOL_ERROR         = 2;
similarity index 93%
rename from lib/Syncope/Command/SmartForward.php
rename to lib/Syncroton/Command/SmartForward.php
index f007f35..19c3302 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync SmartForward command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_SmartForward extends Syncope_Command_SendMail
+class Syncroton_Command_SmartForward extends Syncroton_Command_SendMail
 {
     /**
      * save copy in sent folder
similarity index 92%
rename from lib/Syncope/Command/SmartReply.php
rename to lib/Syncroton/Command/SmartReply.php
index 85545f0..136e33c 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync SmartReply command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_SmartReply extends Syncope_Command_SendMail
+class Syncroton_Command_SmartReply extends Syncroton_Command_SendMail
 {
     /**
      * save copy in sent folder
similarity index 95%
rename from lib/Syncope/Command/Sync.php
rename to lib/Syncroton/Command/Sync.php
index 0708b9d..13d3cb5 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * class to handle ActiveSync Sync command
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
-class Syncope_Command_Sync extends Syncope_Command_Wbxml 
+class Syncroton_Command_Sync extends Syncroton_Command_Wbxml 
 {
     const STATUS_SUCCESS                                = 1;
     const STATUS_PROTOCOL_VERSION_MISMATCH              = 2;
@@ -97,7 +97,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
     protected $_moreAvailable = false;
     
     /**
-     * @var Syncope_Model_SyncState
+     * @var Syncroton_Model_SyncState
      */
     protected $_syncState;
     
@@ -125,7 +125,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                 'toBeFetched'     => array(),
                 'filterType'      => 0,
                 'mimeSupport'     => self::MIMESUPPORT_DONT_SEND_MIME,
-                'mimeTruncation'  => Syncope_Command_Sync::TRUNCATE_NOTHING,
+                'mimeTruncation'  => Syncroton_Command_Sync::TRUNCATE_NOTHING,
                 'bodyPreferences' => array(),
             );
             
@@ -168,14 +168,14 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
             try {
                 $collectionData['folder'] = $this->_folderBackend->getFolder($this->_device, $collectionData['collectionId']);
                 
-            } catch (Syncope_Exception_NotFound $senf) {
+            } catch (Syncroton_Exception_NotFound $senf) {
                 if ($this->_logger instanceof Zend_Log) 
                     $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " folder {$collectionData['collectionId']} not found");
                 
                 // trigger INVALID_SYNCKEY instead of OBJECT_NOTFOUND when synckey is bigger than 0
                 // to avoid a syncloop for the iPhone
                 if ($collectionData['syncKey'] > 0) {
-                    $collectionData['folder']    = new Syncope_Model_Folder(array(
+                    $collectionData['folder']    = new Syncroton_Model_Folder(array(
                         'device_id' => $this->_device,
                         'folderid'  => $collectionData['collectionId']
                     ));
@@ -197,7 +197,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                 $this->_syncStateBackend->resetState($this->_device, $collectionData['folder']);
                 $this->_contentStateBackend->resetState($this->_device, $collectionData['folder']);
             
-                $collectionData['syncState']    = new Syncope_Model_SyncState(array(
+                $collectionData['syncState']    = new Syncroton_Model_SyncState(array(
                     'device_id' => $this->_device,
                     'counter'   => 0,
                     'type'      => $collectionData['folder'],
@@ -223,7 +223,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                 continue;
             }
             
-            $dataController = Syncope_Data_Factory::factory($collectionData['folder']->class, $this->_device, $this->_syncTimeStamp);
+            $dataController = Syncroton_Data_Factory::factory($collectionData['folder']->class, $this->_device, $this->_syncTimeStamp);
             
             // handle incoming data
             if(isset($xmlCollection->Commands->Add)) {
@@ -245,7 +245,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                             'clientId'     => (string)$add->ClientId,
                             'serverId'     => $serverId,
                             'status'       => self::STATUS_SUCCESS,
-                            'contentState' => $this->_contentStateBackend->create(new Syncope_Model_Content(array(
+                            'contentState' => $this->_contentStateBackend->create(new Syncroton_Model_Content(array(
                                 'device_id'        => $this->_device,
                                 'folder_id'        => $collectionData['folder'],
                                 'contentid'        => $serverId,
@@ -278,10 +278,10 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                     try {
                         $dataController->updateEntry($collectionData['collectionId'], $serverId, $change->ApplicationData);
                         $collectionData['changed'][$serverId] = self::STATUS_SUCCESS;
-                    } catch (Syncope_Exception_AccessDenied $e) {
+                    } catch (Syncroton_Exception_AccessDenied $e) {
                         $collectionData['changed'][$serverId] = self::STATUS_CONFLICT_MATCHING_THE_CLIENT_AND_SERVER_OBJECT;
                         $collectionData['forceChange'][$serverId] = $serverId;
-                    } catch (Syncope_Exception_NotFound $e) {
+                    } catch (Syncroton_Exception_NotFound $e) {
                         // entry does not exist anymore, will get deleted automaticaly
                         $collectionData['changed'][$serverId] = self::STATUS_OBJECT_NOT_FOUND;
                     } catch (Exception $e) {
@@ -308,17 +308,17 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                         
                         try {
                             $dataController->deleteEntry($collectionData['collectionId'], $serverId, $collectionData);
-                        } catch(Syncope_Exception_NotFound $e) {
+                        } catch(Syncroton_Exception_NotFound $e) {
                             if ($this->_logger instanceof Zend_Log) 
                                 $this->_logger->crit(__METHOD__ . '::' . __LINE__ . ' tried to delete entry ' . $serverId . ' but entry was not found');
-                        } catch (Syncope_Exception $e) {
+                        } catch (Syncroton_Exception $e) {
                             if ($this->_logger instanceof Zend_Log) 
                                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . ' tried to delete entry ' . $serverId . ' but a error occured: ' . $e->getMessage());
                             $collectionData['forceAdd'][$serverId] = $serverId;
                         }
                         $this->_contentStateBackend->delete($state);
                         
-                    } catch (Syncope_Exception_NotFound $senf) {
+                    } catch (Syncroton_Exception_NotFound $senf) {
                         if ($this->_logger instanceof Zend_Log) 
                             $this->_logger->info(__METHOD__ . '::' . __LINE__ . ' ' . $serverId . ' should have been removed from client already');
                         // should we send a special status???
@@ -354,7 +354,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
     
     /**
      * (non-PHPdoc)
-     * @see Syncope_Command_Wbxml::getResponse()
+     * @see Syncroton_Command_Wbxml::getResponse()
      */
     public function getResponse()
     {
@@ -366,14 +366,14 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
 
         foreach($this->_collections as $collectionData) {
             // invalid collectionid provided
-            if (! ($collectionData['folder'] instanceof Syncope_Model_IFolder)) {
+            if (! ($collectionData['folder'] instanceof Syncroton_Model_IFolder)) {
                 $collection = $collections->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Collection'));
                 $collection->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'SyncKey', 0));
                 $collection->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'CollectionId', $collectionData['collectionId']));
                 $collection->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Status', self::STATUS_FOLDER_HIERARCHY_HAS_CHANGED));
 
             // invalid synckey provided
-            } elseif (! ($collectionData['syncState'] instanceof Syncope_Model_ISyncState)) {
+            } elseif (! ($collectionData['syncState'] instanceof Syncroton_Model_ISyncState)) {
                 // set synckey to 0
                 $collection = $collections->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Collection'));
                 $collection->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'SyncKey', 0));
@@ -396,7 +396,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                 
             } else {
 
-                $dataController = Syncope_Data_Factory::factory($collectionData['folder']->class , $this->_device, $this->_syncTimeStamp);
+                $dataController = Syncroton_Data_Factory::factory($collectionData['folder']->class , $this->_device, $this->_syncTimeStamp);
                 
                 $serverAdds    = array();
                 $serverChanges = array();
@@ -494,7 +494,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                 // send reponse for changed entries
                 if(!empty($collectionData['changed'])) {
                     foreach($collectionData['changed'] as $serverId => $status) {
-                        if ($status !== Syncope_Command_Sync::STATUS_SUCCESS) {
+                        if ($status !== Syncroton_Command_Sync::STATUS_SUCCESS) {
                             $change = $responses->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Change'));
                             $change->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'ServerId', $serverId));
                             $change->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Status', $status));
@@ -561,7 +561,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                     #    unset($serverAdds[$id]);
                     #    continue;
                     #    
-                    #} catch (Syncope_Exception_NotFound $senf) {
+                    #} catch (Syncroton_Exception_NotFound $senf) {
                     #    // do nothing => content state should not exist yet
                     #}
                     
@@ -581,7 +581,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                     }
                     
                     // mark as send to the client, even the conversion to xml might have failed 
-                    $newContentStates[] = new Syncope_Model_Content(array(
+                    $newContentStates[] = new Syncroton_Model_Content(array(
                         'device_id'        => $this->_device,
                         'folder_id'        => $collectionData['folder'],
                         'contentid'        => $serverId,
@@ -655,7 +655,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                     $this->_logger->info(__METHOD__ . '::' . __LINE__ . " new synckey is ". $collectionData['syncState']->counter);                
             }
             
-            if (isset($collectionData['syncState']) && $collectionData['syncState'] instanceof Syncope_Model_ISyncState && 
+            if (isset($collectionData['syncState']) && $collectionData['syncState'] instanceof Syncroton_Model_ISyncState && 
                 $collectionData['syncState']->counter != $collectionData['syncKey']) {
                         
                 // increment sync timestamp by 1 second
@@ -684,7 +684,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                 $collectionData['syncState']->lastsync = $this->_syncTimeStamp;
                 
                 try {
-                    $transactionId = Syncope_Registry::getTransactionManager()->startTransaction(Syncope_Registry::getDatabase());
+                    $transactionId = Syncroton_Registry::getTransactionManager()->startTransaction(Syncroton_Registry::getDatabase());
                     
                     // store new synckey
                     $this->_syncStateBackend->create($collectionData['syncState'], $keepPreviousSyncKey);
@@ -703,7 +703,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                         }
                     }
                     
-                    Syncope_Registry::getTransactionManager()->commitTransaction($transactionId);
+                    Syncroton_Registry::getTransactionManager()->commitTransaction($transactionId);
                 } catch (Zend_Db_Statement_Exception $zdse) {
                     // something went wrong
                     // maybe another parallel request added a new synckey
@@ -715,7 +715,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                         }
                     }
                     
-                    Syncope_Registry::getTransactionManager()->rollBack();
+                    Syncroton_Registry::getTransactionManager()->rollBack();
                     
                     throw $zdse;
                 }
@@ -726,7 +726,7 @@ class Syncope_Command_Sync extends Syncope_Command_Wbxml
                     $folderState = $this->_folderBackend->getFolder($this->_device, $collectionData['collectionId']);
                     $folderState->lastfiltertype = $collectionData['filterType'];
                     $this->_folderBackend->update($folderState);
-                } catch (Syncope_Exception_NotFound $senf) {
+                } catch (Syncroton_Exception_NotFound $senf) {
                     // failed to get folderstate => should not happen but is also no problem in this state
                     if ($this->_logger instanceof Zend_Log) 
                         $this->_logger->crit(__METHOD__ . '::' . __LINE__ . ' failed to get content state for: ' . $collectionData['collectionId']);
similarity index 75%
rename from lib/Syncope/Command/Wbxml.php
rename to lib/Syncroton/Command/Wbxml.php
index dcda501..a89cb37 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Tine 2.0
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * abstract class for all commands using wbxml encoded content
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Command
  */
  
-abstract class Syncope_Command_Wbxml implements Syncope_Command_Interface
+abstract class Syncroton_Command_Wbxml implements Syncroton_Command_Interface
 {
     /**
      * informations about the currently device
      *
-     * @var Syncope_Model_Device
+     * @var Syncroton_Model_Device
      */
     protected $_device;
     
     /**
      * informations about the currently device
      *
-     * @var Syncope_Backend_IDevice
+     * @var Syncroton_Backend_IDevice
      */
     protected $_deviceBackend;
     
     /**
      * informations about the currently device
      *
-     * @var Syncope_Backend_IFolder
+     * @var Syncroton_Backend_IFolder
      */
     protected $_folderBackend;
     
     /**
-     * @var Syncope_Backend_ISyncState
+     * @var Syncroton_Backend_ISyncState
      */
     protected $_syncStateBackend;
     
     /**
-     * @var Syncope_Backend_IContent
+     * @var Syncroton_Backend_IContent
      */
     protected $_contentStateBackend;
     
@@ -118,33 +118,33 @@ abstract class Syncope_Command_Wbxml implements Syncope_Command_Interface
      * the constructor
      *
      * @param  mixed                    $_requestBody
-     * @param  Syncope_Model_Device  $_device
+     * @param  Syncroton_Model_Device  $_device
      * @param  string                   $_policyKey
      */
-    public function __construct($_requestBody, Syncope_Model_IDevice $_device, $_policyKey)
+    public function __construct($_requestBody, Syncroton_Model_IDevice $_device, $_policyKey)
     {
         $this->_policyKey = $_policyKey;
         $this->_device    = $_device;
         
-        $this->_deviceBackend       = Syncope_Registry::get('deviceBackend');
-        $this->_folderBackend       = Syncope_Registry::get('folderStateBackend');
-        $this->_syncStateBackend    = Syncope_Registry::get('syncStateBackend');
-        $this->_contentStateBackend = Syncope_Registry::get('contentStateBackend');
-        if (Syncope_Registry::isRegistered('loggerBackend')) {
-            $this->_logger          = Syncope_Registry::get('loggerBackend');
+        $this->_deviceBackend       = Syncroton_Registry::get('deviceBackend');
+        $this->_folderBackend       = Syncroton_Registry::get('folderStateBackend');
+        $this->_syncStateBackend    = Syncroton_Registry::get('syncStateBackend');
+        $this->_contentStateBackend = Syncroton_Registry::get('contentStateBackend');
+        if (Syncroton_Registry::isRegistered('loggerBackend')) {
+            $this->_logger          = Syncroton_Registry::get('loggerBackend');
         }
         
         if ($this->_skipValidatePolicyKey !== true && $this->_policyKey === null) {
-            #throw new Syncope_Exception_PolicyKeyMissing();
+            #throw new Syncroton_Exception_PolicyKeyMissing();
         }
         
         if ($this->_skipValidatePolicyKey !== true && ($this->_policyKey === 0 || $this->_device->policykey != $this->_policyKey)) {
-            #throw new Syncope_Exception_ProvisioningNeeded();
+            #throw new Syncroton_Exception_ProvisioningNeeded();
         }
         
         // should we wipe the mobile phone?
-        if ($this->_skipValidatePolicyKey !== true && !empty($this->_policyKey) && $this->_device->remotewipe >= Syncope_Command_Provision::REMOTEWIPE_REQUESTED) {
-            throw new Syncope_Exception_ProvisioningNeeded();
+        if ($this->_skipValidatePolicyKey !== true && !empty($this->_policyKey) && $this->_device->remotewipe >= Syncroton_Command_Provision::REMOTEWIPE_REQUESTED) {
+            throw new Syncroton_Exception_ProvisioningNeeded();
         }
         
         $this->_inputDom = $_requestBody;
similarity index 60%
rename from lib/Syncope/Data/AData.php
rename to lib/Syncroton/Data/AData.php
index a457a4b..cf2c037 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -14,7 +14,7 @@
  * @package     Model
  */
 
-abstract class Syncope_Data_AData implements Syncope_Data_IData
+abstract class Syncroton_Data_AData implements Syncroton_Data_IData
 {
     /**
      * used by unit tests only to simulated added folders
@@ -31,7 +31,7 @@ abstract class Syncope_Data_AData implements Syncope_Data_IData
     */
     public static $changedEntries = array();
     
-    public function __construct(Syncope_Model_IDevice $_device, DateTime $_timeStamp)
+    public function __construct(Syncroton_Model_IDevice $_device, DateTime $_timeStamp)
     {
         $this->_device = $_device;
         $this->_timestamp = $_timeStamp;
@@ -43,58 +43,58 @@ abstract class Syncope_Data_AData implements Syncope_Data_IData
     {
         $id = sha1(mt_rand(). microtime());
     
-        Syncope_Data_AData::$folders[get_class($this)][$id] = array(
+        Syncroton_Data_AData::$folders[get_class($this)][$id] = array(
             'folderId'    => $id,
             'parentId'    => $_parentId,
             'displayName' => $_displayName,
             'type'        => $_type
         );
     
-        return Syncope_Data_AData::$folders[get_class($this)][$id];
+        return Syncroton_Data_AData::$folders[get_class($this)][$id];
     }
     
     public function deleteEntry($_folderId, $_serverId, $_collectionData)
     {
-        $folderId = $_folderId instanceof Syncope_Model_IFolder ? $_folderId->folderid : $_folderId;
+        $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->folderid : $_folderId;
         
-        unset(Syncope_Data_AData::$entries[get_class($this)][$folderId][$_serverId]);
+        unset(Syncroton_Data_AData::$entries[get_class($this)][$folderId][$_serverId]);
     }
     
     public function deleteFolder($_folderId)
     {
-        $folderId = $_folderId instanceof Syncope_Model_IFolder ? $_folderId->folderid : $_folderId;
+        $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->folderid : $_folderId;
     
-        unset(Syncope_Data_AData::$folders[get_class($this)][$folderId]);
-        unset(Syncope_Data_AData::$entries[get_class($this)][$folderId]);
+        unset(Syncroton_Data_AData::$folders[get_class($this)][$folderId]);
+        unset(Syncroton_Data_AData::$entries[get_class($this)][$folderId]);
     }
     
     public function getAllFolders()
     {
-        return Syncope_Data_AData::$folders[get_class($this)];
+        return Syncroton_Data_AData::$folders[get_class($this)];
     }
     
     public function getChangedEntries($_folderId, DateTime $_startTimeStamp, DateTime $_endTimeStamp = NULL)
     {
-        if (!isset(Syncope_Data_AData::$changedEntries[get_class($this)])) {
+        if (!isset(Syncroton_Data_AData::$changedEntries[get_class($this)])) {
             return array();
         } else {
-            return Syncope_Data_AData::$changedEntries[get_class($this)];
+            return Syncroton_Data_AData::$changedEntries[get_class($this)];
         }
     }
     
     /**
-     * @param  Syncope_Model_IFolder|string  $_folderId
+     * @param  Syncroton_Model_IFolder|string  $_folderId
      * @param  string                        $_filter
      * @return array
      */
     public function getServerEntries($_folderId, $_filter)
     {
-        $folderId = $_folderId instanceof Syncope_Model_IFolder ? $_folderId->id : $_folderId;
+        $folderId = $_folderId instanceof Syncroton_Model_IFolder ? $_folderId->id : $_folderId;
     
-        return array_keys(Syncope_Data_AData::$entries[get_class($this)][$folderId]);
+        return array_keys(Syncroton_Data_AData::$entries[get_class($this)][$folderId]);
     }
     
-    public function getCountOfChanges(Syncope_Backend_IContent $contentBackend, Syncope_Model_IFolder $folder, Syncope_Model_ISyncState $syncState)
+    public function getCountOfChanges(Syncroton_Backend_IContent $contentBackend, Syncroton_Model_IFolder $folder, Syncroton_Model_ISyncState $syncState)
     {
         $allClientEntries = $contentBackend->getFolderState($this->_device, $folder);
         $allServerEntries = $this->getServerEntries($folder->folderid, $folder->lastfiltertype);
@@ -108,8 +108,8 @@ abstract class Syncope_Data_AData implements Syncope_Data_IData
     
     public function moveItem($_srcFolderId, $_serverId, $_dstFolderId)
     {
-        Syncope_Data_AData::$entries[get_class($this)][$_dstFolderId][$_serverId] = Syncope_Data_AData::$entries[get_class($this)][$_srcFolderId][$_serverId];
-        unset(Syncope_Data_AData::$entries[get_class($this)][$_srcFolderId][$_serverId]);
+        Syncroton_Data_AData::$entries[get_class($this)][$_dstFolderId][$_serverId] = Syncroton_Data_AData::$entries[get_class($this)][$_srcFolderId][$_serverId];
+        unset(Syncroton_Data_AData::$entries[get_class($this)][$_srcFolderId][$_serverId]);
         
         return $_serverId;
     }
similarity index 84%
rename from lib/Syncope/Data/Calendar.php
rename to lib/Syncroton/Data/Calendar.php
index 77e5937..8e24742 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -15,7 +15,7 @@
  * @package     Model
  */
 
-class Syncope_Data_Calendar extends Syncope_Data_AData
+class Syncroton_Data_Calendar extends Syncroton_Data_AData
 {
     public function appendXML(DOMElement $_domParrent, $_collectionData, $_serverId)
     {
@@ -43,19 +43,19 @@ class Syncope_Data_Calendar extends Syncope_Data_AData
         /**
         * used by unit tests only to simulated added folders
         */
-        Syncope_Data_AData::$folders[get_class($this)] = array(
+        Syncroton_Data_AData::$folders[get_class($this)] = array(
                'calendarFolderId' => array(
                     'folderId'    => 'calendarFolderId',
                     'parentId'    => null,
                     'displayName' => 'Default Contacts Folder',
-                    'type'        => Syncope_Command_FolderSync::FOLDERTYPE_CALENDAR
+                    'type'        => Syncroton_Command_FolderSync::FOLDERTYPE_CALENDAR
                 )
         );
         
         /**
          * used by unit tests only to simulated added folders
          */
-        Syncope_Data_AData::$entries[get_class($this)] = array(
+        Syncroton_Data_AData::$entries[get_class($this)] = array(
                        'calendarFolderId' => array(
                    )
         );
similarity index 82%
rename from lib/Syncope/Data/Contacts.php
rename to lib/Syncroton/Data/Contacts.php
index 8517df9..fbfca30 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @package     Model
  */
 
-class Syncope_Data_Contacts extends Syncope_Data_AData
+class Syncroton_Data_Contacts extends Syncroton_Data_AData
 {
     public function appendXML(DOMElement $_domParrent, $_collectionData, $_serverId)
     {
         $_domParrent->ownerDocument->documentElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:Contacts', 'uri:Contacts');
         
-        foreach (Syncope_Data_AData::$entries[get_class($this)][$_collectionData["collectionId"]][$_serverId] as $key => $value) {
+        foreach (Syncroton_Data_AData::$entries[get_class($this)][$_collectionData["collectionId"]][$_serverId] as $key => $value) {
             // don't add empty values
             if($value === null || $value == '') {
                 continue;
@@ -41,7 +41,7 @@ class Syncope_Data_Contacts extends Syncope_Data_AData
         
         $id = sha1(mt_rand(). microtime());
         
-        Syncope_Data_AData::$entries[get_class($this)][$_folderId][$id] = array(
+        Syncroton_Data_AData::$entries[get_class($this)][$_folderId][$id] = array(
             'FirstName' => (string)$xmlData->FirstName, 
             'LastName'  => (string)$xmlData->LastName
         );
@@ -53,7 +53,7 @@ class Syncope_Data_Contacts extends Syncope_Data_AData
     {
         $xmlData = $_entry->children('uri:Contacts');
         
-        Syncope_Data_AData::$entries[get_class($this)][$_folderId][$_serverId] = array(
+        Syncroton_Data_AData::$entries[get_class($this)][$_folderId][$_serverId] = array(
             'FirstName' => (string)$xmlData->FirstName, 
             'LastName'  => (string)$xmlData->LastName
         );
@@ -64,19 +64,19 @@ class Syncope_Data_Contacts extends Syncope_Data_AData
         /**
         * used by unit tests only to simulated added folders
         */
-        if (!isset(Syncope_Data_AData::$folders[get_class($this)])) {
-            Syncope_Data_AData::$folders[get_class($this)] = array(
+        if (!isset(Syncroton_Data_AData::$folders[get_class($this)])) {
+            Syncroton_Data_AData::$folders[get_class($this)] = array(
                 'addressbookFolderId' => array(
                     'folderId'    => 'addressbookFolderId',
                     'parentId'    => null,
                     'displayName' => 'Default Contacts Folder',
-                    'type'        => Syncope_Command_FolderSync::FOLDERTYPE_CONTACT
+                    'type'        => Syncroton_Command_FolderSync::FOLDERTYPE_CONTACT
                 ),
                 'anotherAddressbookFolderId' => array(
                     'folderId'    => 'anotherAddressbookFolderId',
                     'parentId'    => null,
                     'displayName' => 'Another Contacts Folder',
-                    'type'        => Syncope_Command_FolderSync::FOLDERTYPE_CONTACT_USER_CREATED
+                    'type'        => Syncroton_Command_FolderSync::FOLDERTYPE_CONTACT_USER_CREATED
                 )
             );
         }
@@ -84,8 +84,8 @@ class Syncope_Data_Contacts extends Syncope_Data_AData
         /**
          * used by unit tests only to simulated added folders
          */
-        if (!isset(Syncope_Data_AData::$entries[get_class($this)])) {
-            Syncope_Data_AData::$entries[get_class($this)] = array(
+        if (!isset(Syncroton_Data_AData::$entries[get_class($this)])) {
+            Syncroton_Data_AData::$entries[get_class($this)] = array(
                 'addressbookFolderId' => array(
                     'contact1' => array(
                         'FirstName' => 'Lars', 
similarity index 88%
rename from lib/Syncope/Data/Email.php
rename to lib/Syncroton/Data/Email.php
index 9c9cd2f..1706af9 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -15,7 +15,7 @@
  * @package     Model
  */
 
-class Syncope_Data_Email extends Syncope_Data_AData
+class Syncroton_Data_Email extends Syncroton_Data_AData
 {
     /**
      * used by unit tests only to simulated added folders
@@ -68,25 +68,25 @@ class Syncope_Data_Email extends Syncope_Data_AData
         /**
         * used by unit tests only to simulated added folders
         */
-        Syncope_Data_AData::$folders[get_class($this)] = array(
+        Syncroton_Data_AData::$folders[get_class($this)] = array(
                 'emailInboxFolderId' => array(
                     'folderId'    => 'emailInboxFolderId',
                     'parentId'    => null,
                     'displayName' => 'Inbox',
-                    'type'        => Syncope_Command_FolderSync::FOLDERTYPE_INBOX
+                    'type'        => Syncroton_Command_FolderSync::FOLDERTYPE_INBOX
                 ),
                 'emailSentFolderId' => array(
                     'folderId'    => 'emailSentFolderId',
                     'parentId'    => null,
                     'displayName' => 'Sent',
-                    'type'        => Syncope_Command_FolderSync::FOLDERTYPE_SENTMAIL
+                    'type'        => Syncroton_Command_FolderSync::FOLDERTYPE_SENTMAIL
                 )
         );
         
         /**
          * used by unit tests only to simulated added folders
          */
-        Syncope_Data_AData::$entries[get_class($this)] = array(
+        Syncroton_Data_AData::$entries[get_class($this)] = array(
                        'emailInboxFolderId' => array(
                     'email1' => array(
                        'FirstName' => 'Lars', 
similarity index 67%
rename from lib/Syncope/Data/Factory.php
rename to lib/Syncroton/Data/Factory.php
index ce00e2d..d7297b3 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -15,7 +15,7 @@
  * @package     Model
  */
 
-class Syncope_Data_Factory
+class Syncroton_Data_Factory
 {
     const CLASS_CALENDAR = 'Calendar';
     const CLASS_CONTACTS = 'Contacts';
@@ -27,29 +27,29 @@ class Syncope_Data_Factory
     
     /**
      * @param unknown_type $_class
-     * @param Syncope_Model_IDevice $_device
+     * @param Syncroton_Model_IDevice $_device
      * @param DateTime $_timeStamp
      * @throws InvalidArgumentException
-     * @return Syncope_Data_IData
+     * @return Syncroton_Data_IData
      */
-    public static function factory($_classFactory, Syncope_Model_IDevice $_device, DateTime $_timeStamp)
+    public static function factory($_classFactory, Syncroton_Model_IDevice $_device, DateTime $_timeStamp)
     {
         switch($_classFactory) {
             case self::CLASS_CALENDAR:
-                $className = Syncope_Registry::get(Syncope_Registry::CALENDAR_DATA_CLASS);
+                $className = Syncroton_Registry::get(Syncroton_Registry::CALENDAR_DATA_CLASS);
                 break;
                 
             case self::CLASS_CONTACTS:
-                $className = Syncope_Registry::get(Syncope_Registry::CONTACTS_DATA_CLASS);
+                $className = Syncroton_Registry::get(Syncroton_Registry::CONTACTS_DATA_CLASS);
                 break;
                 
             case self::STORE_EMAIL:
             case self::CLASS_EMAIL:
-                $className = Syncope_Registry::get(Syncope_Registry::EMAIL_DATA_CLASS);
+                $className = Syncroton_Registry::get(Syncroton_Registry::EMAIL_DATA_CLASS);
                 break;
                 
             case self::CLASS_TASKS:
-                $className = Syncope_Registry::get(Syncope_Registry::TASKS_DATA_CLASS);
+                $className = Syncroton_Registry::get(Syncroton_Registry::TASKS_DATA_CLASS);
                 break;
                 
             default:
@@ -59,8 +59,8 @@ class Syncope_Data_Factory
         
         $class = new $className($_device, $_timeStamp);
         
-        if (! $class instanceof Syncope_Data_IData) {
-            throw new RuntimeException('class must be instanceof Syncope_Data_IData');
+        if (! $class instanceof Syncroton_Data_IData) {
+            throw new RuntimeException('class must be instanceof Syncroton_Data_IData');
         }
                     
         return $class;
similarity index 82%
rename from lib/Syncope/Data/IData.php
rename to lib/Syncroton/Data/IData.php
index 40605bc..babe514 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -15,7 +15,7 @@
  * @package     Model
  */
 
-interface Syncope_Data_IData
+interface Syncroton_Data_IData
 {
     public function appendXML(DOMElement $_domParrent, $_collectionData, $_serverId);
     
@@ -27,7 +27,7 @@ interface Syncope_Data_IData
     
     public function getChangedEntries($_folderId, DateTime $_startTimeStamp, DateTime $_endTimeStamp = NULL);
     
-    public function getCountOfChanges(Syncope_Backend_IContent $contentBackend, Syncope_Model_IFolder $folder, Syncope_Model_ISyncState $syncState);
+    public function getCountOfChanges(Syncroton_Backend_IContent $contentBackend, Syncroton_Model_IFolder $folder, Syncroton_Model_ISyncState $syncState);
     
     public function moveItem($_srcFolderId, $_serverId, $_dstFolderId);
     
similarity index 86%
rename from lib/Syncope/Data/Tasks.php
rename to lib/Syncroton/Data/Tasks.php
index b8e0369..bf9fa43 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -15,7 +15,7 @@
  * @package     Model
  */
 
-class Syncope_Data_Tasks extends Syncope_Data_AData
+class Syncroton_Data_Tasks extends Syncroton_Data_AData
 {
     public function appendXML(DOMElement $_domParrent, $_collectionData, $_serverId)
     {
@@ -41,19 +41,19 @@ class Syncope_Data_Tasks extends Syncope_Data_AData
         /**
         * used by unit tests only to simulated added folders
         */
-        Syncope_Data_AData::$folders[get_class($this)] = array(
+        Syncroton_Data_AData::$folders[get_class($this)] = array(
                'tasksFolderId' => array(
                 'folderId'    => 'tasksFolderId',
                 'parentId'    => null,
                 'displayName' => 'Default Tasks Folder',
-                'type'        => Syncope_Command_FolderSync::FOLDERTYPE_TASK
+                'type'        => Syncroton_Command_FolderSync::FOLDERTYPE_TASK
             )
         );
         
         /**
          * used by unit tests only to simulated added folders
          */
-        Syncope_Data_AData::$entries[get_class($this)] = array(
+        Syncroton_Data_AData::$entries[get_class($this)] = array(
                'tasksFolderId' => array(
                 'contact1' => array(
                        'FirstName' => 'Lars', 
similarity index 76%
rename from lib/Syncope/Exception/NotFound.php
rename to lib/Syncroton/Exception/NotFound.php
index a3c5ad4..0d8893b 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Tine 2.0
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Exception
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2012-2012 Metaways Infosystems GmbH (http://www.metaways.de)
@@ -12,9 +12,9 @@
 /**
  * class documentation
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Exception
  */
-class Syncope_Exception_NotFound extends Exception
+class Syncroton_Exception_NotFound extends Exception
 {
 }
similarity index 72%
rename from lib/Syncope/Exception/UnexpectedValue.php
rename to lib/Syncroton/Exception/UnexpectedValue.php
index af8b685..357900f 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Tine 2.0
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Exception
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2012-2012 Metaways Infosystems GmbH (http://www.metaways.de)
@@ -12,9 +12,9 @@
 /**
  * class documentation
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Exception
  */
-class Syncope_Exception_UnexpectedValue extends UnexpectedValueException
+class Syncroton_Exception_UnexpectedValue extends UnexpectedValueException
 {
 }
similarity index 81%
rename from lib/Syncope/Model/Content.php
rename to lib/Syncroton/Model/Content.php
index 5557c84..27075f2 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 /**
  * model for content sent to device
  *
- * @package     Syncope
+ * @package     Syncroton
  * @subpackage  Model
  */
-class Syncope_Model_Content implements Syncope_Model_IContent
+class Syncroton_Model_Content implements Syncroton_Model_IContent
 {
     public function __construct(array $_data = array())
     {
similarity index 90%
rename from lib/Syncope/Model/Device.php
rename to lib/Syncroton/Model/Device.php
index a217425..0712329 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -15,7 +15,7 @@
  * @package     Model
  */
 
-class Syncope_Model_Device implements Syncope_Model_IDevice
+class Syncroton_Model_Device implements Syncroton_Model_IDevice
 {
     const TYPE_IPHONE  = 'iphone';
     const TYPE_WEBOS   = 'webos';
@@ -41,7 +41,7 @@ class Syncope_Model_Device implements Syncope_Model_IDevice
     public function getMajorVersion()
     {
         switch ($this->devicetype) {
-            case Syncope_Model_Device::TYPE_IPHONE:
+            case Syncroton_Model_Device::TYPE_IPHONE:
                 if (preg_match('/(.+)\/(\d+)\.(\d+)/', $this->useragent, $matches)) {
                     list(, $name, $majorVersion, $minorVersion) = $matches;
                     return $majorVersion;
similarity index 88%
rename from lib/Syncope/Model/Folder.php
rename to lib/Syncroton/Model/Folder.php
index db8ba1f..7aaf91a 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -15,7 +15,7 @@
  * @package     Model
  */
 
-class Syncope_Model_Folder implements Syncope_Model_IFolder
+class Syncroton_Model_Folder implements Syncroton_Model_IFolder
 {
     public function __construct(array $_data = array())
     {
similarity index 92%
rename from lib/Syncope/Model/IContent.php
rename to lib/Syncroton/Model/IContent.php
index a8233f4..0ec4e2a 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -22,7 +22,7 @@
  * @property    string    is_deleted
  */
 
-interface Syncope_Model_IContent
+interface Syncroton_Model_IContent
 {
     
 }
similarity index 94%
rename from lib/Syncope/Model/IDevice.php
rename to lib/Syncroton/Model/IDevice.php
index 907290c..c084f8c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -26,7 +26,7 @@
  * @property    string   useragent
  */
 
-interface Syncope_Model_IDevice
+interface Syncroton_Model_IDevice
 {
     /**
      * Returns major firmware version of this device
similarity index 92%
rename from lib/Syncope/Model/IFolder.php
rename to lib/Syncroton/Model/IFolder.php
index 2e56693..ca1e8e3 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -23,7 +23,7 @@
  * @property    string   lastfiltertype
  */
 
-interface Syncope_Model_IFolder
+interface Syncroton_Model_IFolder
 {
     
 }
similarity index 91%
rename from lib/Syncope/Model/ISyncState.php
rename to lib/Syncroton/Model/ISyncState.php
index aa78cb0..f4b623b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -20,7 +20,7 @@
  * @property    string    pendingdata
  */
 
-interface Syncope_Model_ISyncState
+interface Syncroton_Model_ISyncState
 {
     
 }
similarity index 87%
rename from lib/Syncope/Model/SyncState.php
rename to lib/Syncroton/Model/SyncState.php
index 641fd1c..b44b4c5 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Syncope
+ * Syncroton
  *
  * @package     Model
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
@@ -15,7 +15,7 @@
  * @package     Model
  */
 
-class Syncope_Model_SyncState implements Syncope_Model_ISyncState
+class Syncroton_Model_SyncState implements Syncroton_Model_ISyncState
 {
     public function __construct(array $_data = array())
     {
similarity index 91%
rename from lib/Syncope/Registry.php
rename to lib/Syncroton/Registry.php
index 463b73e..a1f7a36 100644 (file)
@@ -12,8 +12,8 @@
  * obtain it through the world-wide-web, please send an email
  * to license@zend.com so we can send you a copy immediately.
  *
- * @category   Syncope
- * @package    Syncope_Registry
+ * @category   Syncroton
+ * @package    Syncroton_Registry
  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id: Registry.php 10020 2009-08-18 14:34:09Z j.fischer@metaways.de $
 /**
  * Generic storage class helps to manage global data.
  *
- * @category   Syncope
- * @package    Syncope_Registry
+ * @category   Syncroton
+ * @package    Syncroton_Registry
  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
-class Syncope_Registry extends ArrayObject
+class Syncroton_Registry extends ArrayObject
 {
     const CALENDAR_DATA_CLASS = 'calendar_data_class';
     const CONTACTS_DATA_CLASS = 'contacts_data_class';
@@ -41,18 +41,18 @@ class Syncope_Registry extends ArrayObject
      * Class name of the singleton registry object.
      * @var string
      */
-    private static $_registryClassName = 'Syncope_Registry';
+    private static $_registryClassName = 'Syncroton_Registry';
 
     /**
      * Registry object provides storage for shared objects.
-     * @var Syncope_Registry
+     * @var Syncroton_Registry
      */
     private static $_registry = null;
 
     /**
      * Retrieves the default registry instance.
      *
-     * @return Syncope_Registry
+     * @return Syncroton_Registry
      */
     public static function getInstance()
     {
@@ -74,7 +74,7 @@ class Syncope_Registry extends ArrayObject
     /**
      * return transaction manager class 
      * 
-     * @return Syncope_TransactionManagerInterface
+     * @return Syncroton_TransactionManagerInterface
      */
     public static function getTransactionManager()
     {
@@ -84,12 +84,12 @@ class Syncope_Registry extends ArrayObject
     /**
      * Set the default registry instance to a specified instance.
      *
-     * @param Syncope_Registry $registry An object instance of type Syncope_Registry,
+     * @param Syncroton_Registry $registry An object instance of type Syncroton_Registry,
      *   or a subclass.
      * @return void
      * @throws Zend_Exception if registry is already initialized.
      */
-    public static function setInstance(Syncope_Registry $registry)
+    public static function setInstance(Syncroton_Registry $registry)
     {
         if (self::$_registry !== null) {
             require_once 'Zend/Exception.php';
@@ -120,7 +120,7 @@ class Syncope_Registry extends ArrayObject
      * @throws Zend_Exception if the registry is initialized or if the
      *   class name is not valid.
      */
-    public static function setClassName($registryClassName = 'Syncope_Registry')
+    public static function setClassName($registryClassName = 'Syncroton_Registry')
     {
         if (self::$_registry !== null) {
             require_once 'Zend/Exception.php';
@@ -156,7 +156,7 @@ class Syncope_Registry extends ArrayObject
     /**
      * getter method, basically same as offsetGet().
      *
-     * This method can be called from an object of type Syncope_Registry, or it
+     * This method can be called from an object of type Syncroton_Registry, or it
      * can be called statically.  In the latter case, it uses the default
      * static instance stored in the class.
      *
@@ -179,7 +179,7 @@ class Syncope_Registry extends ArrayObject
     /**
      * setter method, basically same as offsetSet().
      *
-     * This method can be called from an object of type Syncope_Registry, or it
+     * This method can be called from an object of type Syncroton_Registry, or it
      * can be called statically.  In the latter case, it uses the default
      * static instance stored in the class.
      *
similarity index 88%
rename from lib/Syncope/Server.php
rename to lib/Syncroton/Server.php
index e68d289..7e37e01 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Syncope
+ * Syncroton
  *
- * @package     Syncope
+ * @package     Syncroton
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
  * @author      Lars Kneschke <l.kneschke@metaways.de>
 /**
  * class to handle incoming http ActiveSync requests
  * 
- * @package     Syncope
+ * @package     Syncroton
  */
-class Syncope_Server
+class Syncroton_Server
 {
     protected $_body;
     
     /**
      * informations about the currently device
      *
-     * @var Syncope_Backend_IDevice
+     * @var Syncroton_Backend_IDevice
      */
     protected $_deviceBackend;
     
@@ -38,15 +38,15 @@ class Syncope_Server
     
     public function __construct($userId, Zend_Controller_Request_Http $request = null, $body = null)
     {
-        if (Syncope_Registry::isRegistered('loggerBackend')) {
-            $this->_logger = Syncope_Registry::get('loggerBackend');
+        if (Syncroton_Registry::isRegistered('loggerBackend')) {
+            $this->_logger = Syncroton_Registry::get('loggerBackend');
         }
         
         $this->_userId  = $userId;
         $this->_request = $request !== null ? $request : new Zend_Controller_Request_Http();
         $this->_body    = $body    !== null ? $body    : fopen('php://input', 'r');
         
-        $this->_deviceBackend = Syncope_Registry::get('deviceBackend');
+        $this->_deviceBackend = Syncroton_Registry::get('deviceBackend');
         
     }
         
@@ -76,7 +76,7 @@ class Syncope_Server
     */
     protected function _handleOptions()
     {
-        $command = new Syncope_Command_Options();
+        $command = new Syncroton_Command_Options();
     
         $command->getResponse();
     }
@@ -99,10 +99,10 @@ class Syncope_Server
         if ($this->_logger instanceof Zend_Log) 
             $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " Agent: $userAgent  PolicyKey: $policyKey ASVersion: {$requestParameters['protocolVersion']} Command: {$requestParameters['command']}");
         
-        $className = 'Syncope_Command_' . $requestParameters['command'];
+        $className = 'Syncroton_Command_' . $requestParameters['command'];
         
         if(!class_exists($className)) {
-            throw new Syncope_Exception_CommandNotFound('unsupported command ' . $requestParameters['command']);
+            throw new Syncroton_Exception_CommandNotFound('unsupported command ' . $requestParameters['command']);
         }
         
         // get user device
@@ -139,13 +139,13 @@ class Syncope_Server
         
             $response = $command->getResponse();
             
-        } catch (Syncope_Exception_PolicyKeyMissing $sepkm) {
+        } catch (Syncroton_Exception_PolicyKeyMissing $sepkm) {
             if ($this->_logger instanceof Zend_Log) 
                 $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " X-MS-POLICYKEY missing (" . $_command. ')');
             header("HTTP/1.1 400 header X-MS-POLICYKEY not found");
             return;
             
-        } catch (Syncope_Exception_ProvisioningNeeded $sepn) {
+        } catch (Syncroton_Exception_ProvisioningNeeded $sepn) {
             if ($this->_logger instanceof Zend_Log) 
                 $this->_logger->info(__METHOD__ . '::' . __LINE__ . " provisioning needed");
             header("HTTP/1.1 449 Retry after sending a PROVISION command");
@@ -204,7 +204,7 @@ class Syncope_Server
      * @param unknown_type $deviceType
      * @param unknown_type $userAgent
      * @param unknown_type $protocolVersion
-     * @return Syncope_Model_Device
+     * @return Syncroton_Model_Device
      */
     protected function _getUserDevice($ownerId, $deviceId, $deviceType, $userAgent, $protocolVersion)
     {
@@ -215,8 +215,8 @@ class Syncope_Server
             $device->acsversion = $protocolVersion;
             $device = $this->_deviceBackend->update($device);
         
-        } catch (Syncope_Exception_NotFound $senf) {
-            $device = $this->_deviceBackend->create(new Syncope_Model_Device(array(
+        } catch (Syncroton_Exception_NotFound $senf) {
+            $device = $this->_deviceBackend->create(new Syncroton_Model_Device(array(
                 'owner_id'   => $ownerId,
                 'deviceid'   => $deviceId,
                 'devicetype' => $deviceType,
similarity index 89%
rename from lib/Syncope/TransactionManager.php
rename to lib/Syncroton/TransactionManager.php
index 323352b..fdf9814 100644 (file)
@@ -2,16 +2,16 @@
 /**
  * Tine 2.0
  * 
- * @package     Syncope
+ * @package     Syncroton
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
  * @author      Cornelius Weiss <c.weiss@metaways.de>
  */
 
 /**
- * Transaction Manger for Syncope
+ * Transaction Manger for Syncroton
  * 
- * This is the central class, all transactions within Syncope must be handled with.
+ * This is the central class, all transactions within Syncroton must be handled with.
  * For each supported transactionable (backend) this class start a real transaction on 
  * the first startTransaction request.
  * 
@@ -21,9 +21,9 @@
  * Transactions of all transactionable will be roll back when one rollBack is requested
  * using this class.
  * 
- * @package     Syncope
+ * @package     Syncroton
  */
-class Syncope_TransactionManager implements Syncope_TransactionManagerInterface
+class Syncroton_TransactionManager implements Syncroton_TransactionManagerInterface
 {
     /**
      * @var array holds all transactionables with open transactions
@@ -35,7 +35,7 @@ class Syncope_TransactionManager implements Syncope_TransactionManagerInterface
      */
     protected $_openTransactions = array();
     /**
-     * @var Syncope_TransactionManager
+     * @var Syncroton_TransactionManager
      */
     private static $_instance = NULL;
     
@@ -57,8 +57,8 @@ class Syncope_TransactionManager implements Syncope_TransactionManagerInterface
      */
     private function __construct()
     {
-        if (Syncope_Registry::isRegistered('loggerBackend')) {
-            $this->_logger = Syncope_Registry::get('loggerBackend');
+        if (Syncroton_Registry::isRegistered('loggerBackend')) {
+            $this->_logger = Syncroton_Registry::get('loggerBackend');
         }
     }
     
@@ -68,7 +68,7 @@ class Syncope_TransactionManager implements Syncope_TransactionManagerInterface
     public static function getInstance() 
     {
         if (self::$_instance === NULL) {
-            self::$_instance = new Syncope_TransactionManager;
+            self::$_instance = new Syncroton_TransactionManager;
         }
         
         return self::$_instance;
@@ -95,7 +95,7 @@ class Syncope_TransactionManager implements Syncope_TransactionManagerInterface
                 $_transactionable->beginTransaction();
             } else {
                 $this->rollBack();
-                throw new Syncope_Exception_UnexpectedValue('Unsupported transactionable!');
+                throw new Syncroton_Exception_UnexpectedValue('Unsupported transactionable!');
             }
             
             array_push($this->_openTransactionables, $_transactionable);
similarity index 85%
rename from lib/Syncope/TransactionManagerInterface.php
rename to lib/Syncroton/TransactionManagerInterface.php
index 0052c77..d04a719 100644 (file)
@@ -2,16 +2,16 @@
 /**
  * Tine 2.0
  * 
- * @package     Syncope
+ * @package     Syncroton
  * @license     http://www.tine20.org/licenses/lgpl.html LGPL Version 3
  * @copyright   Copyright (c) 2008-2012 Metaways Infosystems GmbH (http://www.metaways.de)
  * @author      Cornelius Weiss <c.weiss@metaways.de>
  */
 
 /**
- * Transaction Manger for Syncope
+ * Transaction Manger for Syncroton
  * 
- * This is the central class, all transactions within Syncope must be handled with.
+ * This is the central class, all transactions within Syncroton must be handled with.
  * For each supported transactionable (backend) this class start a real transaction on 
  * the first startTransaction request.
  * 
@@ -21,9 +21,9 @@
  * Transactions of all transactionable will be roll back when one rollBack is requested
  * using this class.
  * 
- * @package     Syncope
+ * @package     Syncroton
  */
-interface Syncope_TransactionManagerInterface
+interface Syncroton_TransactionManagerInterface
 {
     /**
      * @return Tinebase_TransactionManager
diff --git a/tests/Syncope/Command/ATestCase.php b/tests/Syncope/Command/ATestCase.php
deleted file mode 100644 (file)
index d7d39c5..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-/**
- * Tine 2.0 - http://www.tine20.org
- * 
- * @package     Tests
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @copyright   Copyright (c) 2010-2011 Metaways Infosystems GmbH (http://www.metaways.de)
- * @author      Cornelius Weiss <c.weiss@metaways.de>
- */
-
-/**
- * Test class for FolderSync_Controller_Event
- * 
- * @package     Tests
- */
-abstract class Syncope_Command_ATestCase extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @var Syncope_Model_IDevice
-     */
-    protected $_device;
-    
-    /**
-     * @var Syncope_Backend_IDevice
-     */
-    protected $_deviceBackend;
-
-    /**
-     * @var Syncope_Backend_IFolder
-     */
-    protected $_folderBackend;
-    
-    /**
-     * @var Syncope_Backend_ISyncState
-     */
-    protected $_syncStateBackend;
-    
-    /**
-     * @var Syncope_Backend_IContent
-     */
-    protected $_contentStateBackend;
-    
-    /**
-     * @var Zend_Db_Adapter_Abstract
-     */
-    protected $_db;
-    
-    protected $_logPriority = Zend_Log::ALERT;
-    
-    /**
-     * (non-PHPdoc)
-     * @see Syncope/Syncope_TestCase::setUp()
-     */
-    protected function setUp()
-    {
-        Syncope_Registry::setDatabase(getTestDatabase());
-        Syncope_Registry::setTransactionManager(Syncope_TransactionManager::getInstance());
-        
-        Syncope_Registry::getTransactionManager()->startTransaction(Syncope_Registry::getDatabase());
-        
-        #$writer = new Zend_Log_Writer_Null();
-        $writer = new Zend_Log_Writer_Stream('php://output');
-        $writer->addFilter(new Zend_Log_Filter_Priority($this->_logPriority));
-        
-        $logger = new Zend_Log($writer);
-        
-        $this->_deviceBackend       = new Syncope_Backend_Device(Syncope_Registry::getDatabase());
-        $this->_folderBackend       = new Syncope_Backend_Folder(Syncope_Registry::getDatabase());
-        $this->_syncStateBackend    = new Syncope_Backend_SyncState(Syncope_Registry::getDatabase());
-        $this->_contentStateBackend = new Syncope_Backend_Content(Syncope_Registry::getDatabase());
-        
-        $this->_device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice()
-        );
-        
-        Syncope_Registry::set('deviceBackend',       $this->_deviceBackend);
-        Syncope_Registry::set('folderStateBackend',  $this->_folderBackend);
-        Syncope_Registry::set('syncStateBackend',    $this->_syncStateBackend);
-        Syncope_Registry::set('contentStateBackend', $this->_contentStateBackend);
-        Syncope_Registry::set('loggerBackend',       $logger);
-        
-        Syncope_Registry::setContactsDataClass('Syncope_Data_Contacts');
-        Syncope_Registry::setCalendarDataClass('Syncope_Data_Calendar');
-        Syncope_Registry::setEmailDataClass('Syncope_Data_Email');
-        Syncope_Registry::setTasksDataClass('Syncope_Data_Tasks');
-    }
-
-    /**
-     * Tears down the fixture
-     * This method is called after a test is executed.
-     *
-     * @access protected
-     */
-    protected function tearDown()
-    {
-        Syncope_Registry::getTransactionManager()->rollBack();
-    }
-}
diff --git a/tests/Syncope/Command/AllTests.php b/tests/Syncope/Command/AllTests.php
deleted file mode 100755 (executable)
index 5ecdb3b..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * Tine 2.0 - http://www.tine20.org
- * 
- * @package     ActiveSync
- * @license     http://www.gnu.org/licenses/agpl.html
- * @copyright   Copyright (c) 2010-2011 Metaways Infosystems GmbH (http://www.metaways.de)
- * @author      Jonas Fischer <j.fischer@metaways.de>
- */
-
-class Syncope_Command_AllTests
-{
-    public static function main ()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-    
-    public static function suite ()
-    {
-        $suite = new PHPUnit_Framework_TestSuite('Syncope all ActiveSync command tests');
-        
-        $suite->addTestSuite('Syncope_Command_FolderCreateTests');
-        $suite->addTestSuite('Syncope_Command_FolderDeleteTests');
-        $suite->addTestSuite('Syncope_Command_FolderSyncTests');
-        $suite->addTestSuite('Syncope_Command_GetItemEstimateTests');
-        $suite->addTestSuite('Syncope_Command_ItemOperationsTests');
-        $suite->addTestSuite('Syncope_Command_MoveItemsTests');
-        $suite->addTestSuite('Syncope_Command_PingTests');
-        $suite->addTestSuite('Syncope_Command_ProvisionTests');
-        $suite->addTestSuite('Syncope_Command_SearchTests');
-        $suite->addTestSuite('Syncope_Command_SettingsTests');
-        $suite->addTestSuite('Syncope_Command_SyncTests');
-        
-        return $suite;
-    }
-}
similarity index 63%
rename from tests/Syncope/AllTests.php
rename to tests/Syncroton/AllTests.php
index c762851..c441d70 100755 (executable)
@@ -8,7 +8,7 @@
  * @author      Jonas Fischer <j.fischer@metaways.de>
  */
 
-class Syncope_AllTests
+class Syncroton_AllTests
 {
     public static function main ()
     {
@@ -17,11 +17,11 @@ class Syncope_AllTests
     
     public static function suite ()
     {
-        $suite = new PHPUnit_Framework_TestSuite('Syncope All Tests');
+        $suite = new PHPUnit_Framework_TestSuite('Syncroton All Tests');
         
-        $suite->addTestSuite('Syncope_Backend_AllTests');
-        $suite->addTestSuite('Syncope_Command_AllTests');
-        $suite->addTestSuite('Syncope_Data_AllTests');
+        $suite->addTestSuite('Syncroton_Backend_AllTests');
+        $suite->addTestSuite('Syncroton_Command_AllTests');
+        $suite->addTestSuite('Syncroton_Data_AllTests');
         
         return $suite;
     }
similarity index 60%
rename from tests/Syncope/Backend/AllTests.php
rename to tests/Syncroton/Backend/AllTests.php
index 3f6013a..7cfe4ad 100755 (executable)
@@ -8,7 +8,7 @@
  * @author      Jonas Fischer <j.fischer@metaways.de>
  */
 
-class Syncope_Backend_AllTests
+class Syncroton_Backend_AllTests
 {
     public static function main ()
     {
@@ -17,12 +17,12 @@ class Syncope_Backend_AllTests
     
     public static function suite ()
     {
-        $suite = new PHPUnit_Framework_TestSuite('Syncope All Backend Tests');
+        $suite = new PHPUnit_Framework_TestSuite('Syncroton All Backend Tests');
         
-        $suite->addTestSuite('Syncope_Backend_ContentTests');
-        $suite->addTestSuite('Syncope_Backend_DeviceTests');
-        $suite->addTestSuite('Syncope_Backend_FolderTests');
-        $suite->addTestSuite('Syncope_Backend_SyncStateTests');
+        $suite->addTestSuite('Syncroton_Backend_ContentTests');
+        $suite->addTestSuite('Syncroton_Backend_DeviceTests');
+        $suite->addTestSuite('Syncroton_Backend_FolderTests');
+        $suite->addTestSuite('Syncroton_Backend_SyncStateTests');
         
         return $suite;
     }
similarity index 72%
rename from tests/Syncope/Backend/ContentTests.php
rename to tests/Syncroton/Backend/ContentTests.php
index bc8fc74..92b036c 100644 (file)
@@ -9,39 +9,39 @@
  */
 
 /**
- * Test class for Syncope_Command_Sync
+ * Test class for Syncroton_Command_Sync
  * 
  * @package     Backend
  */
-class Syncope_Backend_ContentTests extends PHPUnit_Framework_TestCase
+class Syncroton_Backend_ContentTests extends PHPUnit_Framework_TestCase
 {
     /**
-     * @var Syncope_Model_Device
+     * @var Syncroton_Model_Device
      */
     protected $_device;
     
     /**
-     * @var Syncope_Model_Folder
+     * @var Syncroton_Model_Folder
      */
     protected $_folder;
     
     /**
-     * @var Syncope_Backend_Content
+     * @var Syncroton_Backend_Content
      */
     protected $_contentBackend;
     
     /**
-     * @var Syncope_Backend_Device
+     * @var Syncroton_Backend_Device
      */
     protected $_deviceBackend;
 
     /**
-     * @var Syncope_Backend_Folder
+     * @var Syncroton_Backend_Folder
      */
     protected $_folderBackend;
     
     /**
-     * @var Syncope_Backend_SyncState
+     * @var Syncroton_Backend_SyncState
      */
     protected $_syncStateBackend;
     
@@ -58,7 +58,7 @@ class Syncope_Backend_ContentTests extends PHPUnit_Framework_TestCase
      */
     public static function main()
     {
-        $suite  = new PHPUnit_Framework_TestSuite('Syncope Content backend tests');
+        $suite  = new PHPUnit_Framework_TestSuite('Syncroton Content backend tests');
         PHPUnit_TextUI_TestRunner::run($suite);
     }
     
@@ -72,16 +72,16 @@ class Syncope_Backend_ContentTests extends PHPUnit_Framework_TestCase
         
         $this->_db->beginTransaction();
 
-        $this->_contentBackend   = new Syncope_Backend_Content($this->_db);
-        $this->_deviceBackend    = new Syncope_Backend_Device($this->_db);
-        $this->_folderBackend    = new Syncope_Backend_Folder($this->_db);
-        $this->_syncStateBackend = new Syncope_Backend_SyncState($this->_db);
+        $this->_contentBackend   = new Syncroton_Backend_Content($this->_db);
+        $this->_deviceBackend    = new Syncroton_Backend_Device($this->_db);
+        $this->_folderBackend    = new Syncroton_Backend_Folder($this->_db);
+        $this->_syncStateBackend = new Syncroton_Backend_SyncState($this->_db);
 
         $this->_device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice()
+            Syncroton_Backend_DeviceTests::getTestDevice()
         );
         $this->_folder = $this->_folderBackend->create(
-            Syncope_Backend_FolderTests::getTestFolder($this->_device)
+            Syncroton_Backend_FolderTests::getTestFolder($this->_device)
         );
     }
 
@@ -97,7 +97,7 @@ class Syncope_Backend_ContentTests extends PHPUnit_Framework_TestCase
     }
     
     /**
-     * @return Syncope_Model_ISyncState
+     * @return Syncroton_Model_ISyncState
      */
     public function testCreate()
     {
@@ -121,7 +121,7 @@ class Syncope_Backend_ContentTests extends PHPUnit_Framework_TestCase
         
         $content = $this->_contentBackend->get($content->id);
         
-        $this->assertTrue($content instanceof Syncope_Model_IContent);
+        $this->assertTrue($content instanceof Syncroton_Model_IContent);
         $this->assertEquals(1, $content->is_deleted);
         $this->assertTrue($content->creation_time instanceof DateTime);
     }  
@@ -147,21 +147,21 @@ class Syncope_Backend_ContentTests extends PHPUnit_Framework_TestCase
     
     public function testGetExceptionNotFound()
     {
-        $this->setExpectedException('Syncope_Exception_NotFound');
+        $this->setExpectedException('Syncroton_Exception_NotFound');
     
         $this->_contentBackend->get('invalidId');
     }
     
     public function testGetContentStateExceptionNotFound()
     {
-        $this->setExpectedException('Syncope_Exception_NotFound');
+        $this->setExpectedException('Syncroton_Exception_NotFound');
     
         $this->_contentBackend->getContentState('invalidId', 'invalidId', 'invalidId');
     }
     
-    public static function getTestContent(Syncope_Model_IDevice $_device, Syncope_Model_IFolder $_folder)
+    public static function getTestContent(Syncroton_Model_IDevice $_device, Syncroton_Model_IFolder $_folder)
     {
-        return new Syncope_Model_Content(array(
+        return new Syncroton_Model_Content(array(
             'device_id'        => $_device,
             'folder_id'        => $_folder,
             'contentid'        => 'abc1234',
similarity index 74%
rename from tests/Syncope/Backend/DeviceTests.php
rename to tests/Syncroton/Backend/DeviceTests.php
index 2f135af..acfb7ee 100644 (file)
@@ -9,14 +9,14 @@
  */
 
 /**
- * Test class for Syncope_Command_Sync
+ * Test class for Syncroton_Command_Sync
  * 
  * @package     Backend
  */
-class Syncope_Backend_DeviceTests extends PHPUnit_Framework_TestCase
+class Syncroton_Backend_DeviceTests extends PHPUnit_Framework_TestCase
 {
     /**
-     * @var Syncope_Backend_Device
+     * @var Syncroton_Backend_Device
      */
     protected $_deviceBackend;
     
@@ -33,7 +33,7 @@ class Syncope_Backend_DeviceTests extends PHPUnit_Framework_TestCase
      */
     public static function main()
     {
-        $suite  = new PHPUnit_Framework_TestSuite('Syncope ActiveSync Sync command tests');
+        $suite  = new PHPUnit_Framework_TestSuite('Syncroton ActiveSync Sync command tests');
         PHPUnit_TextUI_TestRunner::run($suite);
     }
     
@@ -47,7 +47,7 @@ class Syncope_Backend_DeviceTests extends PHPUnit_Framework_TestCase
         
         $this->_db->beginTransaction();
         
-        $this->_deviceBackend = new Syncope_Backend_Device($this->_db);
+        $this->_deviceBackend = new Syncroton_Backend_Device($this->_db);
         
     }
 
@@ -67,7 +67,7 @@ class Syncope_Backend_DeviceTests extends PHPUnit_Framework_TestCase
      */
     public function testCreateDevice()
     {
-        $newDevice = Syncope_Backend_DeviceTests::getTestDevice();
+        $newDevice = Syncroton_Backend_DeviceTests::getTestDevice();
         
         $device = $this->_deviceBackend->create($newDevice);
         
@@ -87,7 +87,7 @@ class Syncope_Backend_DeviceTests extends PHPUnit_Framework_TestCase
     
     public function testGetExceptionNotFound()
     {
-        $this->setExpectedException('Syncope_Exception_NotFound');
+        $this->setExpectedException('Syncroton_Exception_NotFound');
     
         $this->_deviceBackend->get('invalidId');
     }
@@ -100,22 +100,22 @@ class Syncope_Backend_DeviceTests extends PHPUnit_Framework_TestCase
         
         $this->assertEquals($device->id, $userDevice->id);
         
-        $this->setExpectedException('Syncope_Exception_NotFound');
+        $this->setExpectedException('Syncroton_Exception_NotFound');
         
         $userDevice = $this->_deviceBackend->getUserDevice('1234', 'iphone-xyz');
     }
     
     /**
      * 
-     * @return Syncope_Model_Device
+     * @return Syncroton_Model_Device
      */
     public static function getTestDevice($_type = null)
     {
         switch($_type) {
-            case Syncope_Model_Device::TYPE_ANDROID:
-                $device = new Syncope_Model_Device(array(
+            case Syncroton_Model_Device::TYPE_ANDROID:
+                $device = new Syncroton_Model_Device(array(
                     'deviceid'   => 'android-abcd',
-                    'devicetype' => Syncope_Model_Device::TYPE_ANDROID,
+                    'devicetype' => Syncroton_Model_Device::TYPE_ANDROID,
                     'policykey'  => 1,
                     'policy_id'  => 1,
                     'owner_id'   => '1234',
@@ -125,10 +125,10 @@ class Syncope_Backend_DeviceTests extends PHPUnit_Framework_TestCase
                 )); 
                 break;
             
-            case Syncope_Model_Device::TYPE_WEBOS:
-                $device = new Syncope_Model_Device(array(
+            case Syncroton_Model_Device::TYPE_WEBOS:
+                $device = new Syncroton_Model_Device(array(
                     'deviceid'   => 'webos-abcd',
-                    'devicetype' => Syncope_Model_Device::TYPE_ANDROID,
+                    'devicetype' => Syncroton_Model_Device::TYPE_ANDROID,
                     'policykey'  => 1,
                     'policy_id'  => 1,
                     'owner_id'   => '1234',
@@ -138,11 +138,11 @@ class Syncope_Backend_DeviceTests extends PHPUnit_Framework_TestCase
                 )); 
                 break;
             
-            case Syncope_Model_Device::TYPE_IPHONE:
+            case Syncroton_Model_Device::TYPE_IPHONE:
             default:
-                $device = new Syncope_Model_Device(array(
+                $device = new Syncroton_Model_Device(array(
                     'deviceid'   => 'iphone-abcd',
-                    'devicetype' => Syncope_Model_Device::TYPE_IPHONE,
+                    'devicetype' => Syncroton_Model_Device::TYPE_IPHONE,
                     'policykey'  => 1,
                     'policy_id'  => 1,
                     'owner_id'   => '1234',
similarity index 74%
rename from tests/Syncope/Backend/FolderTests.php
rename to tests/Syncroton/Backend/FolderTests.php
index 593bb87..4e44b85 100644 (file)
@@ -9,24 +9,24 @@
  */
 
 /**
- * Test class for Syncope_Command_Sync
+ * Test class for Syncroton_Command_Sync
  * 
  * @package     Backend
  */
-class Syncope_Backend_FolderTests extends PHPUnit_Framework_TestCase
+class Syncroton_Backend_FolderTests extends PHPUnit_Framework_TestCase
 {
     /**
-     * @var Syncope_Model_Device
+     * @var Syncroton_Model_Device
      */
     protected $_device;
     
     /**
-     * @var Syncope_Backend_Device
+     * @var Syncroton_Backend_Device
      */
     protected $_deviceBackend;
 
     /**
-     * @var Syncope_Backend_Folder
+     * @var Syncroton_Backend_Folder
      */
     protected $_folderBackend;
     
@@ -43,7 +43,7 @@ class Syncope_Backend_FolderTests extends PHPUnit_Framework_TestCase
      */
     public static function main()
     {
-        $suite  = new PHPUnit_Framework_TestSuite('Syncope Folder backend tests');
+        $suite  = new PHPUnit_Framework_TestSuite('Syncroton Folder backend tests');
         PHPUnit_TextUI_TestRunner::run($suite);
     }
     
@@ -57,10 +57,10 @@ class Syncope_Backend_FolderTests extends PHPUnit_Framework_TestCase
         
         $this->_db->beginTransaction();
 
-        $this->_deviceBackend      = new Syncope_Backend_Device($this->_db);
-        $this->_folderBackend = new Syncope_Backend_Folder($this->_db);
+        $this->_deviceBackend      = new Syncroton_Backend_Device($this->_db);
+        $this->_folderBackend = new Syncroton_Backend_Folder($this->_db);
 
-        $newDevice = Syncope_Backend_DeviceTests::getTestDevice();
+        $newDevice = Syncroton_Backend_DeviceTests::getTestDevice();
         $this->_device    = $this->_deviceBackend->create($newDevice);
     }
 
@@ -76,11 +76,11 @@ class Syncope_Backend_FolderTests extends PHPUnit_Framework_TestCase
     }
     
     /**
-     * @return Syncope_Model_IFolder
+     * @return Syncroton_Model_IFolder
      */
-    public function testCreate(Syncope_Model_IFolder $_folder = null)
+    public function testCreate(Syncroton_Model_IFolder $_folder = null)
     {
-        $folder = $_folder instanceof Syncope_Model_IFolder ? $_folder : self::getTestFolder($this->_device);
+        $folder = $_folder instanceof Syncroton_Model_IFolder ? $_folder : self::getTestFolder($this->_device);
         
         $folder = $this->_folderBackend->create($folder);
                 
@@ -131,7 +131,7 @@ class Syncope_Backend_FolderTests extends PHPUnit_Framework_TestCase
         $folder->folderid = '1234567891';
         $folder2 = $this->testCreate($folder);
         
-        $folders = $this->_folderBackend->getFolderState($folder->device_id, Syncope_Data_Factory::CLASS_CONTACTS);
+        $folders = $this->_folderBackend->getFolderState($folder->device_id, Syncroton_Data_Factory::CLASS_CONTACTS);
         
         $this->assertEquals(2, count($folders));
         $this->assertArrayHasKey($folder1->folderid, $folders);
@@ -140,24 +140,24 @@ class Syncope_Backend_FolderTests extends PHPUnit_Framework_TestCase
     
     public function testGetExceptionNotFound()
     {
-        $this->setExpectedException('Syncope_Exception_NotFound');
+        $this->setExpectedException('Syncroton_Exception_NotFound');
     
         $this->_folderBackend->get('invalidId');
     }
     
     /**
      * 
-     * @return Syncope_Model_Device
+     * @return Syncroton_Model_Device
      */
-    public static function getTestFolder(Syncope_Model_IDevice $_device)
+    public static function getTestFolder(Syncroton_Model_IDevice $_device)
     {
-        return new Syncope_Model_Folder(array(
+        return new Syncroton_Model_Folder(array(
             'device_id'         => $_device,
-            'class'             => Syncope_Data_Factory::CLASS_CONTACTS,
+            'class'             => Syncroton_Data_Factory::CLASS_CONTACTS,
             'folderid'          => sha1(mt_rand(). microtime()),
             'parentid'          => null,
             'displayname'       => 'test contact folder',
-            'type'              => Syncope_Command_FolderSync::FOLDERTYPE_CONTACT,
+            'type'              => Syncroton_Command_FolderSync::FOLDERTYPE_CONTACT,
             'creation_time'     => new DateTime(null, new DateTimeZone('utc')),
             'lastfiltertype'    => null
         ));
similarity index 81%
rename from tests/Syncope/Backend/SyncStateTests.php
rename to tests/Syncroton/Backend/SyncStateTests.php
index 3b32544..0f9c46a 100644 (file)
@@ -9,34 +9,34 @@
  */
 
 /**
- * Test class for Syncope_Command_Sync
+ * Test class for Syncroton_Command_Sync
  * 
  * @package     Backend
  */
-class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
+class Syncroton_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
 {
     /**
-     * @var Syncope_Model_Device
+     * @var Syncroton_Model_Device
      */
     protected $_device;
     
     /**
-     * @var Syncope_Model_Folder
+     * @var Syncroton_Model_Folder
      */
     protected $_folder;
     
     /**
-     * @var Syncope_Backend_Device
+     * @var Syncroton_Backend_Device
      */
     protected $_deviceBackend;
 
     /**
-     * @var Syncope_Backend_Folder
+     * @var Syncroton_Backend_Folder
      */
     protected $_folderBackend;
     
     /**
-     * @var Syncope_Backend_SyncState
+     * @var Syncroton_Backend_SyncState
      */
     protected $_syncStateBackend;
     
@@ -53,7 +53,7 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
      */
     public static function main()
     {
-        $suite  = new PHPUnit_Framework_TestSuite('Syncope SyncState backend tests');
+        $suite  = new PHPUnit_Framework_TestSuite('Syncroton SyncState backend tests');
         PHPUnit_TextUI_TestRunner::run($suite);
     }
     
@@ -67,15 +67,15 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
         
         $this->_db->beginTransaction();
 
-        $this->_deviceBackend     = new Syncope_Backend_Device($this->_db);
-        $this->_folderBackend     = new Syncope_Backend_Folder($this->_db);
-        $this->_syncStateBackend  = new Syncope_Backend_SyncState($this->_db);
+        $this->_deviceBackend     = new Syncroton_Backend_Device($this->_db);
+        $this->_folderBackend     = new Syncroton_Backend_Folder($this->_db);
+        $this->_syncStateBackend  = new Syncroton_Backend_SyncState($this->_db);
 
         $this->_device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice()
+            Syncroton_Backend_DeviceTests::getTestDevice()
         );
         $this->_folder = $this->_folderBackend->create(
-            Syncope_Backend_FolderTests::getTestFolder($this->_device)
+            Syncroton_Backend_FolderTests::getTestFolder($this->_device)
         );
     }
 
@@ -91,11 +91,11 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
     }
     
     /**
-     * @return Syncope_Model_ISyncState
+     * @return Syncroton_Model_ISyncState
      */
     public function testCreate()
     {
-        $syncState = new Syncope_Model_SyncState(array(
+        $syncState = new Syncroton_Model_SyncState(array(
             'device_id'   => $this->_device,
             'type'        => 'FolderSync',
             'counter'     => '0',
@@ -112,7 +112,7 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
     }
     
     /**
-     * @return Syncope_Model_ISyncState
+     * @return Syncroton_Model_ISyncState
      */
     public function testUpdate()
     {
@@ -138,7 +138,7 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
         
         $validatedSyncState =  $this->_syncStateBackend->validate($this->_device, 'FolderSync', 1);
         
-        $this->assertTrue($validatedSyncState instanceof Syncope_Model_ISyncState);
+        $this->assertTrue($validatedSyncState instanceof Syncroton_Model_ISyncState);
         $this->assertEquals(1, $validatedSyncState->counter);
         $this->assertTrue($validatedSyncState->lastsync instanceof DateTime);
         
@@ -154,7 +154,7 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
      */
     public function testDeletePreviousSynckeyAfterValidate()
     {
-        $syncState = new Syncope_Model_SyncState(array(
+        $syncState = new Syncroton_Model_SyncState(array(
             'device_id'   => $this->_device,
             'type'        => 'FolderSync',
             'counter'     => '0',
@@ -164,7 +164,7 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
         $syncState->lastsync->modify('-2 min');
         $syncState = $this->_syncStateBackend->create($syncState);
         
-        $syncState = new Syncope_Model_SyncState(array(
+        $syncState = new Syncroton_Model_SyncState(array(
             'device_id'   => $this->_device,
             'type'        => 'FolderSync',
             'counter'     => '1',
@@ -191,7 +191,7 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
      */
     public function testDeleteLatestSynckeyAfterValidate()
     {
-        $syncState = new Syncope_Model_SyncState(array(
+        $syncState = new Syncroton_Model_SyncState(array(
             'device_id'   => $this->_device,
             'type'        => 'FolderSync',
             'counter'     => '0',
@@ -201,7 +201,7 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
         $syncState->lastsync->modify('-2 min');
         $syncState = $this->_syncStateBackend->create($syncState);
         
-        $syncState = new Syncope_Model_SyncState(array(
+        $syncState = new Syncroton_Model_SyncState(array(
             'device_id'   => $this->_device,
             'type'        => 'FolderSync',
             'counter'     => '1',
@@ -225,14 +225,14 @@ class Syncope_Backend_SyncStateTests extends PHPUnit_Framework_TestCase
     
     public function testGetExceptionNotFound()
     {
-        $this->setExpectedException('Syncope_Exception_NotFound');
+        $this->setExpectedException('Syncroton_Exception_NotFound');
         
         $this->_syncStateBackend->get('invalidId');
     }
     
     public function testGetSyncStateExceptionNotFound()
     {
-        $this->setExpectedException('Syncope_Exception_NotFound');
+        $this->setExpectedException('Syncroton_Exception_NotFound');
         
         $this->_syncStateBackend->getSyncState('invalidId', 'invalidId');
     }
diff --git a/tests/Syncroton/Command/ATestCase.php b/tests/Syncroton/Command/ATestCase.php
new file mode 100644 (file)
index 0000000..17c89e2
--- /dev/null
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     Tests
+ * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
+ * @copyright   Copyright (c) 2010-2011 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Cornelius Weiss <c.weiss@metaways.de>
+ */
+
+/**
+ * Test class for FolderSync_Controller_Event
+ * 
+ * @package     Tests
+ */
+abstract class Syncroton_Command_ATestCase extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Syncroton_Model_IDevice
+     */
+    protected $_device;
+    
+    /**
+     * @var Syncroton_Backend_IDevice
+     */
+    protected $_deviceBackend;
+
+    /**
+     * @var Syncroton_Backend_IFolder
+     */
+    protected $_folderBackend;
+    
+    /**
+     * @var Syncroton_Backend_ISyncState
+     */
+    protected $_syncStateBackend;
+    
+    /**
+     * @var Syncroton_Backend_IContent
+     */
+    protected $_contentStateBackend;
+    
+    /**
+     * @var Zend_Db_Adapter_Abstract
+     */
+    protected $_db;
+    
+    protected $_logPriority = Zend_Log::ALERT;
+    
+    /**
+     * (non-PHPdoc)
+     * @see Syncroton/Syncroton_TestCase::setUp()
+     */
+    protected function setUp()
+    {
+        Syncroton_Registry::setDatabase(getTestDatabase());
+        Syncroton_Registry::setTransactionManager(Syncroton_TransactionManager::getInstance());
+        
+        Syncroton_Registry::getTransactionManager()->startTransaction(Syncroton_Registry::getDatabase());
+        
+        #$writer = new Zend_Log_Writer_Null();
+        $writer = new Zend_Log_Writer_Stream('php://output');
+        $writer->addFilter(new Zend_Log_Filter_Priority($this->_logPriority));
+        
+        $logger = new Zend_Log($writer);
+        
+        $this->_deviceBackend       = new Syncroton_Backend_Device(Syncroton_Registry::getDatabase());
+        $this->_folderBackend       = new Syncroton_Backend_Folder(Syncroton_Registry::getDatabase());
+        $this->_syncStateBackend    = new Syncroton_Backend_SyncState(Syncroton_Registry::getDatabase());
+        $this->_contentStateBackend = new Syncroton_Backend_Content(Syncroton_Registry::getDatabase());
+        
+        $this->_device = $this->_deviceBackend->create(
+            Syncroton_Backend_DeviceTests::getTestDevice()
+        );
+        
+        Syncroton_Registry::set('deviceBackend',       $this->_deviceBackend);
+        Syncroton_Registry::set('folderStateBackend',  $this->_folderBackend);
+        Syncroton_Registry::set('syncStateBackend',    $this->_syncStateBackend);
+        Syncroton_Registry::set('contentStateBackend', $this->_contentStateBackend);
+        Syncroton_Registry::set('loggerBackend',       $logger);
+        
+        Syncroton_Registry::setContactsDataClass('Syncroton_Data_Contacts');
+        Syncroton_Registry::setCalendarDataClass('Syncroton_Data_Calendar');
+        Syncroton_Registry::setEmailDataClass('Syncroton_Data_Email');
+        Syncroton_Registry::setTasksDataClass('Syncroton_Data_Tasks');
+    }
+
+    /**
+     * Tears down the fixture
+     * This method is called after a test is executed.
+     *
+     * @access protected
+     */
+    protected function tearDown()
+    {
+        Syncroton_Registry::getTransactionManager()->rollBack();
+    }
+}
diff --git a/tests/Syncroton/Command/AllTests.php b/tests/Syncroton/Command/AllTests.php
new file mode 100755 (executable)
index 0000000..deb465c
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Tine 2.0 - http://www.tine20.org
+ * 
+ * @package     ActiveSync
+ * @license     http://www.gnu.org/licenses/agpl.html
+ * @copyright   Copyright (c) 2010-2011 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @author      Jonas Fischer <j.fischer@metaways.de>
+ */
+
+class Syncroton_Command_AllTests
+{
+    public static function main ()
+    {
+        PHPUnit_TextUI_TestRunner::run(self::suite());
+    }
+    
+    public static function suite ()
+    {
+        $suite = new PHPUnit_Framework_TestSuite('Syncroton all ActiveSync command tests');
+        
+        $suite->addTestSuite('Syncroton_Command_FolderCreateTests');
+        $suite->addTestSuite('Syncroton_Command_FolderDeleteTests');
+        $suite->addTestSuite('Syncroton_Command_FolderSyncTests');
+        $suite->addTestSuite('Syncroton_Command_GetItemEstimateTests');
+        $suite->addTestSuite('Syncroton_Command_ItemOperationsTests');
+        $suite->addTestSuite('Syncroton_Command_MoveItemsTests');
+        $suite->addTestSuite('Syncroton_Command_PingTests');
+        $suite->addTestSuite('Syncroton_Command_ProvisionTests');
+        $suite->addTestSuite('Syncroton_Command_SearchTests');
+        $suite->addTestSuite('Syncroton_Command_SettingsTests');
+        $suite->addTestSuite('Syncroton_Command_SyncTests');
+        
+        return $suite;
+    }
+}
similarity index 86%
rename from tests/Syncope/Command/FolderCreateTests.php
rename to tests/Syncroton/Command/FolderCreateTests.php
index b2ea78d..63cf526 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
+class Syncroton_Command_FolderCreateTests extends Syncroton_Command_ATestCase
 {
     /**
      * Runs the test methods of this class.
@@ -39,7 +39,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         
         $folderSync->handle();
         
@@ -52,7 +52,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderCreate xmlns="uri:FolderHierarchy"><SyncKey>1</SyncKey><ParentId/><DisplayName>Test Folder</DisplayName><Type>13</Type></FolderCreate>'
         );
         
-        $folderCreate = new Syncope_Command_FolderCreate($doc, $this->_device, null);
+        $folderCreate = new Syncroton_Command_FolderCreate($doc, $this->_device, null);
         
         $folderCreate->handle();
         
@@ -64,7 +64,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//FolderHierarchy:FolderCreate/FolderHierarchy:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//FolderHierarchy:FolderCreate/FolderHierarchy:SyncKey');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
@@ -73,7 +73,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
         $nodes = $xpath->query('//FolderHierarchy:FolderCreate/FolderHierarchy:ServerId');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
         $this->assertFalse(empty($nodes->item(0)->nodeValue), $responseDoc->saveXML());
-        $this->assertArrayHasKey($nodes->item(0)->nodeValue, Syncope_Data_AData::$folders['Syncope_Data_Calendar']);
+        $this->assertArrayHasKey($nodes->item(0)->nodeValue, Syncroton_Data_AData::$folders['Syncroton_Data_Calendar']);
     }
         
     /**
@@ -88,7 +88,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         
         $folderSync->handle();
         
@@ -101,7 +101,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderCreate xmlns="uri:FolderHierarchy"><SyncKey>1</SyncKey><ParentId/><DisplayName>Test Folder</DisplayName><Type>14</Type></FolderCreate>'
         );
         
-        $folderCreate = new Syncope_Command_FolderCreate($doc, $this->_device, null);
+        $folderCreate = new Syncroton_Command_FolderCreate($doc, $this->_device, null);
         
         $folderCreate->handle();
         
@@ -114,7 +114,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
         $nodes = $xpath->query('//FolderHierarchy:FolderCreate/FolderHierarchy:ServerId');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
         $this->assertFalse(empty($nodes->item(0)->nodeValue), $responseDoc->saveXML());
-        $this->assertArrayHasKey($nodes->item(0)->nodeValue, Syncope_Data_AData::$folders['Syncope_Data_Contacts']);
+        $this->assertArrayHasKey($nodes->item(0)->nodeValue, Syncroton_Data_AData::$folders['Syncroton_Data_Contacts']);
     }
         
     /**
@@ -129,7 +129,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         
         $folderSync->handle();
         
@@ -142,7 +142,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderCreate xmlns="uri:FolderHierarchy"><SyncKey>1</SyncKey><ParentId/><DisplayName>Test Folder</DisplayName><Type>12</Type></FolderCreate>'
         );
         
-        $folderCreate = new Syncope_Command_FolderCreate($doc, $this->_device, null);
+        $folderCreate = new Syncroton_Command_FolderCreate($doc, $this->_device, null);
         
         $folderCreate->handle();
         
@@ -155,7 +155,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
         $nodes = $xpath->query('//FolderHierarchy:FolderCreate/FolderHierarchy:ServerId');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
         $this->assertFalse(empty($nodes->item(0)->nodeValue), $responseDoc->saveXML());
-        $this->assertArrayHasKey($nodes->item(0)->nodeValue, Syncope_Data_AData::$folders['Syncope_Data_Email']);
+        $this->assertArrayHasKey($nodes->item(0)->nodeValue, Syncroton_Data_AData::$folders['Syncroton_Data_Email']);
     }
         
     /**
@@ -170,7 +170,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         
         $folderSync->handle();
         
@@ -183,7 +183,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderCreate xmlns="uri:FolderHierarchy"><SyncKey>1</SyncKey><ParentId/><DisplayName>Test Folder</DisplayName><Type>15</Type></FolderCreate>'
         );
         
-        $folderCreate = new Syncope_Command_FolderCreate($doc, $this->_device, null);
+        $folderCreate = new Syncroton_Command_FolderCreate($doc, $this->_device, null);
         
         $folderCreate->handle();
         
@@ -196,7 +196,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
         $nodes = $xpath->query('//FolderHierarchy:FolderCreate/FolderHierarchy:ServerId');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
         $this->assertFalse(empty($nodes->item(0)->nodeValue), $responseDoc->saveXML());
-        $this->assertArrayHasKey($nodes->item(0)->nodeValue, Syncope_Data_AData::$folders['Syncope_Data_Tasks']);
+        $this->assertArrayHasKey($nodes->item(0)->nodeValue, Syncroton_Data_AData::$folders['Syncroton_Data_Tasks']);
     }
         
     /**
@@ -211,7 +211,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         
         $folderSync->handle();
         
@@ -224,7 +224,7 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
             <FolderCreate xmlns="uri:FolderHierarchy"><SyncKey>11</SyncKey><ParentId/><DisplayName>Test Folder</DisplayName><Type>15</Type></FolderCreate>'
         );
         
-        $folderCreate = new Syncope_Command_FolderCreate($doc, $this->_device, null);
+        $folderCreate = new Syncroton_Command_FolderCreate($doc, $this->_device, null);
         
         $folderCreate->handle();
         
@@ -236,6 +236,6 @@ class Syncope_Command_FolderCreateTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//FolderHierarchy:FolderCreate/FolderHierarchy:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_INVALID_SYNC_KEY, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
     }    
 }
similarity index 85%
rename from tests/Syncope/Command/FolderDeleteTests.php
rename to tests/Syncroton/Command/FolderDeleteTests.php
index d668942..960964d 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_Command_FolderDeleteTests extends Syncope_Command_ATestCase
+class Syncroton_Command_FolderDeleteTests extends Syncroton_Command_ATestCase
 {
     #protected $_logPriority = Zend_Log::DEBUG;
     
@@ -41,7 +41,7 @@ class Syncope_Command_FolderDeleteTests extends Syncope_Command_ATestCase
                     <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         $folderSync->handle();
         $responseDoc = $folderSync->getResponse();
         
@@ -52,7 +52,7 @@ class Syncope_Command_FolderDeleteTests extends Syncope_Command_ATestCase
                     <FolderCreate xmlns="uri:FolderHierarchy"><SyncKey>1</SyncKey><ParentId/><DisplayName>Test Folder</DisplayName><Type>14</Type></FolderCreate>'
         );
         
-        $folderCreate = new Syncope_Command_FolderCreate($doc, $this->_device, null);
+        $folderCreate = new Syncroton_Command_FolderCreate($doc, $this->_device, null);
         
         $folderCreate->handle();
         
@@ -72,7 +72,7 @@ class Syncope_Command_FolderDeleteTests extends Syncope_Command_ATestCase
             <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
             <FolderDelete xmlns="uri:FolderHierarchy"><SyncKey>2</SyncKey><ServerId>' . $newFolderId . '</ServerId></FolderDelete>'
         );
-        $folderDelete = new Syncope_Command_FolderDelete($doc, $this->_device, null);
+        $folderDelete = new Syncroton_Command_FolderDelete($doc, $this->_device, null);
         $folderDelete->handle();
         $responseDoc = $folderDelete->getResponse();
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
@@ -82,12 +82,12 @@ class Syncope_Command_FolderDeleteTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//FolderHierarchy:FolderDelete/FolderHierarchy:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//FolderHierarchy:FolderDelete/FolderHierarchy:SyncKey');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
         $this->assertEquals(3, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
-        $this->assertArrayNotHasKey($newFolderId, Syncope_Data_Contacts::$folders);
+        $this->assertArrayNotHasKey($newFolderId, Syncroton_Data_Contacts::$folders);
     }    
 }
similarity index 84%
rename from tests/Syncope/Command/FolderSyncTests.php
rename to tests/Syncroton/Command/FolderSyncTests.php
index 4127bb3..83d7d1d 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_Command_FolderSyncTests extends Syncope_Command_ATestCase
+class Syncroton_Command_FolderSyncTests extends Syncroton_Command_ATestCase
 {
     /**
      * Runs the test methods of this class.
@@ -38,7 +38,7 @@ class Syncope_Command_FolderSyncTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         
         $folderSync->handle();
         
@@ -50,7 +50,7 @@ class Syncope_Command_FolderSyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//FolderHierarchy:FolderSync/FolderHierarchy:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//FolderHierarchy:FolderSync/FolderHierarchy:SyncKey');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
@@ -67,11 +67,11 @@ class Syncope_Command_FolderSyncTests extends Syncope_Command_ATestCase
     {
         $this->testGetFoldersSyncKey0();
         
-        Syncope_Data_AData::$folders['Syncope_Data_Contacts']['addressbookFolderId2'] = array(
+        Syncroton_Data_AData::$folders['Syncroton_Data_Contacts']['addressbookFolderId2'] = array(
             'folderId'    => 'addressbookFolderId2',
             'parentId'    => null,
             'displayName' => 'User created Contacts Folder',
-            'type'        => Syncope_Command_FolderSync::FOLDERTYPE_CONTACT_USER_CREATED
+            'type'        => Syncroton_Command_FolderSync::FOLDERTYPE_CONTACT_USER_CREATED
         );
         
         $doc = new DOMDocument();
@@ -80,7 +80,7 @@ class Syncope_Command_FolderSyncTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>1</SyncKey></FolderSync>'
         );
     
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
     
         $folderSync->handle();
     
@@ -92,7 +92,7 @@ class Syncope_Command_FolderSyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//FolderHierarchy:FolderSync/FolderHierarchy:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//FolderHierarchy:FolderSync/FolderHierarchy:SyncKey');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
@@ -113,7 +113,7 @@ class Syncope_Command_FolderSyncTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>99</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
         
         $folderSync->handle();
         
@@ -125,7 +125,7 @@ class Syncope_Command_FolderSyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//FolderHierarchy:FolderSync/FolderHierarchy:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_INVALID_SYNC_KEY, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//FolderHierarchy:FolderSync');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
+class Syncroton_Command_GetItemEstimateTests extends Syncroton_Command_ATestCase
 {
     #protected $_logPriority = Zend_Log::DEBUG;
     
@@ -40,7 +40,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
             <GetItemEstimate xmlns="uri:ItemEstimate" xmlns:AirSync="uri:AirSync"><Collections><Collection><AirSync:FilterType>0</AirSync:FilterType><AirSync:SyncKey>0</AirSync:SyncKey><Class>Contacts</Class><CollectionId>1212</CollectionId></Collection></Collections></GetItemEstimate>'
         );
         
-        $search = new Syncope_Command_GetItemEstimate($doc, $this->_device, null);
+        $search = new Syncroton_Command_GetItemEstimate($doc, $this->_device, null);
         
         $search->handle();
         
@@ -52,7 +52,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//ItemEstimate:GetItemEstimate/ItemEstimate:Response/ItemEstimate:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_GetItemEstimate::STATUS_INVALID_COLLECTION, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_GetItemEstimate::STATUS_INVALID_COLLECTION, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
     }
     
     /**
@@ -66,7 +66,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
             <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
         $folderSync->handle();
         $folderSync->getResponse();
         
@@ -77,7 +77,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
             <GetItemEstimate xmlns="uri:ItemEstimate" xmlns:AirSync="uri:AirSync"><Collections><Collection><AirSync:FilterType>0</AirSync:FilterType><AirSync:SyncKey>10</AirSync:SyncKey><Class>Contacts</Class><CollectionId>addressbookFolderId</CollectionId></Collection></Collections></GetItemEstimate>'
         );
         
-        $search = new Syncope_Command_GetItemEstimate($doc, $this->_device, null);
+        $search = new Syncroton_Command_GetItemEstimate($doc, $this->_device, null);
         
         $search->handle();
         
@@ -89,7 +89,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//ItemEstimate:GetItemEstimate/ItemEstimate:Response/ItemEstimate:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_GetItemEstimate::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_GetItemEstimate::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
     }
             
     /**
@@ -103,7 +103,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
             <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
         $folderSync->handle();
         $folderSync->getResponse();
         
@@ -114,7 +114,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
             <GetItemEstimate xmlns="uri:ItemEstimate" xmlns:AirSync="uri:AirSync"><Collections><Collection><AirSync:FilterType>0</AirSync:FilterType><AirSync:SyncKey>0</AirSync:SyncKey><Class>Contacts</Class><CollectionId>addressbookFolderId</CollectionId></Collection></Collections></GetItemEstimate>'
         );
         
-        $search = new Syncope_Command_GetItemEstimate($doc, $this->_device, null);
+        $search = new Syncroton_Command_GetItemEstimate($doc, $this->_device, null);
         $search->handle();
         $responseDoc = $search->getResponse();
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
@@ -124,7 +124,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//ItemEstimate:GetItemEstimate/ItemEstimate:Response/ItemEstimate:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_GetItemEstimate::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_GetItemEstimate::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//ItemEstimate:GetItemEstimate/ItemEstimate:Response/ItemEstimate:Collection/ItemEstimate:Estimate');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
@@ -143,7 +143,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
             <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
         $folderSync->handle();
         $folderSync->getResponse();
         
@@ -155,7 +155,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>0</SyncKey><CollectionId>addressbookFolderId</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>2</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         $sync->handle();
         $sync->getResponse();
         
@@ -167,7 +167,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>1</SyncKey><CollectionId>addressbookFolderId</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>2</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         $sync->handle();
         $sync->getResponse();
         
@@ -179,7 +179,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
             <GetItemEstimate xmlns="uri:ItemEstimate" xmlns:AirSync="uri:AirSync"><Collections><Collection><AirSync:FilterType>0</AirSync:FilterType><AirSync:SyncKey>2</AirSync:SyncKey><Class>Contacts</Class><CollectionId>addressbookFolderId</CollectionId></Collection></Collections></GetItemEstimate>'
         );
         
-        $search = new Syncope_Command_GetItemEstimate($doc, $this->_device, null);
+        $search = new Syncroton_Command_GetItemEstimate($doc, $this->_device, null);
         $search->handle();
         $responseDoc = $search->getResponse();
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
@@ -189,7 +189,7 @@ class Syncope_Command_GetItemEstimateTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//ItemEstimate:GetItemEstimate/ItemEstimate:Response/ItemEstimate:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_GetItemEstimate::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_GetItemEstimate::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//ItemEstimate:GetItemEstimate/ItemEstimate:Response/ItemEstimate:Collection/ItemEstimate:Estimate');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_Command_ItemOperationsTests extends Syncope_Command_ATestCase
+class Syncroton_Command_ItemOperationsTests extends Syncroton_Command_ATestCase
 {
     /**
      * Runs the test methods of this class.
@@ -38,7 +38,7 @@ class Syncope_Command_ItemOperationsTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:ItemOperations"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         
         $folderSync->handle();
         
@@ -53,7 +53,7 @@ class Syncope_Command_ItemOperationsTests extends Syncope_Command_ATestCase
                </ItemOperations>'
         );
         
-        $itemOperations = new Syncope_Command_ItemOperations($doc, $this->_device, null);
+        $itemOperations = new Syncroton_Command_ItemOperations($doc, $this->_device, null);
         
         $itemOperations->handle();
         
@@ -66,11 +66,11 @@ class Syncope_Command_ItemOperationsTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//ItemOperations:ItemOperations/ItemOperations:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_ItemOperations::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_ItemOperations::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//ItemOperations:ItemOperations/ItemOperations:Response/ItemOperations:Fetch/ItemOperations:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_ItemOperations::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_ItemOperations::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//ItemOperations:ItemOperations/ItemOperations:Response/ItemOperations:Fetch/ItemOperations:Properties/Email:Subject');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
@@ -90,7 +90,7 @@ class Syncope_Command_ItemOperationsTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:ItemOperations"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         
         $folderSync->handle();
         
@@ -105,7 +105,7 @@ class Syncope_Command_ItemOperationsTests extends Syncope_Command_ATestCase
                </ItemOperations>'
         );
         
-        $itemOperations = new Syncope_Command_ItemOperations($doc, $this->_device, null);
+        $itemOperations = new Syncroton_Command_ItemOperations($doc, $this->_device, null);
         
         $itemOperations->handle();
         
@@ -118,11 +118,11 @@ class Syncope_Command_ItemOperationsTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//ItemOperations:ItemOperations/ItemOperations:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_ItemOperations::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_ItemOperations::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//ItemOperations:ItemOperations/ItemOperations:Response/ItemOperations:Fetch/ItemOperations:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_ItemOperations::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_ItemOperations::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//ItemOperations:ItemOperations/ItemOperations:Response/ItemOperations:Fetch/ItemOperations:Properties/AirSyncBase:ContentType');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
similarity index 83%
rename from tests/Syncope/Command/MoveItemsTests.php
rename to tests/Syncroton/Command/MoveItemsTests.php
index ba00942..581279c 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
+class Syncroton_Command_MoveItemsTests extends Syncroton_Command_ATestCase
 {
     /**
      * Runs the test methods of this class.
@@ -31,7 +31,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
     {
         parent::setUp();
         
-        Syncope_Data_AData::$entries['Syncope_Data_Contacts']['addressbookFolderId']['moveItem'] = array(
+        Syncroton_Data_AData::$entries['Syncroton_Data_Contacts']['addressbookFolderId']['moveItem'] = array(
                'FirstName' => 'Lars', 
                'LastName'  => 'Kneschke'
         );
@@ -40,7 +40,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
     protected function tearDown()
     {
         parent::tearDown();
-        unset(Syncope_Data_AData::$entries['Syncope_Data_Contacts']['addressbookFolderId']['moveItem']);
+        unset(Syncroton_Data_AData::$entries['Syncroton_Data_Contacts']['addressbookFolderId']['moveItem']);
     }
     
     /**
@@ -54,7 +54,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:ItemOperations"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         $folderSync->handle();
         $responseDoc = $folderSync->getResponse();
         
@@ -65,7 +65,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
             <Moves xmlns="uri:Move"><Move><SrcMsgId>2246b0b87ee914e283d6c53717cc36c68cacd187</SrcMsgId><SrcFldId>a130b7462fde72c7d6215ce32226e1794d631fa8</SrcFldId><DstFldId>cf11782725c1e132d05fec5a7cd9862694933003</DstFldId></Move></Moves>'
         );
         
-        $moveItems = new Syncope_Command_MoveItems($doc, $this->_device, null);
+        $moveItems = new Syncroton_Command_MoveItems($doc, $this->_device, null);
         $moveItems->handle();
         $responseDoc = $moveItems->getResponse();
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
@@ -75,7 +75,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//Move:Moves/Move:Response/Move:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_MoveItems::STATUS_INVALID_SOURCE, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_MoveItems::STATUS_INVALID_SOURCE, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
     }
         
     /**
@@ -89,7 +89,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:ItemOperations"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         $folderSync->handle();
         $responseDoc = $folderSync->getResponse();
         
@@ -100,7 +100,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
             <Moves xmlns="uri:Move"><Move><SrcMsgId>2246b0b87ee914e283d6c53717cc36c68cacd187</SrcMsgId><SrcFldId>addressbookFolderId</SrcFldId><DstFldId>cf11782725c1e132d05fec5a7cd9862694933003</DstFldId></Move></Moves>'
         );
         
-        $moveItems = new Syncope_Command_MoveItems($doc, $this->_device, null);
+        $moveItems = new Syncroton_Command_MoveItems($doc, $this->_device, null);
         $moveItems->handle();
         $responseDoc = $moveItems->getResponse();
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
@@ -110,7 +110,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//Move:Moves/Move:Response/Move:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_MoveItems::STATUS_INVALID_DESTINATION, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_MoveItems::STATUS_INVALID_DESTINATION, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
     }
         
     /**
@@ -124,7 +124,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
             <FolderSync xmlns="uri:ItemOperations"><SyncKey>0</SyncKey></FolderSync>'
         );
         
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, null);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, null);
         $folderSync->handle();
         $responseDoc = $folderSync->getResponse();
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
@@ -135,7 +135,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
             <Moves xmlns="uri:Move"><Move><SrcMsgId>moveItem</SrcMsgId><SrcFldId>addressbookFolderId</SrcFldId><DstFldId>anotherAddressbookFolderId</DstFldId></Move></Moves>'
         );
         
-        $moveItems = new Syncope_Command_MoveItems($doc, $this->_device, null);
+        $moveItems = new Syncroton_Command_MoveItems($doc, $this->_device, null);
         $moveItems->handle();
         $responseDoc = $moveItems->getResponse();
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
@@ -145,7 +145,7 @@ class Syncope_Command_MoveItemsTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//Move:Moves/Move:Response/Move:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_MoveItems::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_MoveItems::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//Move:Moves/Move:Response/Move:SrcMsgId');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
similarity index 84%
rename from tests/Syncope/Command/PingTests.php
rename to tests/Syncroton/Command/PingTests.php
index a7e4ac5..2fbcea6 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_Command_PingTests extends Syncope_Command_ATestCase
+class Syncroton_Command_PingTests extends Syncroton_Command_ATestCase
 {
     #protected $_logPriority = Zend_Log::DEBUG;
     
@@ -40,7 +40,7 @@ class Syncope_Command_PingTests extends Syncope_Command_ATestCase
             <Ping xmlns="uri:Ping"><HeartBeatInterval>10</HeartBeatInterval><Folders><Folder><Id>14</Id><Class>Contacts</Class></Folder></Folders></Ping>'
         );
         
-        $search = new Syncope_Command_Ping($doc, $this->_device, null);
+        $search = new Syncroton_Command_Ping($doc, $this->_device, null);
         
         $search->handle();
         
@@ -52,7 +52,7 @@ class Syncope_Command_PingTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//Ping:Ping/Ping:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Ping::STATUS_FOLDER_NOT_FOUND, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Ping::STATUS_FOLDER_NOT_FOUND, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
     }
         
     /**
@@ -66,7 +66,7 @@ class Syncope_Command_PingTests extends Syncope_Command_ATestCase
             <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
         $folderSync->handle();
         $folderSync->getResponse();
         
@@ -77,7 +77,7 @@ class Syncope_Command_PingTests extends Syncope_Command_ATestCase
             <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>0</SyncKey><CollectionId>addressbookFolderId</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>100</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         $sync->handle();
         $syncDoc = $sync->getResponse();
         #$syncDoc->formatOutput = true; echo $syncDoc->saveXML();
@@ -89,7 +89,7 @@ class Syncope_Command_PingTests extends Syncope_Command_ATestCase
             <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>1</SyncKey><CollectionId>addressbookFolderId</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>100</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         $sync->handle();
         $syncDoc = $sync->getResponse();
         #$syncDoc->formatOutput = true; echo $syncDoc->saveXML();
@@ -97,7 +97,7 @@ class Syncope_Command_PingTests extends Syncope_Command_ATestCase
         // sleep one second; otherwise we are to fast
         sleep(1);
         
-        Syncope_Data_Contacts::$changedEntries['Syncope_Data_Contacts'][] = 'contact1';
+        Syncroton_Data_Contacts::$changedEntries['Syncroton_Data_Contacts'][] = 'contact1';
         
         // and now we can start the ping request
         $doc = new DOMDocument();
@@ -106,21 +106,21 @@ class Syncope_Command_PingTests extends Syncope_Command_ATestCase
             <Ping xmlns="uri:Ping"><HeartBeatInterval>10</HeartBeatInterval><Folders><Folder><Id>addressbookFolderId</Id><Class>Contacts</Class></Folder></Folders></Ping>'
         );
         
-        $search = new Syncope_Command_Ping($doc, $this->_device, null);
+        $search = new Syncroton_Command_Ping($doc, $this->_device, null);
         
         $search->handle();
         
         $responseDoc = $search->getResponse();
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
         
-        Syncope_Data_Contacts::$changedEntries['Syncope_Data_Contacts'] = array();
+        Syncroton_Data_Contacts::$changedEntries['Syncroton_Data_Contacts'] = array();
         
         $xpath = new DomXPath($responseDoc);
         $xpath->registerNamespace('Ping', 'uri:Ping');
         
         $nodes = $xpath->query('//Ping:Ping/Ping:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Ping::STATUS_CHANGES_FOUND, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Ping::STATUS_CHANGES_FOUND, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//Ping:Ping/Ping:Folders/Ping:Folder');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
similarity index 79%
rename from tests/Syncope/Command/ProvisionTests.php
rename to tests/Syncroton/Command/ProvisionTests.php
index 1b97c05..42273b8 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     ActiveSync
  */
-class Syncope_Command_ProvisionTests extends Syncope_Command_ATestCase
+class Syncroton_Command_ProvisionTests extends Syncroton_Command_ATestCase
 {
     /**
      * Runs the test methods of this class.
@@ -38,7 +38,7 @@ class Syncope_Command_ProvisionTests extends Syncope_Command_ATestCase
             <Provision xmlns="uri:Provision"><Policies><Policy><PolicyType>MS-EAS-Provisioning-WBXML</PolicyType></Policy></Policies></Provision>'
         );
         
-        $provision = new Syncope_Command_Provision($doc, $this->_device, $this->_device->policykey);
+        $provision = new Syncroton_Command_Provision($doc, $this->_device, $this->_device->policykey);
         
         $provision->handle();
         
@@ -50,11 +50,11 @@ class Syncope_Command_ProvisionTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//Provision:Provision/Provision:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//Provision:Provision/Provision:Policies/Provision:Policy/Provision:PolicyType');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Provision::POLICYTYPE_WBXML, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Provision::POLICYTYPE_WBXML, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
 
         $nodes = $xpath->query('//Provision:Provision/Provision:Policies/Provision:Policy/Provision:Data/Provision:EASProvisionDoc/Provision:DevicePasswordEnabled');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
@@ -75,7 +75,7 @@ class Syncope_Command_ProvisionTests extends Syncope_Command_ATestCase
             <Provision xmlns="uri:Provision"><Policies><Policy><PolicyType>MS-EAS-Provisioning-WBXML</PolicyType><PolicyKey>1307199584</PolicyKey><Status>1</Status></Policy></Policies></Provision>'
         );
         
-        $provision = new Syncope_Command_Provision($doc, $this->_device, $this->_device->policykey);
+        $provision = new Syncroton_Command_Provision($doc, $this->_device, $this->_device->policykey);
         
         $provision->handle();
         
@@ -87,11 +87,11 @@ class Syncope_Command_ProvisionTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//Provision:Provision/Provision:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//Provision:Provision/Provision:Policies/Provision:Policy/Provision:PolicyType');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Provision::POLICYTYPE_WBXML, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Provision::POLICYTYPE_WBXML, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
     }
     
     /**
@@ -105,10 +105,10 @@ class Syncope_Command_ProvisionTests extends Syncope_Command_ATestCase
             <Provision xmlns="uri:Provision"></Provision>'
         );
         
-        $this->_device->remotewipe = Syncope_Command_Provision::REMOTEWIPE_REQUESTED;
+        $this->_device->remotewipe = Syncroton_Command_Provision::REMOTEWIPE_REQUESTED;
         $this->_device = $this->_deviceBackend->update($this->_device);
         
-        $provision = new Syncope_Command_Provision($doc, $this->_device, $this->_device->policykey);
+        $provision = new Syncroton_Command_Provision($doc, $this->_device, $this->_device->policykey);
         
         $provision->handle();
         
@@ -120,7 +120,7 @@ class Syncope_Command_ProvisionTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//Provision:Provision/Provision:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//Provision:Provision/Provision:RemoteWipe');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
@@ -139,7 +139,7 @@ class Syncope_Command_ProvisionTests extends Syncope_Command_ATestCase
             <Provision xmlns="uri:Provision"><RemoteWipe><Status>1</Status></RemoteWipe></Provision>'
         );
         
-        $provision = new Syncope_Command_Provision($doc, $this->_device, $this->_device->policykey);
+        $provision = new Syncroton_Command_Provision($doc, $this->_device, $this->_device->policykey);
         
         $provision->handle();
         
@@ -147,14 +147,14 @@ class Syncope_Command_ProvisionTests extends Syncope_Command_ATestCase
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
         
         $this->_device = $this->_deviceBackend->update($this->_device);
-        $this->assertEquals(Syncope_Command_Provision::REMOTEWIPE_CONFIRMED, $this->_device->remotewipe);
+        $this->assertEquals(Syncroton_Command_Provision::REMOTEWIPE_CONFIRMED, $this->_device->remotewipe);
         
         $xpath = new DomXPath($responseDoc);
         $xpath->registerNamespace('Provision', 'uri:Provision');
         
         $nodes = $xpath->query('//Provision:Provision/Provision:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_FolderSync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         $nodes = $xpath->query('//Provision:Provision/Provision:RemoteWipe');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
similarity index 84%
rename from tests/Syncope/Command/SearchTests.php
rename to tests/Syncroton/Command/SearchTests.php
index 7bcd6d1..1617a25 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_Command_SearchTests extends Syncope_Command_ATestCase
+class Syncroton_Command_SearchTests extends Syncroton_Command_ATestCase
 {
     /**
      * Runs the test methods of this class.
@@ -38,7 +38,7 @@ class Syncope_Command_SearchTests extends Syncope_Command_ATestCase
             <Search xmlns="uri:Search"><Store><Name>14</Name></Store></Search>'
         );
         
-        $search = new Syncope_Command_Search($doc, $this->_device, null);
+        $search = new Syncroton_Command_Search($doc, $this->_device, null);
         
         $search->handle();
         
@@ -50,6 +50,6 @@ class Syncope_Command_SearchTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//Search:Search/Search:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Search::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Search::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
     }    
 }
similarity index 86%
rename from tests/Syncope/Command/SettingsTests.php
rename to tests/Syncroton/Command/SettingsTests.php
index e2bc6da..989b4dd 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_Command_SettingsTests extends Syncope_Command_ATestCase
+class Syncroton_Command_SettingsTests extends Syncroton_Command_ATestCase
 {
     #protected $_logPriority = Zend_Log::DEBUG;
     
@@ -40,7 +40,7 @@ class Syncope_Command_SettingsTests extends Syncope_Command_ATestCase
             <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
             <Settings xmlns="uri:Settings"><DeviceInformation><Set><Model>iPhone</Model></Set></DeviceInformation></Settings>'
         );
-        $folderDelete = new Syncope_Command_Settings($doc, $this->_device, null);
+        $folderDelete = new Syncroton_Command_Settings($doc, $this->_device, null);
         $folderDelete->handle();
         $responseDoc = $folderDelete->getResponse();
         #$responseDoc->formatOutput = true; echo $responseDoc->saveXML();
@@ -50,7 +50,7 @@ class Syncope_Command_SettingsTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//Settings:Settings/Settings:Status');
         $this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Settings::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Settings::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $responseDoc->saveXML());
         
         #$nodes = $xpath->query('//Settings:Settings/Settings:SyncKey');
         #$this->assertEquals(1, $nodes->length, $responseDoc->saveXML());
similarity index 87%
rename from tests/Syncope/Command/SyncTests.php
rename to tests/Syncroton/Command/SyncTests.php
index 7fd749d..7d0b7b5 100644 (file)
@@ -9,11 +9,11 @@
  */
 
 /**
- * Test class for Syncope_Command_Sync
+ * Test class for Syncroton_Command_Sync
  * 
  * @package     Tests
  */
-class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
+class Syncroton_Command_SyncTests extends Syncroton_Command_ATestCase
 {
     #protected $_logPriority = Zend_Log::DEBUG;
     
@@ -40,7 +40,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>1356</SyncKey><CollectionId>48ru47fhf7ghf7fgh4</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>100</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -56,7 +56,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_INVALID_SYNC_KEY, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_INVALID_SYNC_KEY, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
     }
     
     /**
@@ -70,7 +70,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>0</SyncKey><CollectionId>48ru47fhf7ghf7fgh4</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>100</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -86,7 +86,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_FOLDER_HIERARCHY_HAS_CHANGED, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_FOLDER_HIERARCHY_HAS_CHANGED, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
     }
     
     /**
@@ -100,7 +100,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>0</SyncKey><CollectionId>addressbookFolderId</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>100</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -116,7 +116,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_FOLDER_HIERARCHY_HAS_CHANGED, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_FOLDER_HIERARCHY_HAS_CHANGED, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
     }
     
     /**
@@ -130,7 +130,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             <!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
             <FolderSync xmlns="uri:FolderHierarchy"><SyncKey>0</SyncKey></FolderSync>'
         );
-        $folderSync = new Syncope_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
+        $folderSync = new Syncroton_Command_FolderSync($doc, $this->_device, $this->_device->policykey);
         $folderSync->handle();
         $folderSync->getResponse();
         
@@ -142,7 +142,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>0</SyncKey><CollectionId>addressbookFolderId</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>2</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -162,7 +162,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
         
         
         // now do the first sync
@@ -172,7 +172,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>1</SyncKey><CollectionId>addressbookFolderId</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>2</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -192,14 +192,14 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:MoreAvailable');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Commands');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        #$this->assertEquals(Syncope_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        #$this->assertEquals(Syncroton_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
         
         // there should be no responses element
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Responses');
@@ -214,7 +214,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>1</SyncKey><CollectionId>addressbookFolderId</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>2</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -229,7 +229,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             <Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase"><Collections><Collection><Class>Contacts</Class><SyncKey>2</SyncKey><CollectionId>addressbookFolderId</CollectionId><DeletesAsMoves/><GetChanges/><WindowSize>20</WindowSize><Options><AirSyncBase:BodyPreference><AirSyncBase:Type>1</AirSyncBase:Type><AirSyncBase:TruncationSize>5120</AirSyncBase:TruncationSize></AirSyncBase:BodyPreference><Conflict>1</Conflict></Options></Collection></Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -263,7 +263,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             </Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -283,7 +283,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Responses/AirSync:Add/AirSync:ServerId');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
@@ -309,7 +309,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             </Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -329,13 +329,13 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Responses');
         $this->assertEquals(0, $nodes->length, $syncDoc->saveXML());
         
-        $this->assertEquals('aaaadde', Syncope_Data_AData::$entries['Syncope_Data_Contacts']['addressbookFolderId'][$serverId]['FirstName']);
-        $this->assertEquals('aaaaade', Syncope_Data_AData::$entries['Syncope_Data_Contacts']['addressbookFolderId'][$serverId]['LastName']);
+        $this->assertEquals('aaaadde', Syncroton_Data_AData::$entries['Syncroton_Data_Contacts']['addressbookFolderId'][$serverId]['FirstName']);
+        $this->assertEquals('aaaaade', Syncroton_Data_AData::$entries['Syncroton_Data_Contacts']['addressbookFolderId'][$serverId]['LastName']);
     }
             
     public function testDeletingContactOnServer()
@@ -355,7 +355,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             </Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -375,14 +375,14 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
     }
             
     public function testUpdatingContactOnClient()
     {
         $serverId = $this->testAddingContactToServer();
         
-        Syncope_Data_Contacts::$changedEntries['Syncope_Data_Contacts'][] = $serverId;
+        Syncroton_Data_Contacts::$changedEntries['Syncroton_Data_Contacts'][] = $serverId;
         
         // lets add one contact
         $doc = new DOMDocument();
@@ -396,14 +396,14 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             </Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
         $syncDoc = $sync->getResponse();
         #$syncDoc->formatOutput = true; echo $syncDoc->saveXML();
 
-        Syncope_Data_Contacts::$changedEntries['Syncope_Data_Contacts'] = array();
+        Syncroton_Data_Contacts::$changedEntries['Syncroton_Data_Contacts'] = array();
         
         $xpath = new DomXPath($syncDoc);
         $xpath->registerNamespace('AirSync', 'uri:AirSync');
@@ -418,7 +418,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Commands/AirSync:Change/AirSync:ServerId');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
@@ -429,7 +429,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
     {
         $serverId = $this->testAddingContactToServer();
         
-        unset(Syncope_Data_Contacts::$entries['Syncope_Data_Contacts']['addressbookFolderId'][$serverId]);
+        unset(Syncroton_Data_Contacts::$entries['Syncroton_Data_Contacts']['addressbookFolderId'][$serverId]);
         
         // lets add one contact
         $doc = new DOMDocument();
@@ -443,7 +443,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             </Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -463,7 +463,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Commands/AirSync:Delete/AirSync:ServerId');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
@@ -485,7 +485,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             </Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
         
@@ -501,7 +501,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         
         $nodes = $xpath->query('//AirSync:Sync/AirSync:Collections/AirSync:Collection/AirSync:Status');
         $this->assertEquals(1, $nodes->length, $syncDoc->saveXML());
-        $this->assertEquals(Syncope_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
+        $this->assertEquals(Syncroton_Command_Sync::STATUS_SUCCESS, $nodes->item(0)->nodeValue, $syncDoc->saveXML());
     }
     
     /**
@@ -524,10 +524,10 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
             </Collections></Sync>'
         );
         
-        $sync = new Syncope_Command_Sync($doc, $this->_device, $this->_device->policykey);
+        $sync = new Syncroton_Command_Sync($doc, $this->_device, $this->_device->policykey);
         
         $sync->handle();
-        $count = count(Syncope_Data_Contacts::$entries['Syncope_Data_Contacts']["addressbookFolderId"]);
+        $count = count(Syncroton_Data_Contacts::$entries['Syncroton_Data_Contacts']["addressbookFolderId"]);
         $folder = $this->_folderBackend->getFolder($this->_device, 'addressbookFolderId');
         $syncState = $this->_syncStateBackend->getSyncState($this->_device, $folder);
         $syncState->counter++;
@@ -541,7 +541,7 @@ class Syncope_Command_SyncTests extends Syncope_Command_ATestCase
         }
         
         $this->assertTrue($catchedException);
-        $this->assertGreaterThan(count(Syncope_Data_Contacts::$entries['Syncope_Data_Contacts']["addressbookFolderId"]), $count);
+        $this->assertGreaterThan(count(Syncroton_Data_Contacts::$entries['Syncroton_Data_Contacts']["addressbookFolderId"]), $count);
     }
             
 }
similarity index 72%
rename from tests/Syncope/Data/AllTests.php
rename to tests/Syncroton/Data/AllTests.php
index 26b8c87..16ec8d4 100755 (executable)
@@ -8,7 +8,7 @@
  * @author      Jonas Fischer <j.fischer@metaways.de>
  */
 
-class Syncope_Data_AllTests
+class Syncroton_Data_AllTests
 {
     public static function main ()
     {
@@ -17,9 +17,9 @@ class Syncope_Data_AllTests
     
     public static function suite ()
     {
-        $suite = new PHPUnit_Framework_TestSuite('Syncope all data backend tests');
+        $suite = new PHPUnit_Framework_TestSuite('Syncroton all data backend tests');
         
-        $suite->addTestSuite('Syncope_Data_ContactsTests');
+        $suite->addTestSuite('Syncroton_Data_ContactsTests');
         
         return $suite;
     }
similarity index 79%
rename from tests/Syncope/Data/ContactsTests.php
rename to tests/Syncroton/Data/ContactsTests.php
index 71e4969..f81a000 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     Calendar
  */
-class Syncope_Data_ContactsTests extends Syncope_Command_ATestCase
+class Syncroton_Data_ContactsTests extends Syncroton_Command_ATestCase
 {
     /**
      * @var array test objects
@@ -41,7 +41,7 @@ class Syncope_Data_ContactsTests extends Syncope_Command_ATestCase
      */
     public static function main()
     {
-        $suite  = new PHPUnit_Framework_TestSuite('Syncope contacts tests');
+        $suite  = new PHPUnit_Framework_TestSuite('Syncroton contacts tests');
         PHPUnit_TextUI_TestRunner::run($suite);
     }
     
@@ -51,10 +51,10 @@ class Syncope_Data_ContactsTests extends Syncope_Command_ATestCase
     public function testGetFoldersIPhone()
     {
         $device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice(Syncope_Model_Device::TYPE_IPHONE)
+            Syncroton_Backend_DeviceTests::getTestDevice(Syncroton_Model_Device::TYPE_IPHONE)
         );
         
-        $dataController = Syncope_Data_Factory::factory(Syncope_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
+        $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
         
        $folders = $dataController->getAllFolders();
                 
@@ -78,10 +78,10 @@ class Syncope_Data_ContactsTests extends Syncope_Command_ATestCase
         $testNode = $testDoc->documentElement->appendChild($testDoc->createElementNS('uri:AirSync', 'ApplicationData'));
         
         $device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice(Syncope_Model_Device::TYPE_WEBOS)
+            Syncroton_Backend_DeviceTests::getTestDevice(Syncroton_Model_Device::TYPE_WEBOS)
         );
         
-        $dataController = Syncope_Data_Factory::factory(Syncope_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
+        $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
                 
        $dataController->appendXML($testNode, array('collectionId' => 'addressbookFolderId'), 'contact1');
        #echo $testDoc->saveXML();
@@ -105,14 +105,14 @@ class Syncope_Data_ContactsTests extends Syncope_Command_ATestCase
     public function testAddContact()
     {
         $device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice(Syncope_Model_Device::TYPE_ANDROID)
+            Syncroton_Backend_DeviceTests::getTestDevice(Syncroton_Model_Device::TYPE_ANDROID)
         );
-        $dataController = Syncope_Data_Factory::factory(Syncope_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
+        $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
         
         $xml = new SimpleXMLElement($this->_xmlContactBirthdayWithoutTimeAndroid);
         $id = $dataController->createEntry('addressbookFolderId', $xml->Collections->Collection->Commands->Add->ApplicationData);
         
-        $entry = Syncope_Data_AData::$entries['Syncope_Data_Contacts']['addressbookFolderId'][$id];
+        $entry = Syncroton_Data_AData::$entries['Syncroton_Data_Contacts']['addressbookFolderId'][$id];
         
         #$userTimezone = Tinebase_Core::get(Tinebase_Core::USERTIMEZONE);
         #$bday = new Tinebase_DateTime('1969-12-31', $userTimezone);
@@ -146,9 +146,9 @@ class Syncope_Data_ContactsTests extends Syncope_Command_ATestCase
         
         
         $device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice(Syncope_Model_Device::TYPE_IPHONE)
+            Syncroton_Backend_DeviceTests::getTestDevice(Syncroton_Model_Device::TYPE_IPHONE)
         );
-        $dataController = Syncope_Data_Factory::factory(Syncope_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
+        $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
                 
         $dataController->appendXML($appData, array('collectionId' => 'addressbookFolderId'), 'contact1');
         
@@ -174,9 +174,9 @@ class Syncope_Data_ContactsTests extends Syncope_Command_ATestCase
     public function testGetServerEntries()
     {
         $device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice(Syncope_Model_Device::TYPE_IPHONE)
+            Syncroton_Backend_DeviceTests::getTestDevice(Syncroton_Model_Device::TYPE_IPHONE)
         );
-        $dataController = Syncope_Data_Factory::factory(Syncope_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
+        $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
         
        $entries = $dataController->getServerEntries('addressbookFolderId', null);
        
@@ -189,11 +189,11 @@ class Syncope_Data_ContactsTests extends Syncope_Command_ATestCase
     public function testGetChanged()
     {
         $device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice(Syncope_Model_Device::TYPE_IPHONE)
+            Syncroton_Backend_DeviceTests::getTestDevice(Syncroton_Model_Device::TYPE_IPHONE)
         );
-        $dataController = Syncope_Data_Factory::factory(Syncope_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
+        $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
         
-        Syncope_Data_AData::$changedEntries['Syncope_Data_Contacts'][] = 'contact1';
+        Syncroton_Data_AData::$changedEntries['Syncroton_Data_Contacts'][] = 'contact1';
         
         $entries = $dataController->getChangedEntries('addressbook-root', new DateTime(null, new DateTimeZone('UTC')));
         #var_dump($entries);
@@ -204,16 +204,16 @@ class Syncope_Data_ContactsTests extends Syncope_Command_ATestCase
     public function testDeleteEntry()
     {
         $device = $this->_deviceBackend->create(
-            Syncope_Backend_DeviceTests::getTestDevice(Syncope_Model_Device::TYPE_IPHONE)
+            Syncroton_Backend_DeviceTests::getTestDevice(Syncroton_Model_Device::TYPE_IPHONE)
         );
-        $dataController = Syncope_Data_Factory::factory(Syncope_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
+        $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_CONTACTS, $device, new DateTime(null, new DateTimeZone('UTC')));
         
-        Syncope_Data_AData::$entries['Syncope_Data_Contacts']['addressbookFolderId']['foobar'] = array();
+        Syncroton_Data_AData::$entries['Syncroton_Data_Contacts']['addressbookFolderId']['foobar'] = array();
         
-        $this->assertArrayHasKey('foobar', Syncope_Data_Contacts::$entries['Syncope_Data_Contacts']['addressbookFolderId']);
+        $this->assertArrayHasKey('foobar', Syncroton_Data_Contacts::$entries['Syncroton_Data_Contacts']['addressbookFolderId']);
         
         $dataController->deleteEntry('addressbookFolderId', 'foobar', array());
         
-        $this->assertArrayNotHasKey('foobar', Syncope_Data_Contacts::$entries['Syncope_Data_Contacts']['addressbookFolderId']);
+        $this->assertArrayNotHasKey('foobar', Syncroton_Data_Contacts::$entries['Syncroton_Data_Contacts']['addressbookFolderId']);
     }
 }
similarity index 92%
rename from tests/Syncope/ServerTests.php
rename to tests/Syncroton/ServerTests.php
index 0bb2419..ee871ed 100644 (file)
@@ -13,7 +13,7 @@
  * 
  * @package     Tests
  */
-class Syncope_ServerTests extends Syncope_Command_ATestCase
+class Syncroton_ServerTests extends Syncroton_Command_ATestCase
 {
     #protected $_logPriority = Zend_Log::DEBUG;
     
@@ -31,7 +31,7 @@ class Syncope_ServerTests extends Syncope_Command_ATestCase
         
         $request = new Zend_Controller_Request_Http(Zend_Uri::factory('http://localhost/Microsoft-Server-ActiveSync?User=abc1234&DeviceId=Appl7R743U8YWH8&DeviceType=iPhone&Cmd=Sync'));
         
-        $server = new Syncope_Server('abc1234', $request, $doc);
+        $server = new Syncroton_Server('abc1234', $request, $doc);
         
         $server->handle();
     }
index 98c1b82..248fde7 100644 (file)
@@ -13,13 +13,13 @@ $autoloader->setFallbackAutoloader(true);
 
 function getTestDatabase()
 {
-    if (file_exists('/tmp/syncope_test.sq3')) {
-        unlink('/tmp/syncope_test.sq3');
+    if (file_exists('/tmp/Syncroton_test.sq3')) {
+        unlink('/tmp/Syncroton_test.sq3');
     }
     
     // create in memory database by default 
     $params = array (
-       #'dbname' => '/tmp/syncope_test.sq3',
+       #'dbname' => '/tmp/Syncroton_test.sq3',
        'dbname' => ':memory:'
     );
     
@@ -28,7 +28,7 @@ function getTestDatabase()
     // enable foreign keys
     #$db->query('PRAGMA read_uncommitted = true');
     
-    $db->query("CREATE TABLE IF NOT EXISTS `syncope_device` (
+    $db->query("CREATE TABLE IF NOT EXISTS `Syncroton_device` (
         `id` varchar(40) NOT NULL,
         `deviceid` varchar(64) NOT NULL,                                                                                                                                                                         
         `devicetype` varchar(64) NOT NULL,
@@ -43,7 +43,7 @@ function getTestDatabase()
         PRIMARY KEY (`id`)
        )");
 
-    $db->query("CREATE TABLE IF NOT EXISTS `syncope_folder` (
+    $db->query("CREATE TABLE IF NOT EXISTS `Syncroton_folder` (
         `id` varchar(40) NOT NULL,
         `device_id` varchar(40) NOT NULL,
         `class` varchar(64) NOT NULL,
@@ -57,7 +57,7 @@ function getTestDatabase()
         UNIQUE (`device_id`,`class`,`folderid`)
        )");
     
-    $db->query("CREATE TABLE `syncope_synckey` (
+    $db->query("CREATE TABLE `Syncroton_synckey` (
        `id` varchar(40) NOT NULL,
        `device_id` varchar(40) NOT NULL,
        `type` varchar(64) NOT NULL,
@@ -68,7 +68,7 @@ function getTestDatabase()
        UNIQUE (`device_id`,`type`,`counter`)
     )");
     
-    $db->query("CREATE TABLE `syncope_content` (
+    $db->query("CREATE TABLE `Syncroton_content` (
         `id` varchar(40) NOT NULL,
         `device_id` varchar(40) NOT NULL,
         `folder_id` varchar(40) NOT NULL,