Added the Porter Stemmer module to improve searches. This doesn't deal with some...
[yaffs-website] / web / modules / contrib / porterstemmer / tests / src / Unit / PorterPeclBase.php
diff --git a/web/modules/contrib/porterstemmer/tests/src/Unit/PorterPeclBase.php b/web/modules/contrib/porterstemmer/tests/src/Unit/PorterPeclBase.php
new file mode 100644 (file)
index 0000000..3e8fb05
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drupal\Tests\porterstemmer\Unit;
+
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * Base methods for all PECL stem_english() tests.
+ */
+abstract class PorterPeclBase extends UnitTestCase {
+
+  use TestItemsTrait;
+
+  /**
+   * Modules to install.
+   *
+   * @var array
+   */
+  public static $modules = array('porterstemmer');
+
+  public $has_pecl_stem = FALSE;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->has_pecl_stem = extension_loaded('stem') && function_exists('stem_english');
+  }
+
+}