This commit is contained in:
NASDAMI Quatadah 2022-06-15 15:44:40 +02:00
parent e07a94a051
commit a11732bb0d
2 changed files with 273 additions and 278 deletions

View File

@ -20,7 +20,7 @@ services:
addons: addons:
# Force postgresql to 9.4 (the oldest availablable on xenial) # Force postgresql to 9.4 (the oldest availablable on xenial)
postgresql: '9.4' postgresql: "9.4"
apt: apt:
sources: sources:
# To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/ # To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/
@ -46,11 +46,11 @@ jobs:
include: include:
- stage: PHP 5.6-7.4 - stage: PHP 5.6-7.4
if: type = push if: type = push
php: '5.6' php: "5.6"
env: DB=postgresql env: DB=postgresql
- stage: PHP 5.6-7.4 - stage: PHP 5.6-7.4
if: type = pull_request OR type = push if: type = pull_request OR type = push
php: '7.4.22' php: "7.4.22"
env: DB=mysql env: DB=mysql
- stage: PHP Dev - stage: PHP Dev
if: type = push AND branch = develop if: type = push AND branch = develop
@ -129,8 +129,6 @@ install:
ls $TRAVIS_BUILD_DIR/htdocs/includes/bin ls $TRAVIS_BUILD_DIR/htdocs/includes/bin
echo echo
before_script: before_script:
- | - |
echo Start travis echo Start travis
@ -236,7 +234,6 @@ before_script:
echo "***** First line of dolibarr.log" > $TRAVIS_BUILD_DIR/documents/dolibarr.log echo "***** First line of dolibarr.log" > $TRAVIS_BUILD_DIR/documents/dolibarr.log
echo echo
- echo "Setting up Apache + FPM" - echo "Setting up Apache + FPM"
# enable php-fpm # enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
@ -256,8 +253,6 @@ before_script:
- sudo cat /etc/apache2/sites-available/000-default.conf - sudo cat /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart - sudo service apache2 restart
script: script:
- | - |
echo "Checking webserver availability by a wget -O - http://127.0.0.1" echo "Checking webserver availability by a wget -O - http://127.0.0.1"
@ -434,7 +429,7 @@ script:
- | - |
echo "Unit testing" echo "Unit testing"
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file. # 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 phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
phpunitresult=$? phpunitresult=$?
echo "Phpunit return code = $phpunitresult" echo "Phpunit return code = $phpunitresult"

View File

@ -281,7 +281,7 @@ class UserTest extends PHPUnit\Framework\TestCase
print __METHOD__." id=". $localobject->id ."\n"; print __METHOD__." id=". $localobject->id ."\n";
//$this->assertNotEquals($user->date_creation, ''); //$this->assertNotEquals($user->date_creation, '');
$user->addrights(0, 'supplier_proposal'); $localobject->addrights(0, 'supplier_proposal');
$this->assertEquals($localobject->hasRight('member', ''), 0); $this->assertEquals($localobject->hasRight('member', ''), 0);
$this->assertEquals($localobject->hasRight('member', 'member'), 0);$this->assertEquals($localobject->hasRight('product', 'member', 'read'), 0); $this->assertEquals($localobject->hasRight('member', 'member'), 0);$this->assertEquals($localobject->hasRight('product', 'member', 'read'), 0);
$this->assertEquals($localobject->hasRight('member', 'member'), 0);$this->assertEquals($localobject->hasRight('produit', 'member', 'read'), 0); $this->assertEquals($localobject->hasRight('member', 'member'), 0);$this->assertEquals($localobject->hasRight('produit', 'member', 'read'), 0);