mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-22 10:36:12 +01:00
TASK: Keep language information for all TYPO3 Versions
Keep code consistent. Fetch language field for both TYPO3 versions. To make sure we do not mess up, add test case.
This commit is contained in:
parent
403fd47df0
commit
f3e8dacd4e
2 changed files with 36 additions and 1 deletions
|
@ -257,7 +257,6 @@ class TcaTableService76 implements TcaTableServiceInterface
|
||||||
$this->tca['ctrl']['cruser_id'],
|
$this->tca['ctrl']['cruser_id'],
|
||||||
$this->tca['ctrl']['fe_cruser_id'],
|
$this->tca['ctrl']['fe_cruser_id'],
|
||||||
$this->tca['ctrl']['fe_crgroup_id'],
|
$this->tca['ctrl']['fe_crgroup_id'],
|
||||||
$this->tca['ctrl']['languageField'],
|
|
||||||
$this->tca['ctrl']['origUid'],
|
$this->tca['ctrl']['origUid'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -77,4 +77,40 @@ class TcaIndexerTest extends AbstractFunctionalTestCase
|
||||||
|
|
||||||
$objectManager->get(TcaIndexer::class, $tableService, $connection)->indexAllDocuments();
|
$objectManager->get(TcaIndexer::class, $tableService, $connection)->indexAllDocuments();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function sysLanguageIsKept()
|
||||||
|
{
|
||||||
|
$this->importDataSet('Tests/Functional/Fixtures/Indexing/TcaIndexer/KeepSysLanguageUid.xml');
|
||||||
|
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class);
|
||||||
|
$tableName = 'tt_content';
|
||||||
|
$tableService = $objectManager->get(
|
||||||
|
TcaTableServiceInterface::class,
|
||||||
|
$tableName,
|
||||||
|
$objectManager->get(RelationResolver::class),
|
||||||
|
$objectManager->get(ConfigurationContainerInterface::class)
|
||||||
|
);
|
||||||
|
|
||||||
|
$connection = $this->getMockBuilder(Elasticsearch::class)
|
||||||
|
->setMethods(['addDocuments'])
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
|
$connection->expects($this->once())
|
||||||
|
->method('addDocuments')
|
||||||
|
->with(
|
||||||
|
$this->stringContains('tt_content'),
|
||||||
|
$this->callback(function ($documents) {
|
||||||
|
if ($this->isLegacyVersion()) {
|
||||||
|
return isset($documents[0]['sys_language_uid']) && $documents[0]['sys_language_uid'] === '2';
|
||||||
|
} else {
|
||||||
|
return isset($documents[0]['sys_language_uid']) && $documents[0]['sys_language_uid'] === 2;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
$objectManager->get(TcaIndexer::class, $tableService, $connection)->indexAllDocuments();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue