summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/drupal_web_test_case.php2
-rw-r--r--modules/simpletest/tests/common.test12
2 files changed, 12 insertions, 2 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 640d1f8c7..80495ede6 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -728,7 +728,7 @@ class DrupalWebTestCase extends DrupalTestCase {
// Merge body field value and format separately.
$body = array(
'value' => $this->randomName(32),
- 'format' => FILTER_FORMAT_DEFAULT
+ 'format' => filter_default_format(),
);
$settings['body'][FIELD_LANGUAGE_NONE][0] += $body;
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index da49b8f56..2ad58a10a 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -374,7 +374,17 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
// Create a node, using the PHP filter that tests drupal_add_css().
$settings = array(
'type' => 'page',
- 'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => t('This tests the inline CSS!') . "<?php drupal_add_css('$css', 'inline'); ?>", 'format' => 3))), // PHP filter.
+ 'body' => array(
+ FIELD_LANGUAGE_NONE => array(
+ array(
+ 'value' => t('This tests the inline CSS!') . "<?php drupal_add_css('$css', 'inline'); ?>",
+ // The "PHP code" format is always the most recent one added, since
+ // the PHP module was enabled in the setUp() method of the current
+ // test.
+ 'format' => db_query("SELECT MAX(format) FROM {filter_format}")->fetchField(),
+ ),
+ ),
+ ),
'promote' => 1,
);
$node = $this->drupalCreateNode($settings);