Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
38574c35
Commit
38574c35
authored
13 years ago
by
Izidor Matušov
Committed by
Michael Hamann
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added configuration variables for empty link testcases and added testcases for resolve_pageid
parent
4ab82339
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_test/cases/inc/pageutils_resolve_pageid.test.php
+22
-0
22 additions, 0 deletions
_test/cases/inc/pageutils_resolve_pageid.test.php
_test/cases/inc/parser/xhtml_links.test.php
+46
-4
46 additions, 4 deletions
_test/cases/inc/parser/xhtml_links.test.php
with
68 additions
and
4 deletions
_test/cases/inc/pageutils_resolve_pageid.test.php
+
22
−
0
View file @
38574c35
...
...
@@ -50,6 +50,10 @@ class init_resolve_pageid_test extends UnitTestCase {
$tests
[]
=
array
(
'foo'
,
'foo:'
,
'foo:start'
);
$tests
[]
=
array
(
'foo'
,
'playground:'
,
'playground:playground'
);
// empty $page
global
$ID
;
$ID
=
'my:space'
;
$tests
[]
=
array
(
'my'
,
''
,
'my:space'
);
foreach
(
$tests
as
$test
){
$page
=
$test
[
1
];
...
...
@@ -59,5 +63,23 @@ class init_resolve_pageid_test extends UnitTestCase {
}
}
/**
* Empty page on homepage should resolve to start page
*/
function
test_resolve_pageid_empty_homepage
()
{
global
$ID
;
$ID
=
''
;
global
$conf
;
$conf
[
'start'
]
=
'someverystrangestartname'
;
$ns
=
''
;
$page
=
''
;
$exist
=
true
;
resolve_pageid
(
$ns
,
$page
,
$exist
);
$this
->
assertEqual
(
$page
,
$conf
[
'start'
]);
}
}
//Setup VIM: ex: et ts=4 :
This diff is collapsed.
Click to expand it.
_test/cases/inc/parser/xhtml_links.test.php
+
46
−
4
View file @
38574c35
...
...
@@ -48,10 +48,17 @@ class xhtml_links_test extends UnitTestCase {
global
$ID
;
$ID
=
'my:space'
;
global
$conf
;
$conf
[
'basedir'
]
=
'/'
;
$conf
[
'useheading'
]
=
0
;
$conf
[
'userewrite'
]
=
0
;
$conf
[
'useslash'
]
=
0
;
$conf
[
'canonical'
]
=
0
;
$p
=
new
Doku_Renderer_xhtml
();
$p
->
internallink
(
''
);
$expect
=
'<span class="curid"><a href="/./doku.php
/
my:space" class="wikilink1" title="my:space">start</a></span>'
;
$expect
=
'<span class="curid"><a href="/./doku.php
?id=
my:space" class="wikilink1" title="my:space">start</a></span>'
;
$this
->
assertEqual
(
$p
->
doc
,
$expect
);
}
...
...
@@ -63,10 +70,17 @@ class xhtml_links_test extends UnitTestCase {
global
$ID
;
$ID
=
'my:space'
;
global
$conf
;
$conf
[
'basedir'
]
=
'/'
;
$conf
[
'useheading'
]
=
0
;
$conf
[
'userewrite'
]
=
0
;
$conf
[
'useslash'
]
=
0
;
$conf
[
'canonical'
]
=
0
;
$p
=
new
Doku_Renderer_xhtml
();
$p
->
internallink
(
''
,
'my caption'
);
$expect
=
'<span class="curid"><a href="/./doku.php
/
my:space" class="wikilink1" title="my:space">my caption</a></span>'
;
$expect
=
'<span class="curid"><a href="/./doku.php
?id=
my:space" class="wikilink1" title="my:space">my caption</a></span>'
;
$this
->
assertEqual
(
$p
->
doc
,
$expect
);
}
...
...
@@ -78,10 +92,17 @@ class xhtml_links_test extends UnitTestCase {
global
$ID
;
$ID
=
'my:space'
;
global
$conf
;
$conf
[
'basedir'
]
=
'/'
;
$conf
[
'useheading'
]
=
0
;
$conf
[
'userewrite'
]
=
0
;
$conf
[
'useslash'
]
=
0
;
$conf
[
'canonical'
]
=
0
;
$p
=
new
Doku_Renderer_xhtml
();
$p
->
internallink
(
'?do=index'
);
$expect
=
'<span class="curid"><a href="/./doku.php
/
my:space
?
do=index" class="wikilink1" title="my:space">start</a></span>'
;
$expect
=
'<span class="curid"><a href="/./doku.php
?id=
my:space
&
do=index" class="wikilink1" title="my:space">start</a></span>'
;
$this
->
assertEqual
(
$p
->
doc
,
$expect
);
}
...
...
@@ -93,10 +114,17 @@ class xhtml_links_test extends UnitTestCase {
global
$ID
;
$ID
=
'my:space'
;
global
$conf
;
$conf
[
'basedir'
]
=
'/'
;
$conf
[
'useheading'
]
=
0
;
$conf
[
'userewrite'
]
=
0
;
$conf
[
'useslash'
]
=
0
;
$conf
[
'canonical'
]
=
0
;
$p
=
new
Doku_Renderer_xhtml
();
$p
->
internallink
(
'?do=index'
,
'my caption'
);
$expect
=
'<span class="curid"><a href="/./doku.php
/
my:space
?
do=index" class="wikilink1" title="my:space">my caption</a></span>'
;
$expect
=
'<span class="curid"><a href="/./doku.php
?id=
my:space
&
do=index" class="wikilink1" title="my:space">my caption</a></span>'
;
$this
->
assertEqual
(
$p
->
doc
,
$expect
);
}
...
...
@@ -108,6 +136,13 @@ class xhtml_links_test extends UnitTestCase {
global
$ID
;
$ID
=
'my:space'
;
global
$conf
;
$conf
[
'basedir'
]
=
'/'
;
$conf
[
'useheading'
]
=
0
;
$conf
[
'userewrite'
]
=
0
;
$conf
[
'useslash'
]
=
0
;
$conf
[
'canonical'
]
=
0
;
$p
=
new
Doku_Renderer_xhtml
();
$p
->
locallink
(
'test'
);
...
...
@@ -123,6 +158,13 @@ class xhtml_links_test extends UnitTestCase {
global
$ID
;
$ID
=
'my:space'
;
global
$conf
;
$conf
[
'basedir'
]
=
'/'
;
$conf
[
'useheading'
]
=
0
;
$conf
[
'userewrite'
]
=
0
;
$conf
[
'useslash'
]
=
0
;
$conf
[
'canonical'
]
=
0
;
$p
=
new
Doku_Renderer_xhtml
();
$p
->
locallink
(
'test'
,
'my caption'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment