-
Notifications
You must be signed in to change notification settings - Fork 38
/
ViewScriptTests.pm
558 lines (482 loc) · 20.4 KB
/
ViewScriptTests.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
use strict;
package ViewScriptTests;
use FoswikiFnTestCase;
our @ISA = qw( FoswikiFnTestCase );
use strict;
use Foswiki;
use Foswiki::UI::View;
use Error qw( :try );
my $fatwilly;
my $UI_FN;
my $topic1 = <<'HERE';
CONTENT
HERE
my $topic2 = <<'HERE';
----
MissingWikiWord %BR%
!ExclamationEscape <br />
<nop>NopEscape
%RED% <pre> adsf </pre> <verbatim> qwerty </verbatim>
<p>A Paragraph </p>
#anchor
<a href="http://blah.com/">asdf</a>
<noautolink>
NotTOAutoLink
</noautolink>
----
HERE
my $topic2meta = '%META:TOPICINFO{author="BaseUserMapping_666" comment="" date="[0-9]{10,10}" format="1.1" version="1"}%\n';
my $topic2metaQ = $topic2meta;
$topic2metaQ =~ s/"/"/g;
my $topic2txtarea = '<textarea name="" rows="22" cols="70" readonly="readonly" style="width:99%" id="topic" class="foswikiTextarea foswikiTextareaRawView">';
my $topic2rawON = $topic2;
$topic2rawON =~ s/</</g;
$topic2rawON =~ s/>/>/g;
$topic2rawON =~ s/"/"/g;
$topic2rawON .= '</textarea>';
my $templateTopicContent1 = <<'HERE';
pretemplate%STARTTEXT%pre%TEXT%post%ENDTEXT%posttemplate
HERE
my $templateTopicContent2 = <<'HERE';
pretemplate%TEXT%post%ENDTEXT%posttemplate
HERE
my $templateTopicContent3 = <<'HERE';
pretemplate%STARTTEXT%pre%TEXT%posttemplate
HERE
my $templateTopicContent4 = <<'HERE';
pretemplate%TEXT%posttemplate
HERE
my $templateTopicContent5 = <<'HERE';
pretemplate%STARTTEXT%posttemplate
HERE
## Should this be supported?
my $templateTopicContentX = <<'HERE';
pretemplate%STARTTEXT%pre%ENDTEXT%posttemplate
HERE
sub new {
$Foswiki::cfg{EnableHierarchicalWebs} = 1;
my $self = shift()->SUPER::new( "ViewScript", @_ );
return $self;
}
# Set up the test fixture
sub set_up {
my $this = shift;
$this->SUPER::set_up();
$UI_FN ||= $this->getUIFn('view');
$fatwilly = $this->{session};
#set up nested web $this->{test_web}/Nest
$this->{test_subweb} = $this->{test_web} . '/Nest';
my $topic = 'TestTopic1';
my $meta =
Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'TestTopic1',
$topic1, undef );
$meta->save();
$topic = 'TestTopic2';
$meta =
Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'TestTopic2',
$topic2, undef );
$meta->save();
$meta =
Foswiki::Meta->new( $this->{session}, $this->{test_web},
'ViewoneTemplate', $templateTopicContent1, undef );
$meta->save( user => $this->{test_user_wikiname} );
$meta =
Foswiki::Meta->new( $this->{session}, $this->{test_web},
'ViewtwoTemplate', $templateTopicContent2, undef );
$meta->save( user => $this->{test_user_wikiname} );
$meta =
Foswiki::Meta->new( $this->{session}, $this->{test_web},
'ViewthreeTemplate', $templateTopicContent3, undef );
$meta->save( user => $this->{test_user_wikiname} );
$meta =
Foswiki::Meta->new( $this->{session}, $this->{test_web},
'ViewfourTemplate', $templateTopicContent4, undef );
$meta->save( user => $this->{test_user_wikiname} );
$meta =
Foswiki::Meta->new( $this->{session}, $this->{test_web},
'ViewfiveTemplate', $templateTopicContent5, undef );
$meta->save( user => $this->{test_user_wikiname} );
try {
$this->{session} = new Foswiki('AdminUser');
my $webObject =
Foswiki::Meta->new( $this->{session}, $this->{test_subweb} );
$webObject->populateNewWeb();
$this->assert( $this->{session}->webExists( $this->{test_subweb} ) );
my $topicObject =
Foswiki::Meta->new( $this->{session}, $this->{test_subweb},
$Foswiki::cfg{HomeTopicName}, "SMELL" );
$topicObject->save();
$this->assert(
$this->{session}->topicExists(
$this->{test_subweb}, $Foswiki::cfg{HomeTopicName}
)
);
}
catch Error::Simple with {
$this->assert( 0, shift->stringify() || '' );
};
my $topicObject =
Foswiki::Meta->new( $this->{session}, $this->{test_subweb}, $topic,
'nested topci1 text', undef );
$topicObject->save();
#set up nested web _and_ topic called $this->{test_web}/ThisTopic
$topicObject =
Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'ThisTopic',
'nested ThisTopic text', undef );
$topicObject->save();
$this->{test_clashingsubweb} = $this->{test_web} . '/ThisTopic';
$topic = 'TestTopic1';
try {
$this->{session} = new Foswiki('AdminUser');
my $webObject =
Foswiki::Meta->new( $this->{session}, $this->{test_clashingsubweb} );
$webObject->populateNewWeb();
$this->assert(
$this->{session}->webExists( $this->{test_clashingsubweb} ) );
my $topicObject = Foswiki::Meta->new(
$this->{session},
$this->{test_clashingsubweb},
$Foswiki::cfg{HomeTopicName}, "SMELL"
);
$topicObject->save();
$this->assert(
$this->{session}->topicExists(
$this->{test_clashingsubweb},
$Foswiki::cfg{HomeTopicName}
)
);
}
catch Error::Simple with {
$this->assert( 0, shift->stringify() || '' );
};
$topicObject =
Foswiki::Meta->new( $this->{session}, $this->{test_clashingsubweb},
$topic, 'nested topci1 text', undef );
$topicObject->save();
}
sub setup_view {
my ( $this, $web, $topic, $tmpl, $raw, $ctype, $skin ) = @_;
my $query = new Unit::Request(
{
webName => [$web],
topicName => [$topic],
template => [$tmpl],
raw => [$raw],
contenttype => [$ctype],
skin => [$skin],
}
);
$query->path_info("/$web/$topic");
$query->method('POST');
$fatwilly = new Foswiki( $this->{test_user_login}, $query );
my ($text) = $this->capture(
sub {
no strict 'refs';
&$UI_FN($fatwilly);
use strict 'refs';
$Foswiki::engine->finalize( $fatwilly->{response},
$fatwilly->{request} );
}
);
my $editUrl = $fatwilly->getScriptUrl('0', 'edit', $this->{test_web}, '' );
$fatwilly->finish();
$text =~ s/\r//g;
$text =~ s/(^.*?\n\n+)//s; # remove CGI header
return ($text, $1, $editUrl);
}
# This test verifies the rendering of the various raw views
sub test_render_raw {
my $this = shift;
my $text;
my $hdr;
($text, $hdr) = $this->setup_view( $this->{test_web}, 'TestTopic2', 'viewfour', 'text');
$this->assert_equals( "$topic2", $text, "Unexpected output from raw=text" );
$this->assert_matches( qr#^Content-Type: text/plain;#ms, $hdr, "raw=text should return text/plain - got $hdr");
($text, $hdr) = $this->setup_view( $this->{test_web}, 'TestTopic2', 'viewfour', 'all');
$this->assert_matches( qr#$topic2meta$topic2#, $text, "Unexpected output from raw=all" );
$this->assert_matches( qr#^Content-Type: text/plain;#ms, $hdr, "raw=all should return text/plain - got $hdr");
($text,$hdr) = $this->setup_view( $this->{test_web}, 'TestTopic2', 'viewfour', 'on');
$this->assert_matches( qr#.*$topic2txtarea$topic2rawON.*#, $text, "Unexpected output from raw=on" );
$this->assert_matches( qr#^Content-Type: text/html;#ms, $hdr, "raw=on should return text/html - got $hdr");
($text, $hdr) = $this->setup_view( $this->{test_web}, 'TestTopic2', 'viewfour', 'debug');
$this->assert_matches( qr#.*$topic2txtarea$topic2metaQ$topic2rawON.*#, $text, "Unexpected output from raw=debug" );
$this->assert_matches( qr#^Content-Type: text/html;#ms, $hdr, "raw=debug should return text/html - got $hdr");
}
# This test verifies the rendering of the text/plain
sub test_render_textplain {
my $this = shift;
my $text;
my $hdr;
my $editUrl;
($text, $hdr, $editUrl) = $this->setup_view( $this->{test_web}, 'TestTopic2', 'viewfour', '', 'text/plain', 'text');
$editUrl =~ s/WebHome/MissingWikiWord/;
my $topic2plain = <<HERE;
pretemplate<hr />
<span class="foswikiNewLink">MissingWikiWord<a href="$editUrl?topicparent=TemporaryViewScriptTestWebViewScript.TestTopic2" rel="nofollow" title="Create this topic">?</a></span> <br />
ExclamationEscape <br />
NopEscape
<font color="#ff0000"> <pre> adsf </pre> <pre> qwerty </pre>
<p>A Paragraph </p>
#anchor
<a href="http://blah.com/">asdf</a>
NotTOAutoLink
<hr />posttemplate
HERE
chomp $topic2plain;
$this->assert_matches( qr#^Content-Type: text/plain;#ms, $hdr, "contenttype=text/plain should return text/plain - got $hdr");
$this->assert_does_not_match( qr#<(noautolink|nop)>#, $text, "autolink or nop found in text skin" );
$this->assert_equals( "$topic2plain", $text, "Unexpected output from contentype=text/plain skin=text" );
}
# This test verifies the handling of preamble (the text following
# %STARTTEXT%) and postamble (the text between %TEXT% and %ENDTEXT%).
sub test_prepostamble {
my $this = shift;
my $text;
($text) = $this->setup_view( $this->{test_web}, 'TestTopic1', 'viewone' );
$text =~ s/\n+$//s;
$this->assert_equals(
'pretemplatepreCONTENT
postposttemplate', $text
);
($text) = $this->setup_view( $this->{test_web}, 'TestTopic1', 'viewtwo' );
$this->assert_equals(
'pretemplateCONTENT
postposttemplate', $text
);
($text) = $this->setup_view( $this->{test_web}, 'TestTopic1', 'viewthree' );
$this->assert_equals( 'pretemplatepreCONTENTposttemplate', $text );
($text) = $this->setup_view( $this->{test_web}, 'TestTopic1', 'viewfour' );
$this->assert_equals( 'pretemplateCONTENTposttemplate', $text );
($text) = $this->setup_view( $this->{test_web}, 'TestTopic1', 'viewfive' );
$this->assert_equals( 'pretemplateposttemplate', $text );
}
sub urltest {
my ( $this, $url, $web, $topic ) = @_;
my $query = new Unit::Request( {} );
$query->setUrl($url);
$query->method('GET');
my $fatwilly = new Foswiki( $this->{test_user_login}, $query );
$this->assert_equals( $web, $fatwilly->{webName} );
$this->assert_equals( $topic, $fatwilly->{topicName} );
$fatwilly->finish();
}
sub test_urlparsing {
my $this = shift;
$this->urltest( '', $this->{users_web}, 'WebHome' );
$this->urltest( '/', $this->{users_web}, 'WebHome' );
# $this->urltest('Sandbox', 'Sandbox', 'WebHome');
$this->urltest( '/Sandbox', 'Sandbox', 'WebHome' );
$this->urltest( '/Sandbox/', 'Sandbox', 'WebHome' );
$this->urltest( '//Sandbox', 'Sandbox', 'WebHome' );
$this->urltest( '///Sandbox', 'Sandbox', 'WebHome' );
$this->urltest( '/Sandbox//', 'Sandbox', 'WebHome' );
$this->urltest( '/Sandbox///', 'Sandbox', 'WebHome' );
$this->urltest( '/Sandbox/WebHome', 'Sandbox', 'WebHome' );
$this->urltest( '/Sandbox//WebHome', 'Sandbox', 'WebHome' );
$this->urltest( '/Sandbox/WebHome/', 'Sandbox/WebHome', 'WebHome' );
$this->urltest( '/Sandbox/WebHome//', 'Sandbox/WebHome', 'WebHome' );
$this->urltest( '/Sandbox/WebIndex', 'Sandbox', 'WebIndex' );
$this->urltest( '/Sandbox//WebIndex', 'Sandbox', 'WebIndex' );
$this->urltest( '/Sandbox///WebIndex', 'Sandbox', 'WebIndex' );
$this->urltest( '/Sandbox/WebIndex/', 'Sandbox/WebIndex', 'WebHome' );
$this->urltest( '/Sandbox/WebIndex//', 'Sandbox/WebIndex', 'WebHome' );
$this->urltest( '/Sandbox/WebIndex///', 'Sandbox/WebIndex', 'WebHome' );
$this->urltest( '/Sandbox/WebIndex?asd=w', 'Sandbox', 'WebIndex' );
$this->urltest( '/Sandbox//WebIndex?asd=qwe', 'Sandbox', 'WebIndex' );
$this->urltest( '/Sandbox/WebIndex/?asd=qwe', 'Sandbox/WebIndex',
'WebHome' );
$this->urltest( '/Sandbox/WebIndex//?asd=ewr', 'Sandbox/WebIndex',
'WebHome' );
$this->urltest( '/Sandbox/WebIndex?topic=WebChanges',
'Sandbox', 'WebChanges' );
$this->urltest( '/Sandbox//WebIndex?topic=WebChanges',
'Sandbox', 'WebChanges' );
$this->urltest( '/Sandbox/WebIndex/?topic=WebChanges',
'Sandbox/WebIndex', 'WebChanges' );
$this->urltest( '/Sandbox/WebIndex//?topic=WebChanges',
'Sandbox/WebIndex', 'WebChanges' );
$this->urltest( '/Sandbox?topic=WebChanges', 'Sandbox', 'WebChanges' );
$this->urltest( '/Sandbox/?topic=WebChanges', 'Sandbox', 'WebChanges' );
$this->urltest( '/Sandbox//?topic=WebChanges', 'Sandbox', 'WebChanges' );
$this->urltest( '/Sandbox/WebIndex?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest( '/Sandbox//WebIndex?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest( '/Sandbox/WebIndex/?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest( '/Sandbox/WebIndex//?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest( '/Sandbox?topic=System.WebChanges', 'System',
'WebChanges' );
$this->urltest( '/Sandbox/?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest( '/Sandbox//?topic=System.WebChanges',
'System', 'WebChanges' );
#nested
# $this->urltest($this->{test_subweb}, $this->{test_subweb}, 'WebHome');
# $this->urltest('/'.$this->{test_subweb}, $this->{test_subweb}, 'WebHome');
# $this->urltest('/'.$this->{test_subweb}.'/', $this->{test_subweb}, 'WebHome');
# $this->urltest('//'.$this->{test_subweb}, $this->{test_subweb}, 'WebHome');
# $this->urltest('///'.$this->{test_subweb}, $this->{test_subweb}, 'WebHome');
# $this->urltest('/'.$this->{test_subweb}.'$this->{test_subweb}//', $this->{test_subweb}, 'WebHome');
# $this->urltest('/'.$this->{test_subweb}.'///', $this->{test_subweb}, 'WebHome');
$this->urltest( '/' . $this->{test_subweb} . '/WebHome',
$this->{test_subweb}, 'WebHome' );
$this->urltest( '/' . $this->{test_subweb} . '//WebHome',
$this->{test_subweb}, 'WebHome' );
$this->urltest( '/' . $this->{test_subweb} . '/WebHome/',
$this->{test_subweb} . '/WebHome', 'WebHome' );
$this->urltest( '/' . $this->{test_subweb} . '/WebHome//',
$this->{test_subweb} . '/WebHome', 'WebHome' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex',
$this->{test_subweb}, 'WebIndex' );
$this->urltest( '/' . $this->{test_subweb} . '//WebIndex',
$this->{test_subweb}, 'WebIndex' );
$this->urltest( '/' . $this->{test_subweb} . '///WebIndex',
$this->{test_subweb}, 'WebIndex' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex/',
$this->{test_subweb} . '/WebIndex', 'WebHome' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex//',
$this->{test_subweb} . '/WebIndex', 'WebHome' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex///',
$this->{test_subweb} . '/WebIndex', 'WebHome' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex?asd=w',
$this->{test_subweb}, 'WebIndex' );
$this->urltest( '/' . $this->{test_subweb} . '//WebIndex?asd=qwe',
$this->{test_subweb}, 'WebIndex' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex/?asd=qwe',
$this->{test_subweb} . '/WebIndex', 'WebHome' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex//?asd=ewr',
$this->{test_subweb} . '/WebIndex', 'WebHome' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex?topic=WebChanges',
$this->{test_subweb}, 'WebChanges' );
$this->urltest( '/' . $this->{test_subweb} . '//WebIndex?topic=WebChanges',
$this->{test_subweb}, 'WebChanges' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex/?topic=WebChanges',
$this->{test_subweb} . '/WebIndex', 'WebChanges' );
$this->urltest( '/' . $this->{test_subweb} . '/WebIndex//?topic=WebChanges',
$this->{test_subweb} . '/WebIndex', 'WebChanges' );
# $this->urltest('/'.$this->{test_subweb}.'?topic=WebChanges', $this->{test_subweb}, 'WebChanges');
# $this->urltest('/'.$this->{test_subweb}.'/?topic=WebChanges', $this->{test_subweb}, 'WebChanges');
# $this->urltest('/'.$this->{test_subweb}.'//?topic=WebChanges', $this->{test_subweb}, 'WebChanges');
$this->urltest(
'/' . $this->{test_subweb} . '/WebIndex?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest(
'/' . $this->{test_subweb} . '//WebIndex?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest(
'/' . $this->{test_subweb} . '/WebIndex/?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest(
'/' . $this->{test_subweb} . '/WebIndex//?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest( '/' . $this->{test_subweb} . '?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest( '/' . $this->{test_subweb} . '/?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest( '/' . $this->{test_subweb} . '//?topic=System.WebChanges',
'System', 'WebChanges' );
$this->urltest(
'/'
. $this->{test_subweb}
. '/WebIndex?topic='
. $this->{test_subweb}
. '.WebChanges',
$this->{test_subweb}, 'WebChanges'
);
$this->urltest(
'/'
. $this->{test_subweb}
. '//WebIndex?topic='
. $this->{test_subweb}
. '.WebChanges',
$this->{test_subweb}, 'WebChanges'
);
$this->urltest(
'/'
. $this->{test_subweb}
. '/WebIndex/?topic='
. $this->{test_subweb}
. '.WebChanges',
$this->{test_subweb}, 'WebChanges'
);
$this->urltest(
'/'
. $this->{test_subweb}
. '/WebIndex//?topic='
. $this->{test_subweb}
. '.WebChanges',
$this->{test_subweb}, 'WebChanges'
);
$this->urltest(
'/'
. $this->{test_subweb}
. '?topic='
. $this->{test_subweb}
. '.WebChanges',
$this->{test_subweb}, 'WebChanges'
);
$this->urltest(
'/'
. $this->{test_subweb}
. '/?topic='
. $this->{test_subweb}
. '.WebChanges',
$this->{test_subweb}, 'WebChanges'
);
$this->urltest(
'/'
. $this->{test_subweb}
. '//?topic='
. $this->{test_subweb}
. '.WebChanges',
$this->{test_subweb}, 'WebChanges'
);
$this->urltest(
'/System/WebIndex?topic=' . $this->{test_subweb} . '.WebChanges',
$this->{test_subweb}, 'WebChanges' );
$this->urltest(
'/System//WebIndex?topic=' . $this->{test_subweb} . '.WebChanges',
$this->{test_subweb}, 'WebChanges' );
$this->urltest(
'/System/WebIndex/?topic=' . $this->{test_subweb} . '.WebChanges',
$this->{test_subweb}, 'WebChanges' );
$this->urltest(
'/System/WebIndex//?topic=' . $this->{test_subweb} . '.WebChanges',
$this->{test_subweb}, 'WebChanges' );
$this->urltest( '/System?topic=' . $this->{test_subweb} . '.WebChanges',
$this->{test_subweb}, 'WebChanges' );
$this->urltest( '/System/?topic=' . $this->{test_subweb} . '.WebChanges',
$this->{test_subweb}, 'WebChanges' );
$this->urltest( '/System//?topic=' . $this->{test_subweb} . '.WebChanges',
$this->{test_subweb}, 'WebChanges' );
#nonexistant webs
#noneexistant topics (Item598)
$this->urltest( '/Sandbox/ThisTopicShouldNotExist',
'Sandbox', 'ThisTopicShouldNotExist' );
$this->urltest(
'/Sandbox/ThisTopicShouldNotExist/',
'Sandbox/ThisTopicShouldNotExist',
'WebHome'
);
$this->urltest( '/' . $this->{test_subweb} . '/ThisTopicShouldNotExist',
$this->{test_subweb}, 'ThisTopicShouldNotExist' );
$this->urltest( '/' . $this->{test_subweb} . '/ThisTopicShouldNotExist/',
$this->{test_subweb} . '/ThisTopicShouldNotExist', 'WebHome' );
#both topic and subweb of same name exists (Item598)
#$this->{test_web}/ThisTopic is both a web and a topic
$this->urltest( '/' . $this->{test_web} . '/ThisTopic',
$this->{test_web}, 'ThisTopic' ); #the only way yo get to the topic
$this->urltest( '/' . $this->{test_web} . '/ThisTopic/',
$this->{test_web} . '/ThisTopic', 'WebHome' );
$this->urltest( '/' . $this->{test_web} . '/ThisTopic/WebHome',
$this->{test_web} . '/ThisTopic', 'WebHome' );
$this->urltest( '/' . $this->{test_web} . '/ThisTopic/WebHome/',
$this->{test_web} . '/ThisTopic/WebHome', 'WebHome' );
#invalid..
# - Invalid web name - Tasks.Item8713
$this->urltest( '/A:B/WebPreferences',
'', 'WebPreferences' );
}
1;