Version 1
[yaffs-website] / vendor / caxy / php-htmldiff / tests / Caxy / Tests / AbstractTest.php
diff --git a/vendor/caxy/php-htmldiff/tests/Caxy/Tests/AbstractTest.php b/vendor/caxy/php-htmldiff/tests/Caxy/Tests/AbstractTest.php
new file mode 100644 (file)
index 0000000..d82eaf5
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+namespace Caxy\Tests;
+
+abstract class AbstractTest extends \PHPUnit_Framework_TestCase
+{
+    protected function stripExtraWhitespaceAndNewLines($text)
+    {
+        return trim(
+            preg_replace(
+                '/>\s+</',
+                '><',
+                preg_replace('/\s+/S', " ", preg_replace("/[\n\r]/", '', $text))
+            )
+        );
+    }
+}
\ No newline at end of file