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
a92effa6
Commit
a92effa6
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix clean test
parent
3c576dcf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/phpunit/RestAPIDocumentTest.php
+9
-7
9 additions, 7 deletions
test/phpunit/RestAPIDocumentTest.php
with
9 additions
and
7 deletions
test/phpunit/RestAPIDocumentTest.php
+
9
−
7
View file @
a92effa6
...
...
@@ -144,11 +144,11 @@ class RestAPIDocumentTest extends PHPUnit_Framework_TestCase
echo
__METHOD__
.
' Request POST url='
.
$url
.
"
\n
"
;
// Send to non existant directory
dol_delete_dir_recursive
(
DOL_DATA_ROOT
.
'/medias/tmpphpunit'
);
//$data = '{ "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "mysubdir1/mysubdir2", "filecontent": "content text", "fileencoding": "" }';
$data
=
array
(
'filename'
=>
"mynewfile.txt"
,
...
...
@@ -158,7 +158,7 @@ class RestAPIDocumentTest extends PHPUnit_Framework_TestCase
'filecontent'
=>
"content text"
,
'fileencoding'
=>
""
);
$result
=
getURLContent
(
$url
,
'POST'
,
$data
,
1
);
echo
__METHOD__
.
' Result for sending document: '
.
var_export
(
$result
,
true
)
.
"
\n
"
;
echo
__METHOD__
.
' curl_error_no: '
.
$result
[
'curl_error_no'
]
.
"
\n
"
;
...
...
@@ -166,11 +166,11 @@ class RestAPIDocumentTest extends PHPUnit_Framework_TestCase
$this
->
assertNotNull
(
$object
,
'Parsing of json result must no be null'
);
$this
->
assertEquals
(
'401'
,
$object
[
'error'
][
'code'
]);
// Send to existant directory
dol_mkdir
(
DOL_DATA_ROOT
.
'/medias/tmpphpunit/tmpphpunit2'
);
$data
=
array
(
'filename'
=>
"mynewfile.txt"
,
'modulepart'
=>
"medias"
,
...
...
@@ -187,5 +187,7 @@ class RestAPIDocumentTest extends PHPUnit_Framework_TestCase
$this
->
assertNotNull
(
$object2
,
'Parsing of json result must no be null'
);
$this
->
assertEquals
(
$result2
[
'curl_error_no'
],
''
);
$this
->
assertEquals
(
$result2
[
'content'
],
'true'
);
dol_delete_dir_recursive
(
DOL_DATA_ROOT
.
'/medias/tmpphpunit'
);
}
}
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