Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / text / tests / src / Kernel / TextSummaryTest.php
index dab6ed5de51e1e1f62ba37e484c6dcb32dd36dc8..2eeaf2de0be6aaf0eaae158bf6eafa3c22c89af3 100644 (file)
@@ -207,6 +207,15 @@ class TextSummaryTest extends KernelTestBase {
     $this->assertTextSummary($text, "<p>\nHi\n</p>\n<p>\nfolks\n<br />\n!\n</p>", $format, $i++);
   }
 
+  /**
+   * Test text_summary() returns an empty string without any error when called
+   * with an invalid format.
+   */
+  public function testInvalidFilterFormat() {
+
+    $this->assertTextSummary($this->randomString(100), '', 'non_existent_format');
+  }
+
   /**
    * Calls text_summary() and asserts that the expected teaser is returned.
    */