') !== FALSE,
- 'Expand class is added to codefilter blocks that are too long when that option is specified.'
- );
- }
-}
diff --git a/tests/Drupal/codefilter/Tests/CodeFilterUnitTest.php b/tests/Drupal/codefilter/Tests/CodeFilterUnitTest.php
new file mode 100644
index 0000000..9772201
--- /dev/null
+++ b/tests/Drupal/codefilter/Tests/CodeFilterUnitTest.php
@@ -0,0 +1,96 @@
+ 'Codefilter module text filters',
+ 'description' => 'Tests raw filtering functions.',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setUp() {
+ include_once __DIR__ . '/../../../../codefilter.module';
+ include_once __DIR__ . '/../../../../../../core/includes/unicode.inc';
+ }
+
+ /**
+ * Test codefilter_process_php().
+ *
+ * @dataProvider providerCodefilterProcessPHP
+ */
+ public function testCodefilterProcessPHP($input, $expected) {
+ $result = codefilter_process_php($input);
+ $this->assertEquals($expected, $result);
+ }
+
+ /**
+ * Test codefilter_process_code().
+ *
+ * @dataProvider providerCodefilterProcessCode
+ */
+ public function testCodefilterProcessCode($input, $expected) {
+ $result = codefilter_process_code($input);
+ $this->assertEquals($expected, $result);
+ }
+
+ /**
+ * Data provider for testCodefilterProcessPHP().
+ */
+ public static function providerCodefilterProcessPHP() {
+ return array(
+ array(
+ self::providerCode(),
+ '
<?php
// Comment is here.
watchdog(\'actions\', \'@count orphaned actions (%orphans) exist in the actions table. !link\', array(\'@count\' => $count, \'%orphans\' => $orphans, \'!link\' => $link), WATCHDOG_INFO);
/**
* Longer comment is here.
**/
?>
',
+ ),
+ );
+ }
+
+ /**
+ * Data provider for testCodefilterProcessPHP().
+ */
+ public static function providerCodefilterProcessCode() {
+ return array(
+ array(
+ self::providerCode(),
+ '
// Comment is here.
watchdog(\'actions\', \'@count orphaned actions (%orphans) exist in the actions table. !link\', array(\'@count\' => $count, \'%orphans\' => $orphans, \'!link\' => $link), WATCHDOG_INFO);
/**
* Longer comment is here.
**/
',
+ ),
+ );
+ }
+
+ /**
+ * Provides a string with php code.
+ *
+ * @return string
+ * The php code as a string.
+ */
+ public static function providerCode() {
+ return <<
\$count, '%orphans' => \$orphans, '!link' => \$link), WATCHDOG_INFO);
+/**
+ * Longer comment is here.
+ **/
+EOF;
+ }
+}
diff --git a/tests/codefilter.code-input.txt b/tests/codefilter.code-input.txt
deleted file mode 100644
index dc9809b..0000000
--- a/tests/codefilter.code-input.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
-// Comment is here.
-watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
-/**
- * Longer comment is here.
- **/
-
\ No newline at end of file
diff --git a/tests/codefilter.code-output.txt b/tests/codefilter.code-output.txt
deleted file mode 100644
index 6aec2a5..0000000
--- a/tests/codefilter.code-output.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Comment is here.
watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
/**
* Longer comment is here.
**/
\ No newline at end of file
diff --git a/tests/codefilter.php-input.txt b/tests/codefilter.php-input.txt
deleted file mode 100644
index 20d8372..0000000
--- a/tests/codefilter.php-input.txt
+++ /dev/null
@@ -1,7 +0,0 @@
- $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
-/**
- * Longer comment is here.
- **/
-?>
\ No newline at end of file
diff --git a/tests/codefilter.php-output.txt b/tests/codefilter.php-output.txt
deleted file mode 100644
index 702e13e..0000000
--- a/tests/codefilter.php-output.txt
+++ /dev/null
@@ -1 +0,0 @@
-<?php
// Comment is here.
watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
/**
* Longer comment is here.
**/
?>
\ No newline at end of file