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

View file

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

View file

@ -1,7 +1,7 @@
<phpunit <phpunit
backupGlobals="true" backupGlobals="true"
backupStaticAttributes="false" 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" colors="true"
convertErrorsToExceptions="false" convertErrorsToExceptions="false"