Not alot of explaining needed, convert this test from a DrupalUnitTest to a PHPUnit test. I think it makes sense to use data providers too.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

damiankloip’s picture

I spoke to dawehner on IRC, the provider methods should be called provider* and not *provider.

dawehner’s picture

Really nice! Here are just two nitpicks.

+++ b/core/modules/views/tests/Drupal/views/Tests/PluginBaseTest.phpundefined
@@ -2,37 +2,72 @@
+  protected function setUp() {

Let's inheritdoc the setup method.

+++ b/core/modules/views/tests/Drupal/views/Tests/PluginBaseTest.phpundefined
@@ -2,37 +2,72 @@
+  public function testUnpackOptions($storage, $options, $definition, $expected, $all = FALSE) {
...
+  public function testSetOptionDefault($storage, $definition, $expected) {

It would be cool to document these methods.

damiankloip’s picture

FileSize
1.54 KB
7.47 KB

Thanks! added that docblock and docs.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Thank you

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 893ae86 and pushed to 8.x. Thanks!

andypost’s picture

+++ b/core/modules/views/tests/Drupal/views/Tests/PluginBaseTest.phpundefined
@@ -2,37 +2,93 @@
+    $this-> testHelperPlugin = new TestHelperPlugin(array(), 'default', array());

needs follow-up to remove space after $this->

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bdone’s picture

#2046845: remove space after $this-> testHelperPlugin adds follow-up to remove trailing space in PluginBaseTest