Fix phpunit

This commit is contained in:
Laurent Destailleur 2015-04-19 04:43:28 +02:00
parent d723a5873f
commit 22921ad26b
5 changed files with 26 additions and 10 deletions

View File

@ -535,5 +535,6 @@ CREATE TABLE IF NOT EXISTS llx_propal_merge_pdf_product (
-- Feature request: A page to merge two thirdparties into one #2613
ALTER TABLE llx_categorie_societe CHANGE COLUMN fk_societe fk_soc INTEGER NOT NULL;
ALTER TABLE llx_categorie_fournisseur CHANGE COLUMN fk_societe fk_soc INTEGER NOT NULL;
ALTER TABLE llx_societe CHANGE COLUMN fk_societe fk_soc INTEGER NOT NULL;
ALTER TABLE llx_user CHANGE COLUMN fk_societe fk_soc INTEGER NOT NULL;

View File

@ -263,12 +263,12 @@ class AdherentTest extends PHPUnit_Framework_TestCase
$result=$localobject->update($user);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
$result=$localobject->update_note($localobject->note);
$result=$localobject->update_note($localobject->note,'_private');
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
$result=$localobject->update_note_public($localobject->note,'_public');
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
//$result=$localobject->update_note_public($localobject->note_public);
//print __METHOD__." id=".$localobject->id." result=".$result."\n";
//$this->assertLessThan($result, 0);
$newobject=new Adherent($this->savdb);
$result=$newobject->fetch($localobject->id);
@ -278,8 +278,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase
$this->assertEquals($localobject->civility_id, $newobject->civility_id);
$this->assertEquals($localobject->login, $newobject->login);
$this->assertEquals($localobject->societe, $newobject->societe);
$this->assertEquals($localobject->note, $newobject->note);
//$this->assertEquals($localobject->note_public, $newobject->note_public);
$this->assertEquals($localobject->note_public, $newobject->note_public);
$this->assertEquals($localobject->lastname, $newobject->lastname);
$this->assertEquals($localobject->firstname, $newobject->firstname);
$this->assertEquals($localobject->address, $newobject->address);

View File

@ -142,4 +142,21 @@ class AdminLibTest extends PHPUnit_Framework_TestCase
return $result;
}
/**
* testEnableModule
*
* @return void
*/
public function testEnableModule()
{
global $conf, $db, $langs, $user;
require_once dirname(__FILE__).'/../../htdocs/core/modules/modExpenseReport.class.php';
print "Enable module modExpenseReport";
$moduledescriptor=new modExpenseReport($db);
$moduledescriptor->init();
$conf->setValues($db);
}
}

View File

@ -31,6 +31,8 @@ global $conf,$user,$langs,$db;
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
if ($langs->defaultlang != 'en_US')
{
print "Error: Default language for company to run tests must be set to en_US or auto. Current is ".$langs->defaultlang."\n";
@ -61,6 +63,7 @@ class AllTests
*/
public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite('PHPUnit Framework');
//require_once dirname(__FILE__).'/CoreTest.php';

View File

@ -106,10 +106,6 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
{
global $conf,$user,$langs,$db;
print "Enable module modExpenseReport";
$moduledescriptor=new modExpenseReport($db);
$moduledescriptor->init();
if (! $conf->facture->enabled) { print __METHOD__." invoice module not enabled\n"; die(); }
if (! $conf->commande->enabled) { print __METHOD__." order module not enabled\n"; die(); }
if (! $conf->propal->enabled) { print __METHOD__." propal module not enabled\n"; die(); }