summaryrefslogtreecommitdiffstats
path: root/tests/src/Unit/Plugin
diff options
context:
space:
mode:
authorborisson_2016-01-27 15:16:07 (GMT)
committerJoris Vercammen2016-01-27 15:16:07 (GMT)
commita7524691529b66f4aa66b6dd58c55653468343c9 (patch)
treea5563a07b9f273b79483a508808a0092553b7d1a /tests/src/Unit/Plugin
parent2921f6d682c6c55e55b128f834a3000639782a85 (diff)
Issue #2656748 by borisson_: Fix issues with documentation standards
Diffstat (limited to 'tests/src/Unit/Plugin')
-rw-r--r--tests/src/Unit/Plugin/Condition/OtherFacetTest.php1
-rw-r--r--tests/src/Unit/Plugin/processor/ActiveWidgetOrderProcessorTest.php4
-rw-r--r--tests/src/Unit/Plugin/processor/CountLimitProcessorTest.php10
-rw-r--r--tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php4
-rw-r--r--tests/src/Unit/Plugin/processor/DisplayValueWidgetOrderProcessorTest.php6
-rw-r--r--tests/src/Unit/Plugin/processor/ExcludeSpecifiedItemsProcessorTest.php8
-rw-r--r--tests/src/Unit/Plugin/processor/HideNonNarrowingResultProcessorTest.php5
-rw-r--r--tests/src/Unit/Plugin/processor/RawValueWidgetOrderProcessorTest.php4
-rw-r--r--tests/src/Unit/Plugin/processor/UidToUserNameCallbackProcessorTest.php3
-rw-r--r--tests/src/Unit/Plugin/processor/UrlProcessorHandlerTest.php4
-rw-r--r--tests/src/Unit/Plugin/query_type/SearchApiStringTest.php4
-rw-r--r--tests/src/Unit/Plugin/url_processor/QueryStringTest.php14
-rw-r--r--tests/src/Unit/Plugin/widget/CheckboxWidgetTest.php22
-rw-r--r--tests/src/Unit/Plugin/widget/LinksWidgetTest.php7
14 files changed, 47 insertions, 49 deletions
diff --git a/tests/src/Unit/Plugin/Condition/OtherFacetTest.php b/tests/src/Unit/Plugin/Condition/OtherFacetTest.php
index dc0860a..821f075 100644
--- a/tests/src/Unit/Plugin/Condition/OtherFacetTest.php
+++ b/tests/src/Unit/Plugin/Condition/OtherFacetTest.php
@@ -186,4 +186,5 @@ class OtherFacetTest extends UnitTestCase {
$evaluation = $sut->evaluate();
$this->assertFalse($evaluation);
}
+
}
diff --git a/tests/src/Unit/Plugin/processor/ActiveWidgetOrderProcessorTest.php b/tests/src/Unit/Plugin/processor/ActiveWidgetOrderProcessorTest.php
index 185c360..5eff654 100644
--- a/tests/src/Unit/Plugin/processor/ActiveWidgetOrderProcessorTest.php
+++ b/tests/src/Unit/Plugin/processor/ActiveWidgetOrderProcessorTest.php
@@ -57,7 +57,7 @@ class ActiveWidgetOrderProcessorTest extends UnitTestCase {
}
/**
- * Test sorting ascending.
+ * Tests sorting ascending.
*/
public function testAscending() {
$sorted_results = $this->processor->sortResults($this->originalResults, 'ASC');
@@ -68,7 +68,7 @@ class ActiveWidgetOrderProcessorTest extends UnitTestCase {
}
/**
- * Test sorting descending.
+ * Tests sorting descending.
*/
public function testDescending() {
$sorted_results = $this->processor->sortResults($this->originalResults, 'DESC');
diff --git a/tests/src/Unit/Plugin/processor/CountLimitProcessorTest.php b/tests/src/Unit/Plugin/processor/CountLimitProcessorTest.php
index 4db2c91..ed87d3d 100644
--- a/tests/src/Unit/Plugin/processor/CountLimitProcessorTest.php
+++ b/tests/src/Unit/Plugin/processor/CountLimitProcessorTest.php
@@ -73,7 +73,7 @@ class CountLimitProcessorTest extends UnitTestCase {
}
/**
- * Test no filtering happens.
+ * Tests no filtering happens.
*/
public function testNoFilter() {
$facet = new Facet([], 'facet');
@@ -94,7 +94,7 @@ class CountLimitProcessorTest extends UnitTestCase {
}
/**
- * Test no filtering happens.
+ * Tests no filtering happens.
*/
public function testMinEqualsValue() {
$facet = new Facet([], 'facet');
@@ -116,7 +116,7 @@ class CountLimitProcessorTest extends UnitTestCase {
}
/**
- * Test between minimum and maximum values.
+ * Tests between minimum and maximum values.
*/
public function testBetweenMinAndMaxValue() {
$facet = new Facet([], 'facet');
@@ -142,7 +142,7 @@ class CountLimitProcessorTest extends UnitTestCase {
}
/**
- * Test maximum values.
+ * Tests maximum values.
*/
public function testMaxValue() {
$facet = new Facet([], 'facet');
@@ -172,7 +172,7 @@ class CountLimitProcessorTest extends UnitTestCase {
}
/**
- * Test filtering of results.
+ * Tests filtering of results.
*/
public function testFilterResults() {
$facet = new Facet([], 'facet');
diff --git a/tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php b/tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php
index 1e86337..5c2346f 100644
--- a/tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php
+++ b/tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php
@@ -48,7 +48,7 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
}
/**
- * Test sorting ascending.
+ * Tests sorting ascending.
*/
public function testAscending() {
@@ -63,7 +63,7 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
}
/**
- * Test sorting descending.
+ * Tests sorting descending.
*/
public function testDescending() {
diff --git a/tests/src/Unit/Plugin/processor/DisplayValueWidgetOrderProcessorTest.php b/tests/src/Unit/Plugin/processor/DisplayValueWidgetOrderProcessorTest.php
index 606e52d..81ee397 100644
--- a/tests/src/Unit/Plugin/processor/DisplayValueWidgetOrderProcessorTest.php
+++ b/tests/src/Unit/Plugin/processor/DisplayValueWidgetOrderProcessorTest.php
@@ -52,7 +52,7 @@ class DisplayValueWidgetOrderProcessorTest extends UnitTestCase {
}
/**
- * Test sorting ascending.
+ * Tests sorting ascending.
*/
public function testAscending() {
$sorted_results = $this->processor->sortResults($this->originalResults, 'ASC');
@@ -71,7 +71,7 @@ class DisplayValueWidgetOrderProcessorTest extends UnitTestCase {
}
/**
- * Test sorting descending.
+ * Tests sorting descending.
*/
public function testDescending() {
$sorted_results = $this->processor->sortResults($this->originalResults, 'DESC');
@@ -90,7 +90,7 @@ class DisplayValueWidgetOrderProcessorTest extends UnitTestCase {
}
/**
- * Test that sorting uses the display value.
+ * Tests that sorting uses the display value.
*/
public function testUseActualDisplayValue() {
$original = [
diff --git a/tests/src/Unit/Plugin/processor/ExcludeSpecifiedItemsProcessorTest.php b/tests/src/Unit/Plugin/processor/ExcludeSpecifiedItemsProcessorTest.php
index 71870f9..ff33e6d 100644
--- a/tests/src/Unit/Plugin/processor/ExcludeSpecifiedItemsProcessorTest.php
+++ b/tests/src/Unit/Plugin/processor/ExcludeSpecifiedItemsProcessorTest.php
@@ -78,7 +78,7 @@ class ExcludeSpecifiedItemsProcessorTest extends UnitTestCase {
}
/**
- * Test no filtering happens.
+ * Tests no filtering happens.
*/
public function testNoFilter() {
$facet = new Facet([], 'facet');
@@ -101,7 +101,7 @@ class ExcludeSpecifiedItemsProcessorTest extends UnitTestCase {
}
/**
- * Test filtering happens for string filter.
+ * Tests filtering happens for string filter.
*/
public function testStringFilter() {
$facet = new Facet([], 'facet');
@@ -128,7 +128,7 @@ class ExcludeSpecifiedItemsProcessorTest extends UnitTestCase {
}
/**
- * Test filtering happens for regex filter.
+ * Tests filtering happens for regex filter.
*
* @dataProvider provideRegexTests
*/
@@ -157,7 +157,7 @@ class ExcludeSpecifiedItemsProcessorTest extends UnitTestCase {
}
/**
- * Provide multiple data sets for ::testRegexFilter.
+ * Provides multiple data sets for ::testRegexFilter.
*/
public function provideRegexTests() {
return [
diff --git a/tests/src/Unit/Plugin/processor/HideNonNarrowingResultProcessorTest.php b/tests/src/Unit/Plugin/processor/HideNonNarrowingResultProcessorTest.php
index f1bdba7..64be36f 100644
--- a/tests/src/Unit/Plugin/processor/HideNonNarrowingResultProcessorTest.php
+++ b/tests/src/Unit/Plugin/processor/HideNonNarrowingResultProcessorTest.php
@@ -48,9 +48,8 @@ class HideNonNarrowingResultProcessorTest extends UnitTestCase {
$this->processor = new HideNonNarrowingResultProcessor([], 'hide_non_narrowing_result_processor', []);
}
-
/**
- * Test filtering of results.
+ * Tests filtering of results.
*/
public function testNoFilterResults() {
@@ -70,7 +69,7 @@ class HideNonNarrowingResultProcessorTest extends UnitTestCase {
}
/**
- * Test filtering of results.
+ * Tests filtering of results.
*/
public function testFilterResults() {
diff --git a/tests/src/Unit/Plugin/processor/RawValueWidgetOrderProcessorTest.php b/tests/src/Unit/Plugin/processor/RawValueWidgetOrderProcessorTest.php
index c8bff42..5a61827 100644
--- a/tests/src/Unit/Plugin/processor/RawValueWidgetOrderProcessorTest.php
+++ b/tests/src/Unit/Plugin/processor/RawValueWidgetOrderProcessorTest.php
@@ -52,7 +52,7 @@ class RawValueWidgetOrderProcessorTest extends UnitTestCase {
}
/**
- * Test sorting ascending.
+ * Tests sorting ascending.
*/
public function testAscending() {
$sorted_results = $this->processor->sortResults($this->originalResults, 'ASC');
@@ -71,7 +71,7 @@ class RawValueWidgetOrderProcessorTest extends UnitTestCase {
}
/**
- * Test sorting descending.
+ * Tests sorting descending.
*/
public function testDescending() {
$sorted_results = $this->processor->sortResults($this->originalResults, 'DESC');
diff --git a/tests/src/Unit/Plugin/processor/UidToUserNameCallbackProcessorTest.php b/tests/src/Unit/Plugin/processor/UidToUserNameCallbackProcessorTest.php
index 14aca50..d5393c8 100644
--- a/tests/src/Unit/Plugin/processor/UidToUserNameCallbackProcessorTest.php
+++ b/tests/src/Unit/Plugin/processor/UidToUserNameCallbackProcessorTest.php
@@ -38,9 +38,8 @@ class UidToUserNameCallbackProcessorTest extends UnitTestCase {
$this->createMocks();
}
-
/**
- * Test that results were correctly changed.
+ * Tests that results were correctly changed.
*/
public function testResultsChanged() {
$original_results = [
diff --git a/tests/src/Unit/Plugin/processor/UrlProcessorHandlerTest.php b/tests/src/Unit/Plugin/processor/UrlProcessorHandlerTest.php
index c411be8..13cdc5b 100644
--- a/tests/src/Unit/Plugin/processor/UrlProcessorHandlerTest.php
+++ b/tests/src/Unit/Plugin/processor/UrlProcessorHandlerTest.php
@@ -36,7 +36,7 @@ class UrlProcessorHandlerTest extends UnitTestCase {
}
/**
- * Test that the build method is correctly called.
+ * Tests that the build method is correctly called.
*/
public function testBuild() {
$facet = new Facet(['id' => '_test'], 'facets_facet');
@@ -48,7 +48,7 @@ class UrlProcessorHandlerTest extends UnitTestCase {
}
/**
- * Helper function to create a correct container.
+ * Sets up a container.
*/
protected function createContainer() {
$url_processor = $this->getMockBuilder('\Drupal\facets\UrlProcessor\UrlProcessorInterface')
diff --git a/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php b/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php
index 58d5966..1005ecd 100644
--- a/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php
+++ b/tests/src/Unit/Plugin/query_type/SearchApiStringTest.php
@@ -20,7 +20,7 @@ use Drupal\Tests\UnitTestCase;
class SearchApiStringTest extends UnitTestCase {
/**
- * Test string query type without executing the query.
+ * Tests string query type without executing the query.
*/
public function testQueryType() {
$query = new SearchApiQuery([], 'search_api_query', []);
@@ -60,7 +60,7 @@ class SearchApiStringTest extends UnitTestCase {
}
/**
- * Test string query type without results.
+ * Tests string query type without results.
*/
public function testEmptyResults() {
$query = new SearchApiQuery([], 'search_api_query', []);
diff --git a/tests/src/Unit/Plugin/url_processor/QueryStringTest.php b/tests/src/Unit/Plugin/url_processor/QueryStringTest.php
index 7f30653..eabebc7 100644
--- a/tests/src/Unit/Plugin/url_processor/QueryStringTest.php
+++ b/tests/src/Unit/Plugin/url_processor/QueryStringTest.php
@@ -63,7 +63,7 @@ class QueryStringTest extends UnitTestCase {
}
/**
- * Basic test with one active item.
+ * Tests with one active item.
*/
public function testSetSingleActiveItem() {
$facet = new Facet([], 'facet');
@@ -81,7 +81,7 @@ class QueryStringTest extends UnitTestCase {
}
/**
- * Basic test with multiple active items.
+ * Tests with multiple active items.
*/
public function testSetMultipleActiveItems() {
$facet = new Facet([], 'facet');
@@ -99,7 +99,7 @@ class QueryStringTest extends UnitTestCase {
}
/**
- * Basic test with an empty build.
+ * Tests with an empty build.
*/
public function testEmptyBuild() {
$facet = new Facet([], 'facet');
@@ -115,7 +115,7 @@ class QueryStringTest extends UnitTestCase {
}
/**
- * Test with default build.
+ * Test swith default build.
*/
public function testBuild() {
$facet = new Facet([], 'facet');
@@ -137,7 +137,7 @@ class QueryStringTest extends UnitTestCase {
}
/**
- * Test with an active item already from url.
+ * Tests with an active item already from url.
*/
public function testBuildWithActiveItem() {
$facet = new Facet([], 'facet');
@@ -167,7 +167,7 @@ class QueryStringTest extends UnitTestCase {
}
/**
- * Test that the facet source configuration filter key override works.
+ * Tests that the facet source configuration filter key override works.
*/
public function testFacetSourceFilterKeyOverride() {
$facet_source = new FacetSource(['filter_key' => 'ab'], 'facets_facet_source');
@@ -208,7 +208,7 @@ class QueryStringTest extends UnitTestCase {
}
/**
- * Set the container for use in unit tests.
+ * Sets up a container.
*/
protected function setContainer() {
$router = $this->getMockBuilder('Drupal\Tests\Core\Routing\TestRouterInterface')
diff --git a/tests/src/Unit/Plugin/widget/CheckboxWidgetTest.php b/tests/src/Unit/Plugin/widget/CheckboxWidgetTest.php
index 187dddd..372f436 100644
--- a/tests/src/Unit/Plugin/widget/CheckboxWidgetTest.php
+++ b/tests/src/Unit/Plugin/widget/CheckboxWidgetTest.php
@@ -71,17 +71,17 @@ class CheckboxWidgetTest extends UnitTestCase {
}
/**
- * Test widget with default settings.
+ * Tests widget with default settings.
*/
public function testDefaultSettings() {
$facet = new Facet([], 'facet');
$facet->setResults($this->originalResults);
$facet->setFieldIdentifier('test_field');
- $formState = new FormState();
- $formState->addBuildInfo('args', [$facet]);
+ $form_state = new FormState();
+ $form_state->addBuildInfo('args', [$facet]);
$form = [];
- $built_form = $this->widget->buildForm($form, $formState);
+ $built_form = $this->widget->buildForm($form, $form_state);
$this->assertInternalType('array', $built_form);
$this->assertCount(4, $built_form['test_field']['#options']);
@@ -91,7 +91,7 @@ class CheckboxWidgetTest extends UnitTestCase {
'llama' => 'Llama',
'badger' => 'Badger',
'duck' => 'Duck',
- 'alpaca' => 'Alpaca'
+ 'alpaca' => 'Alpaca',
];
foreach ($expected_links as $index => $value) {
$this->assertEquals($value, $built_form['test_field']['#options'][$index]);
@@ -99,7 +99,7 @@ class CheckboxWidgetTest extends UnitTestCase {
}
/**
- * Test widget, make sure hiding and showing numbers works.
+ * Tests widget, make sure hiding and showing numbers works.
*/
public function testHideNumbers() {
$original_results = $this->originalResults;
@@ -110,10 +110,10 @@ class CheckboxWidgetTest extends UnitTestCase {
$facet->setFieldIdentifier('test__field');
$facet->setWidgetConfigs(['show_numbers' => 0]);
- $formState = new FormState();
- $formState->addBuildInfo('args', [$facet]);
+ $form_state = new FormState();
+ $form_state->addBuildInfo('args', [$facet]);
$form = [];
- $built_form = $this->widget->buildForm($form, $formState);
+ $built_form = $this->widget->buildForm($form, $form_state);
$this->assertInternalType('array', $built_form);
$this->assertCount(4, $built_form['test__field']['#options']);
@@ -121,7 +121,7 @@ class CheckboxWidgetTest extends UnitTestCase {
'llama' => 'Llama',
'badger' => 'Badger',
'duck' => 'Duck',
- 'alpaca' => 'Alpaca'
+ 'alpaca' => 'Alpaca',
];
foreach ($expected_links as $index => $value) {
$this->assertEquals($value, $built_form['test__field']['#options'][$index]);
@@ -131,7 +131,7 @@ class CheckboxWidgetTest extends UnitTestCase {
// between those settings works.
$facet->setWidgetConfigs(['show_numbers' => 1]);
- $built_form = $this->widget->buildForm($form, $formState);
+ $built_form = $this->widget->buildForm($form, $form_state);
$this->assertInternalType('array', $built_form);
$this->assertCount(4, $built_form['test__field']['#options']);
diff --git a/tests/src/Unit/Plugin/widget/LinksWidgetTest.php b/tests/src/Unit/Plugin/widget/LinksWidgetTest.php
index 49b99fc..8ed8bbf 100644
--- a/tests/src/Unit/Plugin/widget/LinksWidgetTest.php
+++ b/tests/src/Unit/Plugin/widget/LinksWidgetTest.php
@@ -11,7 +11,6 @@ use Drupal\facets\Entity\Facet;
use Drupal\facets\Plugin\facets\widget\LinksWidget;
use Drupal\facets\Result\Result;
use Drupal\Tests\UnitTestCase;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Unit test for widget.
@@ -57,7 +56,7 @@ class LinksWidgetTest extends UnitTestCase {
}
/**
- * Test widget.
+ * Tests widget without filters.
*/
public function testNoFilterResults() {
$facet = new Facet([], 'facet');
@@ -77,7 +76,7 @@ class LinksWidgetTest extends UnitTestCase {
}
/**
- * Test widget.
+ * Test widget with 2 active items.
*/
public function testActiveItems() {
$original_results = $this->originalResults;
@@ -106,7 +105,7 @@ class LinksWidgetTest extends UnitTestCase {
}
/**
- * Test widget, make sure hiding and showing numbers works.
+ * Tests widget, make sure hiding and showing numbers works.
*/
public function testHideNumbers() {
$original_results = $this->originalResults;