Migration finished
[dbsrgits/DBIx-Class-Tree.git] / t / lib / TreeTest.pm
index 137ea17..e77eea1 100644 (file)
@@ -8,7 +8,7 @@ use TreeTest::Schema;
 our $NODE_COUNT = 80;
 
 sub count_tests {
-    my $count = 11;
+    my $count = 13;
     if( TreeTest::Schema::Node->can('position_column') ){
         $count ++;
     }
@@ -46,6 +46,9 @@ sub run_tests {
     ok( ($nodes->find(22)->children->count()==2), 'node 22 has correct number of children' );
     ok( ($nodes->find(22)->siblings->count()==3), 'node 22 has correct number of siblings' );
 
+    ok( ($nodes->find(22)->parents->count()==1), 'node 22 has correct number of parents' );
+    ok( (($nodes->find(22)->parents->all())[0]->id()==$nodes->find(22)->parent->id()), 'node 22 parent matches parents' );
+
     if( TreeTest::Schema::Node->can('position_column') ){
         ok( check_positions(scalar $root->children()), 'positions are correct' );
     }