Author: dr
Date: Tue Aug  7 16:13:04 2007
New Revision: 5837

Log:
- Make the tests (and code) work on MySQL and PostgreSQL.

Modified:
    trunk/TreeDatabaseTiein/src/backends/db_materialized_path.php
    trunk/TreeDatabaseTiein/src/backends/db_parent_child.php
    trunk/TreeDatabaseTiein/src/stores/db_external.php
    trunk/TreeDatabaseTiein/tests/files/materialized_path.dba
    trunk/TreeDatabaseTiein/tests/files/nested_set.dba
    trunk/TreeDatabaseTiein/tests/files/parent_child.dba

Modified: trunk/TreeDatabaseTiein/src/backends/db_materialized_path.php
==============================================================================
--- trunk/TreeDatabaseTiein/src/backends/db_materialized_path.php [iso-8859-1] 
(original)
+++ trunk/TreeDatabaseTiein/src/backends/db_materialized_path.php [iso-8859-1] 
Tue Aug  7 16:13:04 2007
@@ -421,7 +421,12 @@
     {
         $db = $this->dbh;
         $q = $db->createDeleteQuery();
-        $idList = array_keys( $list->getNodes() );
+
+        $idList = array();
+        foreach ( array_keys( $list->getNodes() ) as $id )
+        {
+            $idList[] = (string) $id;
+        }
 
         // DELETE FROM indexTable
         // WHERE id in ( $list );

Modified: trunk/TreeDatabaseTiein/src/backends/db_parent_child.php
==============================================================================
--- trunk/TreeDatabaseTiein/src/backends/db_parent_child.php [iso-8859-1] 
(original)
+++ trunk/TreeDatabaseTiein/src/backends/db_parent_child.php [iso-8859-1] Tue 
Aug  7 16:13:04 2007
@@ -391,7 +391,12 @@
     {
         $db = $this->dbh;
         $q = $db->createDeleteQuery();
-        $idList = array_keys( $list->getNodes() );
+
+        $idList = array();
+        foreach ( array_keys( $list->getNodes() ) as $id )
+        {
+            $idList[] = (string) $id;
+        }
 
         // DELETE FROM indexTable
         // WHERE id in ( $list );

Modified: trunk/TreeDatabaseTiein/src/stores/db_external.php
==============================================================================
--- trunk/TreeDatabaseTiein/src/stores/db_external.php [iso-8859-1] (original)
+++ trunk/TreeDatabaseTiein/src/stores/db_external.php [iso-8859-1] Tue Aug  7 
16:13:04 2007
@@ -86,7 +86,11 @@
      */
     public function deleteDataForNodes( ezcTreeNodeList $nodeList )
     {
-        $nodeIdsToDelete = array_keys( $nodeList->getNodes() );
+        $nodeIdsToDelete = array();
+        foreach ( array_keys( $nodeList->getNodes() ) as $id )
+        {
+            $nodeIdsToDelete[] = (string) $id;
+        }
 
         $db = $this->dbHandler;
         $q = $db->createDeleteQuery();

Modified: trunk/TreeDatabaseTiein/tests/files/materialized_path.dba
==============================================================================
--- trunk/TreeDatabaseTiein/tests/files/materialized_path.dba [iso-8859-1] 
(original)
+++ trunk/TreeDatabaseTiein/tests/files/materialized_path.dba [iso-8859-1] Tue 
Aug  7 16:13:04 2007
@@ -8,8 +8,8 @@
       array (
         'id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,
@@ -17,8 +17,8 @@
         )),
         'parent_id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => false,
            'default' => NULL,
            'autoIncrement' => false,
@@ -27,7 +27,7 @@
         'path' => 
         ezcDbSchemaField::__set_state(array(
            'type' => 'text',
-           'length' => 4000,
+           'length' => 1000,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,
@@ -68,8 +68,8 @@
       array (
         'id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,
@@ -107,8 +107,8 @@
       array (
         'id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,

Modified: trunk/TreeDatabaseTiein/tests/files/nested_set.dba
==============================================================================
--- trunk/TreeDatabaseTiein/tests/files/nested_set.dba [iso-8859-1] (original)
+++ trunk/TreeDatabaseTiein/tests/files/nested_set.dba [iso-8859-1] Tue Aug  7 
16:13:04 2007
@@ -8,8 +8,8 @@
       array (
         'id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,
@@ -17,8 +17,8 @@
         )),
         'parent_id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => false,
            'default' => NULL,
            'autoIncrement' => false,
@@ -89,8 +89,8 @@
       array (
         'id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,
@@ -128,8 +128,8 @@
       array (
         'id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,

Modified: trunk/TreeDatabaseTiein/tests/files/parent_child.dba
==============================================================================
--- trunk/TreeDatabaseTiein/tests/files/parent_child.dba [iso-8859-1] (original)
+++ trunk/TreeDatabaseTiein/tests/files/parent_child.dba [iso-8859-1] Tue Aug  
7 16:13:04 2007
@@ -8,8 +8,8 @@
       array (
         'id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,
@@ -17,8 +17,8 @@
         )),
         'parent_id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => false,
            'default' => NULL,
            'autoIncrement' => false,
@@ -47,8 +47,8 @@
       array (
         'id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,
@@ -86,8 +86,8 @@
       array (
         'id' => 
         ezcDbSchemaField::__set_state(array(
-           'type' => 'integer',
-           'length' => 0,
+           'type' => 'text',
+           'length' => 128,
            'notNull' => true,
            'default' => NULL,
            'autoIncrement' => false,


-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to