Skip to content

Commit

Permalink
[TASK] Migrate IndexQueue + Garbage Collector Fixtures to CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
bmack authored and dkd-kaehm committed May 15, 2023
1 parent b90eee7 commit a90a453
Show file tree
Hide file tree
Showing 133 changed files with 1,445 additions and 3,422 deletions.
25 changes: 0 additions & 25 deletions Tests/Integration/Domain/Index/IndexServiceTest.php
Expand Up @@ -16,18 +16,12 @@
namespace ApacheSolrForTypo3\Solr\Tests\Integration\Domain\Index;

use ApacheSolrForTypo3\Solr\Domain\Index\IndexService;
use ApacheSolrForTypo3\Solr\Domain\Site\Exception\UnexpectedTYPO3SiteInitializationException;
use ApacheSolrForTypo3\Solr\Domain\Site\SiteRepository;
use ApacheSolrForTypo3\Solr\IndexQueue\Queue;
use ApacheSolrForTypo3\Solr\System\Environment\CliEnvironment;
use ApacheSolrForTypo3\Solr\System\Environment\WebRootAllReadyDefinedException;
use ApacheSolrForTypo3\Solr\Tests\Integration\IntegrationTest;
use Doctrine\DBAL\ConnectionException;
use Doctrine\DBAL\Exception as DoctrineDBALException;
use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Exception as TestingFrameworkCoreException;

/**
* Testcase for the record indexer
Expand All @@ -49,10 +43,6 @@ class IndexServiceTest extends IntegrationTest

protected ?Queue $indexQueue = null;

/**
* @throws NoSuchCacheException
* @throws TestingFrameworkCoreException
*/
protected function setUp(): void
{
parent::setUp();
Expand All @@ -61,10 +51,6 @@ protected function setUp(): void
$this->indexQueue = GeneralUtility::makeInstance(Queue::class);
}

/**
* @throws DoctrineDBALException
* @throws UnexpectedTYPO3SiteInitializationException
*/
protected function addToIndexQueue(string $table, int $uid): void
{
// write an index queue item
Expand All @@ -83,17 +69,6 @@ public function canResolveBaseAsPrefixDataProvider(): array

/**
* @dataProvider canResolveBaseAsPrefixDataProvider
*
* @param string $absRefPrefix
* @param string $expectedUrl
*
*
* @throws ConnectionException
* @throws DoctrineDBALException
* @throws TestingFrameworkCoreException
* @throws UnexpectedTYPO3SiteInitializationException
* @throws WebRootAllReadyDefinedException
*
* @test
*/
public function canResolveBaseAsPrefix(string $absRefPrefix, string $expectedUrl)
Expand Down
@@ -1,14 +1,14 @@
"pages",
,"uid","pid","is_siteroot","doktype","slug","title","fe_group","module"
,2,1,0,1,"/public","Public page",0,""
,2,1,0,1,"/public","Public page",,""
,3,1,0,1,"/restricted","Private page",1,""
,4,1,0,254,"/folder","FE Users",0,"fe_users"
,4,1,0,254,"/folder","FE Users",,"fe_users"
"tt_content",
,"uid","pid","colPos","CType","bodytext"
,1,3,0,"text","Top secret content"
"fe_groups",
,"uid","pid","title"
,1,4,"Secret"
"fe_users",
,"uid","pid","username","usergroup"
,1,4,"test",1
,"uid","pid","username","password","usergroup"
,1,4,"test","blablabla","1"
Expand Up @@ -15,7 +15,6 @@

namespace ApacheSolrForTypo3\Solr\Tests\Integration\Domain\Search\ResultSet;

use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\InvalidFacetPackageException;
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionBased\Options\Option;
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionBased\Options\OptionsFacet;
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\ResultSetReconstitutionProcessor;
Expand All @@ -25,21 +24,11 @@
use ApacheSolrForTypo3\Solr\System\Solr\ResponseAdapter;
use ApacheSolrForTypo3\Solr\Tests\Integration\IntegrationTest;
use PHPUnit\Framework\MockObject\MockObject;
use TYPO3\CMS\Core\Error\Http\InternalServerErrorException;
use TYPO3\CMS\Core\Error\Http\ServiceUnavailableException;
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\TestingFramework\Core\Exception as TestingFrameworkCoreException;

class ResultSetReconstitutionProcessorTest extends IntegrationTest
{
/**
* @test
*
* @throws InternalServerErrorException
* @throws ServiceUnavailableException
* @throws SiteNotFoundException
* @throws TestingFrameworkCoreException
* @throws InvalidFacetPackageException
*/
public function canApplyRenderingInstructionsOnOptions()
{
Expand Down Expand Up @@ -90,12 +79,6 @@ public function canApplyRenderingInstructionsOnOptions()

/**
* @test
*
* @throws InternalServerErrorException
* @throws InvalidFacetPackageException
* @throws ServiceUnavailableException
* @throws SiteNotFoundException
* @throws TestingFrameworkCoreException
*/
public function labelCanBeUsedAsCObject()
{
Expand Down Expand Up @@ -129,10 +112,6 @@ public function labelCanBeUsedAsCObject()
self::assertSame('MY TYPE WITH SPECIAL RENDERING', $facet->getLabel(), 'Rendering instructions have not been applied on the facet options');
}

/**
* @param string $fixtureFile
* @return SearchResultSet
*/
protected function initializeSearchResultSetFromFakeResponse(string $fixtureFile): SearchResultSet
{
$searchRequestMock = $this->createMock(SearchRequest::class);
Expand All @@ -147,22 +126,13 @@ protected function initializeSearchResultSetFromFakeResponse(string $fixtureFile
return $searchResultSet;
}

/**
* @param array $facetConfiguration
* @return array
*/
protected function getConfigurationArrayFromFacetConfigurationArray(array $facetConfiguration): array
{
$configuration = [];
$configuration['plugin.']['tx_solr.']['search.']['faceting.'] = $facetConfiguration;
return $configuration;
}

/**
* @param array $configuration
* @param SearchResultSet $searchResultSet
* @return ResultSetReconstitutionProcessor
*/
protected function getConfiguredReconstitutionProcessor(array $configuration, SearchResultSet $searchResultSet): ResultSetReconstitutionProcessor
{
$typoScriptConfiguration = new TypoScriptConfiguration($configuration);
Expand Down

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions Tests/Integration/Fixtures/can_delete_custom_record.xml

This file was deleted.

53 changes: 0 additions & 53 deletions Tests/Integration/Fixtures/can_handle_missing_page_on_deletion.xml

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions Tests/Integration/Fixtures/can_remove_content_element.xml

This file was deleted.

11 changes: 11 additions & 0 deletions Tests/Integration/Fixtures/can_remove_page.csv
@@ -0,0 +1,11 @@
"pages",
,"uid","pid","is_siteroot","doktype","hidden","slug","title"
,2,1,0,1,0,"/test-childpage","Test Childpage"
"tt_content",
,"uid","pid","colPos","CType","bodytext"
,88,2,0,"text","will be removed!"
,99,1,0,"text","will stay!"
"tx_solr_indexqueue_item",
,"uid","root","item_type","item_uid","indexing_configuration","errors","indexed","changed"
,4711,1,"pages",1,"pages","",1,1449151778
,4712,1,"pages",2,"pages","",1,1449151778
54 changes: 0 additions & 54 deletions Tests/Integration/Fixtures/can_remove_page.xml

This file was deleted.

0 comments on commit a90a453

Please sign in to comment.