AnsweredAssumed Answered

PHPUNIT throwing error while running {old} test in SugarCRM v9

Question asked by Sathish Kumar Ganesan on Jul 9, 2019
Latest reply on Jul 10, 2019 by Sathish Kumar Ganesan

Recently we have upgraded to the SugarCRM v9 with PHP v7.1.

I have downloaded the unittest from below github repo and followed the instruction to configure the phpunit to run the test.

While running the test under {sugar_root_folder}/tests/{old} folder. System is throwing MySQL expection.

 

Run Command:

../../vendor/bin/phpunit clients/base/api/CurrentUserApiTest.php

 

Result:

<PHPUnit 7.5.1 by Sebastian Bergmann and contributors.

.E 2 / 2 (100%)

Time: 3.84 minutes, Memory: 128.00 MB

There was 1 error:

1) CurrentUserApiTest::testShowFirstLoginWizard
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT value FROM key_value_cache WHERE id = ? AND (date_expires IS NULL OR date_expires > ?)' with params ["5e1c5a89429f06bb80237e7b344ba679", "2019-07-09 12:28:49"]:

 

D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php:106
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php:169
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php:145
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\vendor\doctrine\dbal\lib\Doctrine\DBAL\Statement.php:162
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\vendor\doctrine\dbal\lib\Doctrine\DBAL\Portability\Statement.php:97
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheDb.php:291
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheDb.php:150
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheAbstract.php:107
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\src\Cache\Backend\BackwardCompatible.php:53
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\src\Cache\Middleware\DefaultTTL.php:47
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\src\Cache\Middleware\Replicate.php:66
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCachePsr.php:88
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheAbstract.php:107
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheAbstract.php:94
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\UserPreferences\UserPreference.php:259
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\UserPreferences\UserPreference.php:70
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Users\User.php:435
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\Localization\Localization.php:141
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\Localization\Localization.php:629
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\Localization\Localization.php:820
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarObjects\templates\person\Person.php:239
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarObjects\templates\person\Person.php:48
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Users\User.php:1429
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\OutboundEmail\OutboundEmail.php:655
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\OutboundEmail\OutboundEmail.php:641
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\data\SugarBean.php:658
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\OutboundEmail\OutboundEmail.php:103
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Administration\Administration.php:117
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Administration\Administration.php:385
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Users\User.php:597
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\tests\{old}\SugarTestUserUtilities.php:56
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\tests\{old}\SugarTestHelper.php:435
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\tests\{old}\SugarTestHelper.php:366
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\tests\{old}\clients\base\api\CurrentUserApiTest.php:24

Caused by
Doctrine\DBAL\Driver\Mysqli\MysqliException:

D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\Mysqli\MysqliStatement.php:145
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\vendor\doctrine\dbal\lib\Doctrine\DBAL\Statement.php:153
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\vendor\doctrine\dbal\lib\Doctrine\DBAL\Portability\Statement.php:97
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheDb.php:291
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheDb.php:150
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheAbstract.php:107
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\src\Cache\Backend\BackwardCompatible.php:53
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\src\Cache\Middleware\DefaultTTL.php:47
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\src\Cache\Middleware\Replicate.php:66
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCachePsr.php:88
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheAbstract.php:107
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarCache\SugarCacheAbstract.php:94
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\UserPreferences\UserPreference.php:259
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\UserPreferences\UserPreference.php:70
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Users\User.php:435
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\Localization\Localization.php:141
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\Localization\Localization.php:629
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\Localization\Localization.php:820
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarObjects\templates\person\Person.php:239
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\SugarObjects\templates\person\Person.php:48
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Users\User.php:1429
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\OutboundEmail\OutboundEmail.php:655
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\OutboundEmail\OutboundEmail.php:641
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\data\SugarBean.php:658
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\include\OutboundEmail\OutboundEmail.php:103
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Administration\Administration.php:117
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Administration\Administration.php:385
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\modules\Users\User.php:597
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\tests\{old}\SugarTestUserUtilities.php:56
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\tests\{old}\SugarTestHelper.php:435
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\tests\{old}\SugarTestHelper.php:366
D:\xampp_php7\htdocs\git-repo\gcm\Application\SugarCRM\tests\{old}\clients\base\api\CurrentUserApiTest.php:24

ERRORS!
Tests: 2, Assertions: 3, Errors: 1.

>

 

Attached the PHP error log as well

Attachments

Outcomes