diff _test/Test/Web/View.pm @ 238:b8c724f6de36

DOM model refactoring TT view refactoring, controls are no longer derived from DOM nodes bugfixes
author sergey
date Tue, 16 Oct 2012 01:33:06 +0400
parents 7a920771fd8e
children 0f59b2de72af
line wrap: on
line diff
--- a/_test/Test/Web/View.pm	Mon Oct 15 17:39:12 2012 +0400
+++ b/_test/Test/Web/View.pm	Tue Oct 16 01:33:06 2012 +0400
@@ -100,7 +100,7 @@
     assert(defined $doc);
     $doc->title('test document');
     
-    assert($doc->nodeName eq 'document');
+    assert($doc->name eq 'document');
     assert($doc->title eq 'test document');
     
     assert(not $doc->can('notexists')); # autoloaded property should be ignored
@@ -127,26 +127,26 @@
     
     assert(defined $doc);
     
-    my $factory = $doc->require('My/Org/Panel');
+    my $factory = $doc->RequireControl('My/Org/Panel');
     
     assert(defined $factory);
     
     
     assert($factory->context->stash != $doc->context->stash);
     
-    assert($factory == $doc->require('My/Org/Panel'), "Control should be loaded only once");
+    assert($factory == $doc->RequireControl('My/Org/Panel'), "Control should be loaded only once");
     
     my $ctl = $factory->new('information', { visualClass => 'simple', data => ['one','two','hello world'] } );
     
     assert(defined $ctl);    
     
-    assert($ctl->nodeName eq 'information', "Created control should have a name", "Got: ".$ctl->nodeName, "Expected: information");
+    assert($ctl->name eq 'information', "Created control should have a name", "Got: ".$ctl->name, "Expected: information");
     
-    assert($ctl->nodeProperty('visualClass') eq 'simple');
+    assert($ctl->GetAttribute('visualClass') eq 'simple');
     
     assert($factory->instances == 1);
     
-    $doc->appendChild($ctl);
+    $doc->childNodes([$ctl]);
     
     assert($doc->templateVars('dojo.require'));
     assert(ref $doc->templateVars('dojo.require') eq 'ARRAY');
@@ -205,8 +205,8 @@
     $loader->template('My/Org/TextPreview');
     AssertMemoryLeak(sub {
         my $doc = $loader->document('simple');
-        my $factory = $doc->require('My/Org/Panel');
-        my $ctl = $doc->AppendChild($factory->new('information', { visualClass => 'complex' }) );        
+        my $factory = $doc->RequireControl('My/Org/Panel');
+        my $ctl = $doc->childNodes($factory->new('information', { visualClass => 'complex' }) );        
     });
     
     $loader->template('complex');