Author: dr
Date: Thu Aug  2 14:58:50 2007
New Revision: 5809

Log:
- And move those two tests over as well.

Modified:
    trunk/Tree/tests/db_parent_child_tree.php
    trunk/Tree/tests/db_tree.php

Modified: trunk/Tree/tests/db_parent_child_tree.php
==============================================================================
--- trunk/Tree/tests/db_parent_child_tree.php [iso-8859-1] (original)
+++ trunk/Tree/tests/db_parent_child_tree.php [iso-8859-1] Thu Aug  2 14:58:50 
2007
@@ -72,51 +72,6 @@
         return $tree;
     }
 
-    public function testMultipleDataFields()
-    {
-        $tree = $this->setUpTestTree( 'data', null );
-
-        $node8 = $tree->fetchNodeById( 8 ); // returns 8
-        self::assertType( 'ezcTreeNode', $node8 );
-        self::assertSame( '8', $node8->id );
-        self::assertSame( array( 'data' => 'Node 8' ), $node8->data );
-    }
-
-    public function testStoreUpdatedDataMultipleDataFields()
-    {
-        $tree = $this->setUpEmptyTestTree( 'datam', null );
-
-        $root = $tree->createNode( 1, array( 'name' => 'Harald V', 'born' => 
'1937' ) );
-        $tree->setRootNode( $root );
-
-        $root->addChild( $tree->createNode( 2, array( 'name' => 'Haakon', 
'born' => '1973' ) ) );
-        $root->addChild( $tree->createNode( 3, array( 'name' => 'Märtha 
Louise', 'born' => '1971' ) ) );
-
-        // start over
-        $store = new ezcTreeDbExternalTableDataStore( $this->dbh, 'datam', 
'id' );
-        $tree = new ezcTreeDbParentChild(
-            $this->dbh,
-            'parent_child',
-            $store
-        );
-
-        $haakon = $tree->fetchNodeById( 2 );
-        self::assertEquals( array( 'name' => 'Haakon', 'born' => '1973' ), 
$haakon->data );
-        $haakon->data = array( 'name' => 'Haakon', 'born' => 1981 );
-        $haakon->data = array( 'name' => 'Haakon', 'born' => 1983 );
-
-        // start over
-        $store = new ezcTreeDbExternalTableDataStore( $this->dbh, 'datam', 
'id' );
-        $tree = new ezcTreeDbParentChild(
-            $this->dbh,
-            'parent_child',
-            $store
-        );
-
-        $haakon = $tree->fetchNodeById( 2 );
-        self::assertEquals( array( 'name' => 'Haakon', 'born' => '1983' ), 
$haakon->data );
-    }
-
     public static function suite()
     {
          return new PHPUnit_Framework_TestSuite( "ezcTreeDbParentChildTest" );

Modified: trunk/Tree/tests/db_tree.php
==============================================================================
--- trunk/Tree/tests/db_tree.php [iso-8859-1] (original)
+++ trunk/Tree/tests/db_tree.php [iso-8859-1] Thu Aug  2 14:58:50 2007
@@ -219,6 +219,41 @@
         
         self::assertSame( true, $tree->nodeExists( '3' ) );
     }
+
+    public function testMultipleDataFields()
+    {
+        $tree = $this->setUpTestTree( 'data', null );
+
+        $node8 = $tree->fetchNodeById( 8 ); // returns 8
+        self::assertType( 'ezcTreeNode', $node8 );
+        self::assertSame( '8', $node8->id );
+        self::assertSame( array( 'data' => 'Node 8' ), $node8->data );
+    }
+
+    public function testStoreUpdatedDataMultipleDataFields()
+    {
+        $tree = $this->setUpEmptyTestTree( 'datam', null );
+
+        $root = $tree->createNode( 1, array( 'name' => 'Harald V', 'born' => 
'1937' ) );
+        $tree->setRootNode( $root );
+
+        $root->addChild( $tree->createNode( 2, array( 'name' => 'Haakon', 
'born' => '1973' ) ) );
+        $root->addChild( $tree->createNode( 3, array( 'name' => 'Märtha 
Louise', 'born' => '1971' ) ) );
+
+        // start over
+        $tree = $this->setUpTestTree( 'datam', null );
+
+        $haakon = $tree->fetchNodeById( 2 );
+        self::assertEquals( array( 'name' => 'Haakon', 'born' => '1973' ), 
$haakon->data );
+        $haakon->data = array( 'name' => 'Haakon', 'born' => 1981 );
+        $haakon->data = array( 'name' => 'Haakon', 'born' => 1983 );
+
+        // start over
+        $tree = $this->setUpTestTree( 'datam', null );
+
+        $haakon = $tree->fetchNodeById( 2 );
+        self::assertEquals( array( 'name' => 'Haakon', 'born' => '1983' ), 
$haakon->data );
+    }
 }
 
 ?>


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

Reply via email to