Ignore:
Timestamp:
11/03/08 13:48:21 (4 years ago)
Author:
CrawfordCurrie
Message:

Item67: a missing form definition would make a topic uneditable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UnitTestContrib/test/unit/FormDefTests.pm

    r14 r412  
    176176} 
    177177 
     178sub test_makeFromMeta { 
     179    my $this = shift; 
     180    $this->{twiki}->{store}->saveTopic( 
     181        $this->{twiki}->{user}, $this->{test_web}, 'SplodgeOne', <<FORM); 
     182%META:FORM{name="NonExistantForm"}% 
     183%META:FIELD{name="Ecks" attributes="" title="X" value="Blah"}% 
     184FORM 
     185    my ($meta, $text) = 
     186      $this->{twiki}->{store}->readTopic( 
     187          undef, $this->{test_web}, 'SplodgeOne'); 
     188    my $form = new TWiki::Form( 
     189        $this->{twiki}, $this->{test_web}, 'NonExistantForm', $meta); 
     190    my $f = $form->getField('Ecks'); 
     191    $this->assert_str_equals('', $f->getDefaultValue()); 
     192    $this->assert_str_equals('Ecks', $f->{name}); 
     193    $this->assert_str_equals('X', $f->{title}); 
     194    $this->assert_str_equals('', $f->{size}); 
     195} 
     196 
    1781971; 
Note: See TracChangeset for help on using the changeset viewer.