diff --git a/core/modules/views/lib/Drupal/views/Tests/PluginBaseUnitTest.php b/core/modules/views/lib/Drupal/views/Tests/PluginBaseUnitTest.php index 0a19092..2951cce 100644 --- a/core/modules/views/lib/Drupal/views/Tests/PluginBaseUnitTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/PluginBaseUnitTest.php @@ -31,10 +31,7 @@ public static function getInfo() { * @see \Drupal\views\Plugin\views\PluginBase::unpackOptions. */ public function testUnpackOptions() { - // Setup a basic instance of a plugin. - $discovery = new StaticDiscovery(); - $discovery->setDefinition('default', array()); - $plugin = new TestHelperPlugin(array(), 'default', $discovery); + $plugin = $this->getTestPlugin(); $test_parameters = array(); // Set a storage but no value, so the storage value should be kept. @@ -189,10 +186,7 @@ public function testUnpackOptions() { * @see \Drupal\views\Plugin\views\PluginBase::setOptionDefaults. */ public function testSetOptionDefault() { - // Setup a basic instance of a plugin. - $discovery = new StaticDiscovery(); - $discovery->setDefinition('default', array()); - $plugin = new TestHelperPlugin(array(), 'default', $discovery); + $plugin = $this->getTestPlugin(); $test_parameters = array(); // No definition mustn't change anything on the storage. @@ -248,4 +242,16 @@ public function testSetOptionDefault() { $this->assertEqual($parameter['storage'], $parameter['expected']); } } + + /** + * Sets up and returns a basic instance of a plugin. + * + * @return \Drupal\views\Tests\TestHelperPlugin + * A test plugin instance. + */ + protected function getTestPlugin() { + $discovery = new StaticDiscovery(); + $discovery->setDefinition('default', array()); + return new TestHelperPlugin(array(), 'default', $discovery); + } } diff --git a/core/modules/views/lib/Drupal/views/Tests/TestHelperPlugin.php b/core/modules/views/lib/Drupal/views/Tests/TestHelperPlugin.php index 2c232fb..5ace3fa 100644 --- a/core/modules/views/lib/Drupal/views/Tests/TestHelperPlugin.php +++ b/core/modules/views/lib/Drupal/views/Tests/TestHelperPlugin.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\views\Tests::TestHelperPlugin. + * Contains \Drupal\views\Tests\TestHelperPlugin. */ namespace Drupal\views\Tests;