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
ec99db2f
Commit
ec99db2f
authored
14 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Add more phpunit tests
parent
f1df0c84
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/phpunit/BuildDocTest.php
+73
-0
73 additions, 0 deletions
test/phpunit/BuildDocTest.php
with
73 additions
and
0 deletions
test/phpunit/BuildDocTest.php
+
73
−
0
View file @
ec99db2f
...
@@ -29,6 +29,8 @@ global $conf,$user,$langs,$db;
...
@@ -29,6 +29,8 @@ global $conf,$user,$langs,$db;
require_once
'PHPUnit/Framework.php'
;
require_once
'PHPUnit/Framework.php'
;
require_once
dirname
(
__FILE__
)
.
'/../../htdocs/master.inc.php'
;
require_once
dirname
(
__FILE__
)
.
'/../../htdocs/master.inc.php'
;
require_once
dirname
(
__FILE__
)
.
'/../../htdocs/compta/facture/class/facture.class.php'
;
require_once
dirname
(
__FILE__
)
.
'/../../htdocs/compta/facture/class/facture.class.php'
;
require_once
dirname
(
__FILE__
)
.
'/../../htdocs/commande/class/commande.class.php'
;
require_once
dirname
(
__FILE__
)
.
'/../../htdocs/comm/propal/class/propal.class.php'
;
if
(
empty
(
$user
->
id
))
if
(
empty
(
$user
->
id
))
{
{
...
@@ -147,5 +149,76 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
...
@@ -147,5 +149,76 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
return
0
;
return
0
;
}
}
/**
* @covers ModelePDFCommandes
* @covers pdf_edison
* @covers pdf_einstein
*/
public
function
testCommandeBuild
()
{
global
$conf
,
$user
,
$langs
,
$db
;
$conf
=
$this
->
savconf
;
$user
=
$this
->
savuser
;
$langs
=
$this
->
savlangs
;
$db
=
$this
->
savdb
;
require_once
(
DOL_DOCUMENT_ROOT
.
'/includes/modules/commande/modules_commande.php'
);
$conf
->
commande
->
dir_output
.
=
'/temp'
;
$localobject
=
new
Commande
(
$this
->
savdb
);
$localobject
->
initAsSpecimen
();
$localobject
->
socid
=
1
;
// Einstein
$localobject
->
modelpdf
=
'einstein'
;
$result
=
commande_pdf_create
(
$db
,
$localobject
,
$localobject
->
modelpdf
,
$langs
);
$this
->
assertLessThan
(
$result
,
0
);
print
__METHOD__
.
" result="
.
$result
.
"
\n
"
;
// Edison
$localobject
->
modelpdf
=
'edison'
;
$result
=
commande_pdf_create
(
$db
,
$localobject
,
$localobject
->
modelpdf
,
$langs
);
$this
->
assertLessThan
(
$result
,
0
);
print
__METHOD__
.
" result="
.
$result
.
"
\n
"
;
return
0
;
}
/**
* @covers ModelePDFPropales
* @covers pdf_propale_azur
* @covers pdf_propale_jaune
*/
public
function
testPropalBuild
()
{
global
$conf
,
$user
,
$langs
,
$db
;
$conf
=
$this
->
savconf
;
$user
=
$this
->
savuser
;
$langs
=
$this
->
savlangs
;
$db
=
$this
->
savdb
;
require_once
(
DOL_DOCUMENT_ROOT
.
'/includes/modules/propale/modules_propale.php'
);
$conf
->
propale
->
dir_output
.
=
'/temp'
;
$localobject
=
new
Propal
(
$this
->
savdb
);
$localobject
->
initAsSpecimen
();
$localobject
->
socid
=
1
;
// Einstein
$localobject
->
modelpdf
=
'azur'
;
$result
=
propale_pdf_create
(
$db
,
$localobject
,
$localobject
->
modelpdf
,
$langs
);
$this
->
assertLessThan
(
$result
,
0
);
print
__METHOD__
.
" result="
.
$result
.
"
\n
"
;
// Edison
$localobject
->
modelpdf
=
'jaune'
;
$result
=
propale_pdf_create
(
$db
,
$localobject
,
$localobject
->
modelpdf
,
$langs
);
$this
->
assertLessThan
(
$result
,
0
);
print
__METHOD__
.
" result="
.
$result
.
"
\n
"
;
return
0
;
}
}
}
?>
?>
\ No newline at end of file
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