--- messaging/manakai/t/DOM-Element.t 2007/07/07 11:11:34 1.2 +++ messaging/manakai/t/DOM-Element.t 2007/07/29 03:49:00 1.4 @@ -1,7 +1,7 @@ #!/usr/bin/perl use strict; use Test; -BEGIN { plan tests => 52 } +BEGIN { plan tests => 61 } require Message::DOM::DOMImplementation; use Message::Util::Error; @@ -126,6 +126,38 @@ "$method get_attribute_ns [3]"; } +## |attributes| +{ + my $el = $doc->create_element ('e'); + ok $el->can ('attributes') ? 1 : 0, 1, 'Element->attributes can'; + + my $as = $el->attributes; + ok UNIVERSAL::isa ($as, 'Message::IF::NamedNodeMap') ? 1 : 0, 1, 'E->as if'; + + $el->set_attribute (at1 => 'value'); + ok $as->get_named_item ('at1'), $el->get_attribute_node ('at1'), + 'Element->attributes get_named_item get_attr_node'; +} + +## |schemaTypeInfo| +{ + my $el = $doc->create_element ('el'); + $el->owner_document->dom_config->set_parameter ('schema-type' => undef); + my $sti = $el->schema_type_info; + ok UNIVERSAL::isa ($sti, 'Message::IF::TypeInfo') ? 1 : 0, 1, 'sti if [1]'; + ok $sti->type_name, undef, 'sti type_name [1]'; + ok $sti->type_namespace, undef, 'sti type_namespace [1]'; +} +{ + my $el = $doc->create_element ('el'); + $el->owner_document->dom_config->set_parameter + ('schema-type' => q); + my $sti = $el->schema_type_info; + ok UNIVERSAL::isa ($sti, 'Message::IF::TypeInfo') ? 1 : 0, 1, 'sti if [2]'; + ok $sti->type_name, undef, 'sti type_name [2]'; + ok $sti->type_namespace, undef, 'sti type_namespace [2]'; +} + =head1 LICENSE Copyright 2007 Wakaba @@ -135,4 +167,4 @@ =cut -## $Date: 2007/07/07 11:11:34 $ +## $Date: 2007/07/29 03:49:00 $