forked from TYPO3-Solr/ext-solr
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX:BP:11] set base uri to face frontend request
Fixes: TYPO3-Solr#2914 closes: TYPO3-Solr#2915 Backported from: TYPO3-Solr#2982
- Loading branch information
Showing
3 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...res/initialize_tsfe_with_no_default_page_and_page_error_handler_do_not_throw_an_error.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<dataset> | ||
<sys_template> | ||
<uid>1</uid> | ||
<pid>1</pid> | ||
<root>1</root> | ||
<clear>3</clear> | ||
<config> | ||
<![CDATA[ | ||
page = PAGE | ||
page.typeNum = 0 | ||
page.bodyTag = <body> | ||
config.index_enable = 1 | ||
plugin.tx_solr { | ||
enabled = 1 | ||
} | ||
]]> | ||
</config> | ||
<sorting>100</sorting> | ||
</sys_template> | ||
<pages> | ||
<uid>1</uid> | ||
<is_siteroot>1</is_siteroot> | ||
<doktype>1</doktype> | ||
<title>disabled for default language</title> | ||
<l18n_cfg>1</l18n_cfg> | ||
</pages> | ||
<pages> | ||
<uid>404</uid> | ||
<pid>1</pid> | ||
<title>error page, required for testing</title> | ||
</pages> | ||
</dataset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
namespace ApacheSolrForTypo3\Solr\Tests\Integration\FrontendEnvironment; | ||
|
||
|
||
use ApacheSolrForTypo3\Solr\FrontendEnvironment\Tsfe; | ||
use ApacheSolrForTypo3\Solr\Tests\Integration\IntegrationTest; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
class TsfeTest extends IntegrationTest | ||
{ | ||
|
||
/** | ||
* @test | ||
* @expectedException \RuntimeException | ||
*/ | ||
public function initializeTsfeWithNoDefaultPageAndPageErrorHandlerDoNotThrowAnError() | ||
{ | ||
$this->importDataSetFromFixture('initialize_tsfe_with_no_default_page_and_page_error_handler_do_not_throw_an_error.xml'); | ||
|
||
$defaultLanguage = $this->buildDefaultLanguageConfiguration('EN', '/en/'); | ||
$defaultLanguage['solr_core_read'] = 'core_en'; | ||
|
||
$this->writeSiteConfiguration( | ||
'integration_tree_one', | ||
$this->buildSiteConfiguration(1, 'http://testone.site/'), | ||
[ | ||
$defaultLanguage, | ||
], | ||
$this->buildErrorHandlingConfiguration('Page', [404]) | ||
); | ||
|
||
$scheme = 'http'; | ||
$host = 'localhost'; | ||
$port = 8999; | ||
$globalSolrSettings = [ | ||
'solr_scheme_read' => $scheme, | ||
'solr_host_read' => $host, | ||
'solr_port_read' => $port, | ||
'solr_timeout_read' => 20, | ||
'solr_path_read' => '/solr/', | ||
'solr_use_write_connection' => false, | ||
]; | ||
$this->mergeSiteConfiguration('integration_tree_one', $globalSolrSettings); | ||
clearstatcache(); | ||
usleep(500); | ||
$siteCreatedHash = md5($scheme . $host . $port . '0-PageErrorHandler'); | ||
self::$lastSiteCreated = $siteCreatedHash; | ||
|
||
$tsfe = GeneralUtility::makeInstance(Tsfe::class); | ||
$tsfe->initializeTsfe(1); | ||
|
||
} | ||
|
||
} |