Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
a0e0d177
Commit
a0e0d177
authored
11 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Qual: More PHP unit to test dol_escapejs function.
Qual: More PHP unit to test FormAdmin class.
parent
860ca15c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/phpunit/AllTests.php
+6
-0
6 additions, 0 deletions
test/phpunit/AllTests.php
test/phpunit/FunctionsTest.php
+7
-1
7 additions, 1 deletion
test/phpunit/FunctionsTest.php
with
13 additions
and
1 deletion
test/phpunit/AllTests.php
+
6
−
0
View file @
a0e0d177
...
@@ -171,6 +171,12 @@ class AllTests
...
@@ -171,6 +171,12 @@ class AllTests
require_once
dirname
(
__FILE__
)
.
'/ModulesTest.php'
;
// At end because it's the longer
require_once
dirname
(
__FILE__
)
.
'/ModulesTest.php'
;
// At end because it's the longer
$suite
->
addTestSuite
(
'ModulesTest'
);
$suite
->
addTestSuite
(
'ModulesTest'
);
// GUI
require_once
dirname
(
__FILE__
)
.
'/FormAdminTest.php'
;
$suite
->
addTestSuite
(
'FormAdminTest'
);
return
$suite
;
return
$suite
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
test/phpunit/FunctionsTest.php
+
7
−
1
View file @
a0e0d177
...
@@ -403,7 +403,13 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
...
@@ -403,7 +403,13 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{
{
$input
=
"x&<b>#</b>,
\"
'"
;
// " will be converted into '
$input
=
"x&<b>#</b>,
\"
'"
;
// " will be converted into '
$result
=
dol_escape_js
(
$input
);
$result
=
dol_escape_js
(
$input
);
$this
->
assertEquals
(
"x&<b>#<\/b>,\'\'"
,
$result
);
$this
->
assertEquals
(
"x&<b>#</b>,\'\'"
,
$result
,
"Test mode=0"
);
$result
=
dol_escape_js
(
$input
,
1
);
$this
->
assertEquals
(
"x&<b>#</b>,
\"
\'"
,
$result
,
"Test mode=1"
);
$result
=
dol_escape_js
(
$input
,
2
);
$this
->
assertEquals
(
"x&<b>#</b>,
\\\"
'"
,
$result
,
"Test mode=2"
);
}
}
...
...
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