Skip to content

Commit

Permalink
Add some test
Browse files Browse the repository at this point in the history
  • Loading branch information
Firesphere committed Jan 20, 2020
1 parent 71d298d commit 7eaa92d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
RESPONSE=$(echo $(curl -I http:https://localhost:8983/solr/CircleCITestIndex/admin/ping | head -n1 ) | grep -o '200 OK')
if [[ $RESPONSE != '200 OK' ]]; then echo "Solr Core - CircleCITestIndex is not created"; exit 1; fi
echo "CircleCITestIndex is successfully created"
- run: su solr vendor/bin/sake dev/tasks/SolrIndexTask unittest=true
- run: su solr vendor/bin/sake dev/tasks/SolrIndexTask
- run:
name: Check Solr has successfully indexed the default 3 pages
command: |
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/FluentSiteStateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,19 @@ public function testUpdateQuery()
FluentState::singleton()->setLocale('');
$query->addTerm('Test');
$terms = $query->getTerms();
$query->addFilter('TestField', 'Value');
$state = new FluentSiteState();
$this->assertNull($state->updateQuery($query));

$this->assertEquals($terms, $query->getTerms());

FluentState::singleton()->setLocale('en_NZ');

// $query->addTerm('Test2', 'TestField');
$state->updateQuery($query);

$filters = $query->getFilter();

$this->assertArrayHasKey('TestField_en_NZ', $filters);
}
}

0 comments on commit 7eaa92d

Please sign in to comment.