/[suikacvs]/messaging/manakai/t/DOM-Element.t
Suika

Diff of /messaging/manakai/t/DOM-Element.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by wakaba, Sat Jul 7 11:11:34 2007 UTC revision 1.4 by wakaba, Sun Jul 29 03:49:00 2007 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl
2  use strict;  use strict;
3  use Test;  use Test;
4  BEGIN { plan tests => 52 }  BEGIN { plan tests => 61 }
5    
6  require Message::DOM::DOMImplementation;  require Message::DOM::DOMImplementation;
7  use Message::Util::Error;  use Message::Util::Error;
# Line 126  for my $method (qw/set_attribute_node se Line 126  for my $method (qw/set_attribute_node se
126        "$method get_attribute_ns [3]";        "$method get_attribute_ns [3]";
127  }  }
128    
129    ## |attributes|
130    {
131      my $el = $doc->create_element ('e');
132      ok $el->can ('attributes') ? 1 : 0, 1, 'Element->attributes can';
133    
134      my $as = $el->attributes;
135      ok UNIVERSAL::isa ($as, 'Message::IF::NamedNodeMap') ? 1 : 0, 1, 'E->as if';
136      
137      $el->set_attribute (at1 => 'value');
138      ok $as->get_named_item ('at1'), $el->get_attribute_node ('at1'),
139          'Element->attributes get_named_item get_attr_node';
140    }
141    
142    ## |schemaTypeInfo|
143    {
144      my $el = $doc->create_element ('el');
145      $el->owner_document->dom_config->set_parameter ('schema-type' => undef);
146      my $sti = $el->schema_type_info;
147      ok UNIVERSAL::isa ($sti, 'Message::IF::TypeInfo') ? 1 : 0, 1, 'sti if [1]';
148      ok $sti->type_name, undef, 'sti type_name [1]';
149      ok $sti->type_namespace, undef, 'sti type_namespace [1]';
150    }
151    {
152      my $el = $doc->create_element ('el');
153      $el->owner_document->dom_config->set_parameter
154          ('schema-type' => q<http://www.w3.org/TR/REC-xml>);
155      my $sti = $el->schema_type_info;
156      ok UNIVERSAL::isa ($sti, 'Message::IF::TypeInfo') ? 1 : 0, 1, 'sti if [2]';
157      ok $sti->type_name, undef, 'sti type_name [2]';
158      ok $sti->type_namespace, undef, 'sti type_namespace [2]';
159    }
160    
161  =head1 LICENSE  =head1 LICENSE
162    
163  Copyright 2007 Wakaba <w@suika.fam.cx>  Copyright 2007 Wakaba <w@suika.fam.cx>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24