Try fix of phpunit
This commit is contained in:
parent
de7df8ad9f
commit
28d416a00d
@ -419,6 +419,7 @@ script:
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_KNOWLEDGEMANAGEMENT,MAIN_MODULE_EVENTORGANIZATION,MAIN_MODULE_PARTNERSHIP >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
echo $?
|
||||
cd -
|
||||
set +e
|
||||
@ -429,7 +430,7 @@ script:
|
||||
- |
|
||||
echo "Unit testing"
|
||||
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
|
||||
set +e
|
||||
set -e
|
||||
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
|
||||
phpunitresult=$?
|
||||
echo "Phpunit return code = $phpunitresult"
|
||||
|
||||
@ -40,7 +40,10 @@ $langs->load("main");
|
||||
|
||||
/**
|
||||
* Class MyObjectTest
|
||||
* @package Testmymodule
|
||||
*
|
||||
* @backupGlobals disabled
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class MyObjectTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
@ -73,6 +76,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Global test setup
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
@ -85,6 +89,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Unit test setup
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
@ -100,6 +105,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Unit test teardown
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
@ -109,6 +115,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Global test teardown
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
|
||||
@ -36,7 +36,7 @@ if (empty($user->id)) {
|
||||
$user->getrights();
|
||||
}
|
||||
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -27,22 +27,27 @@ global $conf, $user, $langs, $db;
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/knowledgemanagement/class/knowledgerecord.class.php';
|
||||
$langs->load("main");
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
$user->fetch(1);
|
||||
$user->getrights();
|
||||
}
|
||||
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;
|
||||
|
||||
$langs->load("main");
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class KnowledgeRecordTest
|
||||
* @package Testknowledgemanagement
|
||||
*
|
||||
* @backupGlobals disabled
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class KnowledgeRecordTest extends \PHPUnit\Framework\TestCase
|
||||
class KnowledgeRecordTest extends PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
@ -73,6 +78,7 @@ class KnowledgeRecordTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
/**
|
||||
* Global test setup
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
@ -87,6 +93,7 @@ class KnowledgeRecordTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
/**
|
||||
* Unit test setup
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
@ -102,6 +109,7 @@ class KnowledgeRecordTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
/**
|
||||
* Unit test teardown
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
@ -111,6 +119,7 @@ class KnowledgeRecordTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
/**
|
||||
* Global test teardown
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
|
||||
@ -198,7 +198,7 @@ class ProjectTest extends PHPUnit\Framework\TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* testProjectClose
|
||||
* testProjectOther
|
||||
*
|
||||
* @param Project $localobject Project
|
||||
* @return int
|
||||
|
||||
Loading…
Reference in New Issue
Block a user