WIP|TASK: Use new TYPO3

Use testing framework configuration.
Use new db.
Begin with replacement of old TYPO3_DB.
This commit is contained in:
Daniel Siepmann 2017-07-04 10:12:47 +02:00
parent 9769ee1cb6
commit 9d20524706
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
3 changed files with 14 additions and 6 deletions

View file

@ -112,7 +112,7 @@ class TcaIndexer implements IndexerInterface
*/
protected function getRecords($offset, $limit)
{
$records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
$records = $this->getDatabaseConnection()->exec_SELECTgetRows(
$this->tcaTableService->getFields(),
$this->tcaTableService->getTableClause(),
$this->tcaTableService->getWhereClause(),
@ -139,7 +139,7 @@ class TcaIndexer implements IndexerInterface
*/
protected function getRecord($identifier)
{
$record = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
$record = $this->getDatabaseConnection()->exec_SELECTgetSingleRow(
$this->tcaTableService->getFields(),
$this->tcaTableService->getTableClause(),
$this->tcaTableService->getWhereClause()
@ -156,4 +156,10 @@ class TcaIndexer implements IndexerInterface
return $record;
}
protected function getDatabaseConnection()
{
return GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionByName('Default');
}
}

View file

@ -1,10 +1,11 @@
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(dir $(mkfile_path))
TYPO3_WEB_DIR := $(current_dir).Build/Web
TYPO3_WEB_DIR := $(current_dir).Build/web
TYPO3_PATH_ROOT := $(current_dir).Build/web
# Allow different versions on travis
TYPO3_VERSION ?= ~7.6
typo3DatabaseName ?= "searchcore_test"
TYPO3_VERSION ?= ~8.2
typo3DatabaseName ?= "searchcore_test2"
typo3DatabaseUsername ?= "dev"
typo3DatabasePassword ?= "dev"
typo3DatabaseHost ?= "127.0.0.1"
@ -21,6 +22,7 @@ functionalTests:
typo3DatabaseHost=$(typo3DatabaseHost) \
TYPO3_PATH_WEB=$(TYPO3_WEB_DIR) \
.Build/bin/phpunit --colors --debug -v \
--stop-on-error \
-c Tests/Functional/FunctionalTests.xml
uploadCodeCoverage: uploadCodeCoverageToScrutinizer uploadCodeCoverageToCodacy

View file

@ -1,7 +1,7 @@
<phpunit
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="../../.Build/vendor/typo3/cms/typo3/sysext/core/Build/FunctionalTestsBootstrap.php"
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
colors="true"
convertErrorsToExceptions="false"