Skip to content

Commit

Permalink
[TASK] Update nimut/testing-framework to 3.x
Browse files Browse the repository at this point in the history
This pr:

* Updates the testing framework to 3.x
* Fixes issues in the tests that are related to the update

Fixes: TYPO3-Solr#1823
  • Loading branch information
timohund committed Jan 31, 2018
1 parent 97e960c commit d42373b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
16 changes: 15 additions & 1 deletion Build/Test/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,21 @@ echo "Using package path $TYPO3_PATH_PACKAGES"
echo "Using web path $TYPO3_PATH_WEB"

# Install TYPO3 sources
composer require --dev typo3/cms="$TYPO3_VERSION"
if [[ $TYPO3_VERSION = *"9."* ]]; then
composer require --dev typo3/cms-backend="$TYPO3_VERSION"
composer require --dev typo3/cms-core="$TYPO3_VERSION"
composer require --dev typo3/cms-fluid="$TYPO3_VERSION"
composer require --dev typo3/cms-frontend="$TYPO3_VERSION"
composer require --dev typo3/cms-lang="$TYPO3_VERSION"
composer require --dev typo3/cms-extbase="$TYPO3_VERSION"
composer require --dev typo3/cms-install="$TYPO3_VERSION"
composer require --dev typo3/cms-extbase="$TYPO3_VERSION"
composer require --dev typo3/cms-reports="$TYPO3_VERSION"
composer require --dev typo3/cms-scheduler="$TYPO3_VERSION"
composer require --dev typo3/cms-tstemplate="$TYPO3_VERSION"
else
composer require --dev typo3/cms="$TYPO3_VERSION"
fi

# Restore composer.json
git checkout composer.json
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Search/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ public function useFiltersFromTypoScript(): QueryBuilder

$searchQueryFilters = $this->typoScriptConfiguration->getSearchQueryFilterConfiguration();

if (count($searchQueryFilters) <= 0) {
if (!is_array($searchQueryFilters) || count($searchQueryFilters) <= 0) {
return $this;
}

Expand Down Expand Up @@ -844,7 +844,7 @@ public function getAdditionalFilters() : array
}

$searchQueryFilters = $this->typoScriptConfiguration->getSearchQueryFilterConfiguration();
if (count($searchQueryFilters) <= 0) {
if (!is_array($searchQueryFilters) || count($searchQueryFilters) <= 0) {
return [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* The TYPO3 project - inspiring people to share!
*/

use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest;
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\FacetRegistry;
use ApacheSolrForTypo3\Solr\Domain\Search\ResultSet\Facets\OptionBased\Options\OptionsPackage;
use ApacheSolrForTypo3\Solr\Tests\Unit\Domain\Search\ResultSet\Facets\TestPackage\TestPackage;
use TYPO3\CMS\Core\Tests\UnitTestCase;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;

Expand All @@ -27,7 +27,7 @@
* @author Frans Saris <frans@beech.it>
* @author Timo Hund <timo.hund@dkd.de>
*/
class FacetRegistryTest extends UnitTestCase
class FacetRegistryTest extends UnitTest
{
/**
* @var ObjectManagerInterface
Expand Down
3 changes: 2 additions & 1 deletion Tests/Unit/Domain/Search/ResultSet/SearchResultSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ public function testAdditionalFiltersGetPassedToTheQuery()
$resultSet = $this->searchResultSetService->search($fakeRequest);

$this->assertSame($resultSet->getResponse(), $fakeResponse, 'Did not get the expected fakeResponse');
$this->assertSame(count($resultSet->getUsedQuery()->getFilters()), 1, 'There should be one registered filter in the query');

$this->assertSame(count($resultSet->getUsedQuery()->getFilters()->getValues()), 1, 'There should be one registered filter in the query');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"typo3/cms-core": "^8.7.0 || ^9.0"
},
"require-dev": {
"phpunit/phpunit": "^5.6",
"nimut/testing-framework": "^2.0"
"phpunit/phpunit": "^6.0",
"nimut/testing-framework": "^3.0"
},
"replace": {
"solr": "self.version",
Expand Down

0 comments on commit d42373b

Please sign in to comment.