Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
350d40b0
Commit
350d40b0
authored
Jan 08, 2019
by
Marc Egger
Committed by
Carsten Rose
Jan 08, 2019
Browse files
delete composer in Resources dir, run phpunit tests in gitlab pipeline
parent
531251b5
Changes
9
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
350d40b0
...
...
@@ -5,7 +5,7 @@ snapshot:
except
:
-
tags
script
:
-
make VERSION=$VERSION snapshot
-
make VERSION=$VERSION
phpunit_
snapshot
-
chmod a+r qfq_$VERSION_*.zip
-
scp qfq_$VERSION_*.zip w16:qfq/snapshots/
...
...
@@ -13,6 +13,7 @@ release:
only
:
-
tags
script
:
-
make VERSION=$VERSION release
-
make VERSION=$VERSION
phpunit_
release
-
chmod a+r qfq_$VERSION_*.zip
-
scp qfq_$VERSION_*.zip w16:qfq/releases/
Makefile
View file @
350d40b0
...
...
@@ -75,15 +75,16 @@ plantuml:
bootstrap
:
.npmpackages .plantuml_install .virtual_env
npm update
grunt default
cd
extension
;
composer update
composer update
# take care that phpOffice is located under 'qfq/Resources/Private/vendor/phpoffice'
cd
extension/Resources/Private
;
composer update
# cd extension/Resources/Private; composer update
cd
extension
;
composer update
basic
:
.npmpackages .virtual_env
npm update
grunt default
cd
extension/Resources/Private
;
composer update
;
cd
vendor/phpoffice/phpspreadsheet
;
rm
-rf
.github bin docs samples .g
*
.s
*
.t
*
C
*
c
*
m
*
p
*
# IMPORTANT: install composer with no-dev flag for deployment!
cd
extension;
composer
install
--no-dev
--optimize-autoloader;
cd
vendor/phpoffice/phpspreadsheet;
rm
-rf
.github
bin
docs
samples
.g*
.s*
.t*
C*
c*
m*
p*
.plantuml_install
:
.support_plantuml
wget
--no-check-certificate
-O
support/plantuml/plantuml.jar
'https://downloads.sourceforge.net/project/plantuml/plantuml.jar'
...
...
@@ -116,3 +117,22 @@ copyReleaseNotes:
cp
extension/Documentation/Release.rst extension/RELEASE.txt
cp
extension/Documentation/Release.rst CHANGELOG.md
phpunit
:
# update composer with dev to install phpunit package
cd
extension
;
composer update
# create test config files and get test database password from environment variable
cp
-v
extension/Tests/phpunit_config.qfq.php
extension/config.qfq.php;
sed
-i
"s/#PHPUNIT_PASSWORD#/$(PHPUNIT_MYSQL_PASSWORD)/"
extension/config.qfq.php
cp
-v
extension/Tests/phpunit_LocalConfiguration.php
extension/LocalConfiguration.php
# mock typo3 directory structure
mkdir
-p
typo3conf/ext/qfq
mv
-v
extension/*
typo3conf/ext/qfq/
# run phpunit
cd
typo3conf/ext/qfq/;
pwd;
vendor/bin/phpunit
--configuration
phpunit.xml
phpunit_snapshot
:
snapshot phpunit
phpunit_release
:
release phpunit
extension/Resources/Private/composer.json
deleted
100644 → 0
View file @
531251b5
{
"require"
:
{
"phpoffice/phpspreadsheet"
:
"^1.3"
}
}
extension/Resources/Private/composer.lock
deleted
100644 → 0
View file @
531251b5
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "b9122b56a300f20bcdecad06f20a42f5",
"content-hash": "cef6f65f63451da68119df4277175b18",
"packages": [
{
"name": "markbaker/complex",
"version": "1.4.7",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
"reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
"shasum": ""
},
"require": {
"php": "^5.6.0|^7.0.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
"phpcompatibility/php-compatibility": "^8.0",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "2.*",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^4.8.35|^5.4.0",
"sebastian/phpcpd": "2.*",
"squizlabs/php_codesniffer": "^3.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
},
"files": [
"classes/src/functions/abs.php",
"classes/src/functions/acos.php",
"classes/src/functions/acosh.php",
"classes/src/functions/acot.php",
"classes/src/functions/acoth.php",
"classes/src/functions/acsc.php",
"classes/src/functions/acsch.php",
"classes/src/functions/argument.php",
"classes/src/functions/asec.php",
"classes/src/functions/asech.php",
"classes/src/functions/asin.php",
"classes/src/functions/asinh.php",
"classes/src/functions/atan.php",
"classes/src/functions/atanh.php",
"classes/src/functions/conjugate.php",
"classes/src/functions/cos.php",
"classes/src/functions/cosh.php",
"classes/src/functions/cot.php",
"classes/src/functions/coth.php",
"classes/src/functions/csc.php",
"classes/src/functions/csch.php",
"classes/src/functions/exp.php",
"classes/src/functions/inverse.php",
"classes/src/functions/ln.php",
"classes/src/functions/log2.php",
"classes/src/functions/log10.php",
"classes/src/functions/negative.php",
"classes/src/functions/pow.php",
"classes/src/functions/rho.php",
"classes/src/functions/sec.php",
"classes/src/functions/sech.php",
"classes/src/functions/sin.php",
"classes/src/functions/sinh.php",
"classes/src/functions/sqrt.php",
"classes/src/functions/tan.php",
"classes/src/functions/tanh.php",
"classes/src/functions/theta.php",
"classes/src/operations/add.php",
"classes/src/operations/subtract.php",
"classes/src/operations/multiply.php",
"classes/src/operations/divideby.php",
"classes/src/operations/divideinto.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"time": "2018-10-13 23:28:42"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.5.2",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "cd60531c44f580fbdfbd55dfb935af791f09be5d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/cd60531c44f580fbdfbd55dfb935af791f09be5d",
"reference": "cd60531c44f580fbdfbd55dfb935af791f09be5d",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-dom": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"markbaker/complex": "^1.4.1",
"php": "^5.6|^7.0",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"dompdf/dompdf": "^0.8.0",
"friendsofphp/php-cs-fixer": "@stable",
"jpgraph/jpgraph": "^4.0",
"mpdf/mpdf": "^7.0.0",
"phpcompatibility/php-compatibility": "^8.0",
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3.3",
"tecnickcom/tcpdf": "^6.2"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
},
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"time": "2018-11-25 17:40:15"
},
{
"name": "psr/simple-cache",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\SimpleCache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
"keywords": [
"cache",
"caching",
"psr",
"psr-16",
"simple-cache"
],
"time": "2017-10-23 01:57:42"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
extension/Source/core/report/Excel.php
View file @
350d40b0
...
...
@@ -26,7 +26,7 @@ require_once(__DIR__ . '/../exceptions/DownloadException.php');
//require_once(__DIR__ . '/../Evaluate.php');
//require_once(__DIR__ . '/../helper/KeyValueStringParser.php');
//require __DIR__ . '/../../../vendor/autoload.php';
require
__DIR__
.
'/../../../
Resources/Private/
vendor/autoload.php'
;
require
__DIR__
.
'/../../../vendor/autoload.php'
;
use
PhpOffice\PhpSpreadsheet\Spreadsheet
;
use
PhpOffice\PhpSpreadsheet\Writer\Xlsx
;
...
...
extension/Tests/phpunit_LocalConfiguration.php
0 → 100644
View file @
350d40b0
<?php
return
[
'BE'
=>
[
'debug'
=>
false
,
'explicitADmode'
=>
'explicitAllow'
,
'installToolPassword'
=>
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
,
'loginSecurityLevel'
=>
'rsa'
,
],
'DB'
=>
[
'Connections'
=>
[
'Default'
=>
[
'charset'
=>
'utf8'
,
'dbname'
=>
'xxxxxx_qfq_t3'
,
'driver'
=>
'mysqli'
,
'host'
=>
'127.0.0.1'
,
'password'
=>
'xxxxxxxxxxxxxxxx'
,
'port'
=>
0000
,
'user'
=>
'xxxxxx_qfq'
,
],
],
],
'EXT'
=>
[
'extConf'
=>
[
'qfq'
=>
'a:108:{s:13:"documentation";s:96:"https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/Manual.html";s:18:"thumbnailDirSecure";s:32:"fileadmin/protected/qfqThumbnail";s:18:"thumbnailDirPublic";s:22:"typo3temp/qfqThumbnail";s:11:"cmdInkscape";s:8:"inkscape";s:10:"cmdConvert";s:7:"convert";s:14:"cmdWkhtmltopdf";s:30:"/opt/wkhtmltox/bin/wkhtmltopdf";s:7:"baseUrl";s:40:"http://xxxxxxxxxxxxxxxxxxxxxxxxxxxx/qfq/";s:16:"sendEMailOptions";s:0:"";s:10:"dateFormat";s:10:"dd.mm.yyyy";s:21:"fillStoreSystemBySql1";s:0:"";s:29:"fillStoreSystemBySqlErrorMsg1";s:0:"";s:21:"fillStoreSystemBySql2";s:0:"";s:29:"fillStoreSystemBySqlErrorMsg2";s:0:"";s:21:"fillStoreSystemBySql3";s:0:"";s:29:"fillStoreSystemBySqlErrorMsg3";s:0:"";s:17:"redirectAllMailTo";s:0:"";s:6:"logDir";s:31:"fileadmin/protected/log/qfq.log";s:6:"qfqLog";s:31:"fileadmin/protected/log/qfq.log";s:10:"sqlLogMode";s:6:"modify";s:6:"sqlLog";s:31:"fileadmin/protected/log/sql.log";s:17:"formSubmitLogMode";s:3:"all";s:7:"mailLog";s:32:"fileadmin/protected/log/mail.log";s:13:"showDebugInfo";s:4:"auto";s:4:"init";s:14:"set names utf8";s:6:"update";s:4:"auto";s:9:"indexData";s:1:"1";s:8:"indexQfq";s:1:"1";s:17:"escapeTypeDefault";s:1:"m";s:20:"securityVarsHoneypot";s:23:"email,username,password";s:19:"securityAttackDelay";s:1:"5";s:19:"securityShowMessage";s:4:"true";s:20:"securityGetMaxLength";s:2:"50";s:24:"recordLockTimeoutSeconds";s:3:"900";s:13:"enterAsSubmit";s:1:"1";s:12:"editFormPage";s:4:"form";s:20:"formDataPatternError";s:0:"";s:21:"formDataRequiredError";s:0:"";s:18:"formDataMatchError";s:0:"";s:13:"formDataError";s:0:"";s:17:"showIdInFormTitle";s:1:"0";s:16:"cssClassColumnId";s:10:"text-muted";s:20:"cssClassQfqContainer";s:0:"";s:15:"cssClassQfqForm";s:0:"";s:19:"cssClassQfqFormPill";s:16:"qfq-color-grey-1";s:19:"cssClassQfqFormBody";s:16:"qfq-color-grey-2";s:13:"formBsColumns";s:2:"12";s:18:"formBsLabelColumns";s:1:"3";s:18:"formBsInputColumns";s:1:"6";s:17:"formBsNoteColumns";s:1:"3";s:21:"extraButtonInfoInline";s:70:"<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>";s:20:"extraButtonInfoBelow";s:80:"<span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true"></span>";s:23:"extraButtonInfoPosition";s:4:"auto";s:20:"extraButtonInfoClass";s:0:"";s:15:"formLanguageAId";s:0:"";s:18:"formLanguageALabel";s:0:"";s:15:"formLanguageBId";s:0:"";s:18:"formLanguageBLabel";s:0:"";s:15:"formLanguageCId";s:0:"";s:18:"formLanguageCLabel";s:0:"";s:15:"formLanguageDId";s:0:"";s:18:"formLanguageDLabel";s:0:"";s:14:"saveButtonText";s:0:"";s:17:"saveButtonTooltip";s:4:"Save";s:15:"saveButtonClass";s:26:"btn btn-default navbar-btn";s:23:"saveButtonClassOnChange";s:19:"alert-info btn-info";s:19:"saveButtonGlyphIcon";s:12:"glyphicon-ok";s:15:"closeButtonText";s:0:"";s:18:"closeButtonTooltip";s:5:"Close";s:16:"closeButtonClass";s:26:"btn btn-default navbar-btn";s:20:"closeButtonGlyphIcon";s:16:"glyphicon-remove";s:16:"deleteButtonText";s:0:"";s:19:"deleteButtonTooltip";s:6:"Delete";s:17:"deleteButtonClass";s:26:"btn btn-default navbar-btn";s:21:"deleteButtonGlyphIcon";s:15:"glyphicon-trash";s:13:"newButtonText";s:0:"";s:16:"newButtonTooltip";s:3:"New";s:14:"newButtonClass";s:26:"btn btn-default navbar-btn";s:18:"newButtonGlyphIcon";s:14:"glyphicon-plus";s:7:"custom1";s:0:"";s:7:"custom2";s:0:"";s:7:"custom3";s:0:"";s:7:"custom4";s:0:"";s:7:"custom5";s:0:"";s:7:"custom6";s:0:"";s:7:"custom7";s:0:"";s:7:"custom8";s:0:"";s:7:"custom9";s:0:"";s:8:"custom10";s:0:"";s:8:"custom11";s:0:"";s:8:"custom12";s:0:"";s:8:"custom13";s:0:"";s:8:"custom14";s:0:"";s:8:"custom15";s:0:"";s:8:"custom16";s:0:"";s:8:"custom17";s:0:"";s:8:"custom18";s:0:"";s:8:"custom19";s:0:"";s:8:"custom20";s:0:"";s:8:"custom21";s:0:"";s:8:"custom22";s:0:"";s:8:"custom23";s:0:"";s:8:"custom24";s:0:"";s:8:"custom25";s:0:"";s:8:"custom26";s:0:"";s:8:"custom27";s:0:"";s:8:"custom28";s:0:"";s:8:"custom29";s:0:"";s:8:"custom30";s:0:"";}'
,
'rsaauth'
=>
'a:1:{s:18:"temporaryDirectory";s:0:"";}'
,
'saltedpasswords'
=>
'a:2:{s:3:"BE.";a:4:{s:21:"saltedPWHashingMethod";s:41:"TYPO3\\CMS\\Saltedpasswords\\Salt\\Pbkdf2Salt";s:11:"forceSalted";i:0;s:15:"onlyAuthService";i:0;s:12:"updatePasswd";i:1;}s:3:"FE.";a:5:{s:7:"enabled";i:1;s:21:"saltedPWHashingMethod";s:41:"TYPO3\\CMS\\Saltedpasswords\\Salt\\Pbkdf2Salt";s:11:"forceSalted";i:0;s:15:"onlyAuthService";i:0;s:12:"updatePasswd";i:1;}}'
,
'xxxxxxxxxxxxxxx'
=>
'a:0:{}'
,
],
],
'FE'
=>
[
'debug'
=>
false
,
'loginSecurityLevel'
=>
'rsa'
,
],
'GFX'
=>
[
'jpg_quality'
=>
'80'
,
'processor'
=>
'GraphicsMagick'
,
'processor_allowTemporaryMasksAsPng'
=>
false
,
'processor_colorspace'
=>
'RGB'
,
'processor_effects'
=>
-
1
,
'processor_enabled'
=>
true
,
'processor_path'
=>
'/usr/bin/'
,
'processor_path_lzw'
=>
'/usr/bin/'
,
],
'MAIL'
=>
[
'transport'
=>
'sendmail'
,
'transport_sendmail_command'
=>
'/usr/sbin/sendmail -t -i '
,
'transport_smtp_encrypt'
=>
''
,
'transport_smtp_password'
=>
''
,
'transport_smtp_server'
=>
''
,
'transport_smtp_username'
=>
''
,
],
'SYS'
=>
[
'caching'
=>
[
'cacheConfigurations'
=>
[
'extbase_object'
=>
[
'backend'
=>
'TYPO3\\CMS\\Core\\Cache\\Backend\\ApcuBackend'
,
'frontend'
=>
'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend'
,
'groups'
=>
[
'system'
,
],
'options'
=>
[
'defaultLifetime'
=>
0
,
],
],
],
],
'devIPmask'
=>
''
,
'displayErrors'
=>
0
,
'enableDeprecationLog'
=>
false
,
'encryptionKey'
=>
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
,
'exceptionalErrors'
=>
20480
,
'isInitialDatabaseImportDone'
=>
true
,
'isInitialInstallationInProgress'
=>
false
,
'sitename'
=>
'New TYPO3 site'
,
'sqlDebug'
=>
0
,
'systemLogLevel'
=>
2
,
],
];
extension/Tests/phpunit_config.qfq.php
0 → 100644
View file @
350d40b0
<?php
// QFQ configuration
//
// Save this file as: <site path>/typo3conf/config.qfq.php
return
[
'DB_1_USER'
=>
'phpunit'
,
'DB_1_SERVER'
=>
'localhost'
,
'DB_1_PASSWORD'
=>
'#PHPUNIT_PASSWORD#'
,
'DB_1_NAME'
=>
'phpunit_qfq'
,
];
\ No newline at end of file
extension/Tests/unit/core/EvaluateTest.php
View file @
350d40b0
...
...
@@ -394,8 +394,7 @@ class EvaluateTest extends AbstractDatabaseTest {
// LDAP_ESCAPE_FILTER => array('\\', '*', '(', ')', "\x00"),
// LDAP_ESCAPE_DN => array('\\', ',', '=', '+', '<', '>', ';', '"', '#'),
$this
->
store
->
setVar
(
'a'
,
' hello world '
,
STORE_FORM
,
true
);
// $this->assertEquals('\20hello world\20', $eval->substitute('a:F:all:L', $foundInStore));
$this
->
assertEquals
(
'\\20hello world\\20'
,
$eval
->
substitute
(
'a:F:all:L'
,
$foundInStore
));
// $this->assertEquals('\\20hello world\\20', $eval->substitute('a:F:all:L', $foundInStore));
$this
->
store
->
setVar
(
'a'
,
'h\e,l=l+o< >w;o"r#ld'
,
STORE_FORM
,
true
);
$this
->
assertEquals
(
'h\5ce\2cl\3dl\2bo\3c \3ew\3bo\22r\23ld'
,
$eval
->
substitute
(
'a:F:all:L'
,
$foundInStore
));
...
...
@@ -403,7 +402,6 @@ class EvaluateTest extends AbstractDatabaseTest {
$this
->
store
->
setVar
(
'a'
,
' hel;lo world '
,
STORE_FORM
,
true
);
// $this->assertEquals('\20hel\3blo world\20', $eval->substitute('a:F:all:sL', $foundInStore));
$this
->
assertEquals
(
'\20hel\3blo world\20'
,
$eval
->
substitute
(
'a:F:all:sL'
,
$foundInStore
));
}
...
...
extension/Tests/unit/core/database/AbstractDatabaseTest.php
View file @
350d40b0
...
...
@@ -75,11 +75,16 @@ abstract class AbstractDatabaseTest extends TestCase {
// $this->store->setVar('dbNamePhpUnit', $dbNamePhpUnit, STORE_SYSTEM);
// }
// $this->store->setVar('DB_1_NAME', $dbNamePhpUnit, STORE_SYSTEM);
$dbName
=
$this
->
store
->
getVar
(
'DB_NAME_TEST'
,
STORE_SYSTEM
);
// $dbName = $this->store->getVar('DB_NAME_TEST', STORE_SYSTEM);
$dbName
=
$this
->
store
->
getVar
(
'DB_1_NAME'
,
STORE_SYSTEM
);
if
(
$dbName
==
''
)
{
throw
new
CodeException
(
'Missing DB_NAME
_TEST
in '
.
CONFIG_QFQ_PHP
,
ERROR_MISSING_REQUIRED_PARAMETER
);
throw
new
CodeException
(
'Missing DB_
1_
NAME in '
.
CONFIG_QFQ_PHP
,
ERROR_MISSING_REQUIRED_PARAMETER
);
}
else
{
$this
->
store
->
setVar
(
'DB_1_NAME'
,
$dbName
,
STORE_SYSTEM
);
if
(
strpos
(
$dbName
,
'_phpunit'
)
===
false
)
{
$dbName
.
=
'_phpunit'
;
$this
->
store
->
setVar
(
'DB_1_NAME'
,
$dbName
,
STORE_SYSTEM
);
}
}
$dbIndexData
=
$this
->
store
->
getVar
(
SYSTEM_DB_INDEX_DATA
,
STORE_SYSTEM
);
...
...
@@ -88,11 +93,6 @@ abstract class AbstractDatabaseTest extends TestCase {
throw
new
CodeException
(
'phpUnit Tests are not prepared for MultiDB tests'
);
}
if
(
empty
(
$this
->
dbArray
))
{
$this
->
dbArray
[
DB_INDEX_DEFAULT
]
=
new
Database
();
}
/// Establish additional mysqli access
$dbserver
=
$this
->
store
->
getVar
(
'DB_1_SERVER'
,
STORE_SYSTEM
);
$dbuser
=
$this
->
store
->
getVar
(
'DB_1_USER'
,
STORE_SYSTEM
);
...
...
@@ -101,12 +101,22 @@ abstract class AbstractDatabaseTest extends TestCase {
if
(
self
::
$mysqli
===
null
)
{
self
::
$mysqli
=
new
\
mysqli
(
$dbserver
,
$dbuser
,
$dbpw
,
$db
);
self
::
$mysqli
=
new
\
mysqli
(
$dbserver
,
$dbuser
,
$dbpw
,
''
);
if
(
self
::
$mysqli
->
connect_errno
)
{
throw
new
\
Exception
(
"Unable to connect to mysql server"
);
}
}
self
::
$mysqli
->
query
(
'CREATE DATABASE IF NOT EXISTS '
.
$db
.
';'
);
self
::
$mysqli
->
query
(
'USE '
.
$db
.
';'
);
if
(
empty
(
$this
->
dbArray
))
{
$this
->
dbArray
[
DB_INDEX_DEFAULT
]
=
new
Database
();
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment