diff options
author | David Rothstein <drothstein@gmail.com> | 2013-12-27 23:51:46 -0500 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2013-12-27 23:51:46 -0500 |
commit | 16fe2e9d8c32a5d95e231fefa1b96f3a107f7b7c (patch) | |
tree | d30522e5612db6d9273f1e46ad0c7ef0749e135a /modules/simpletest/tests | |
parent | 97ba84ca650f6bb868e5ba420d813392fa94b318 (diff) | |
download | brdo-16fe2e9d8c32a5d95e231fefa1b96f3a107f7b7c.tar.gz brdo-16fe2e9d8c32a5d95e231fefa1b96f3a107f7b7c.tar.bz2 |
Issue #1198904 by das-peter, jox: Drupal_load_stylesheet() fails to load @import files in different directories.
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r-- | modules/simpletest/tests/common.test | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 856945f63..44eecdced 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -926,26 +926,30 @@ class CascadingStylesheetsUnitTest extends DrupalUnitTestCase { $testfiles = array( 'css_input_without_import.css', 'css_input_with_import.css', + 'css_subfolder/css_input_with_import.css', 'comment_hacks.css' ); $path = drupal_get_path('module', 'simpletest') . '/files/css_test_files'; foreach ($testfiles as $file) { - $expected = file_get_contents("$path/$file.unoptimized.css"); - $unoptimized_output = drupal_load_stylesheet("$path/$file.unoptimized.css", FALSE); + $file_path = $path . '/' . $file; + $file_url = $GLOBALS['base_url'] . '/' . $file_path; + + $expected = file_get_contents($file_path . '.unoptimized.css'); + $unoptimized_output = drupal_load_stylesheet($file_path, FALSE); $this->assertEqual($unoptimized_output, $expected, format_string('Unoptimized CSS file has expected contents (@file)', array('@file' => $file))); - $expected = file_get_contents("$path/$file.optimized.css"); - $optimized_output = drupal_load_stylesheet("$path/$file", TRUE); + $expected = file_get_contents($file_path . '.optimized.css'); + $optimized_output = drupal_load_stylesheet($file_path, TRUE); $this->assertEqual($optimized_output, $expected, format_string('Optimized CSS file has expected contents (@file)', array('@file' => $file))); // Repeat the tests by accessing the stylesheets by URL. - $expected = file_get_contents("$path/$file.unoptimized.css"); - $unoptimized_output_url = drupal_load_stylesheet($GLOBALS['base_url'] . "/$path/$file.unoptimized.css", FALSE); - $this->assertEqual($unoptimized_output, $expected, format_string('Unoptimized CSS file (loaded from an URL) has expected contents (@file)', array('@file' => $file))); + $expected = file_get_contents($file_path . '.unoptimized.css'); + $unoptimized_output_url = drupal_load_stylesheet($file_url, FALSE); + $this->assertEqual($unoptimized_output_url, $expected, format_string('Unoptimized CSS file (loaded from an URL) has expected contents (@file)', array('@file' => $file))); - $expected = file_get_contents("$path/$file.optimized.css"); - $optimized_output = drupal_load_stylesheet($GLOBALS['base_url'] . "/$path/$file", TRUE); - $this->assertEqual($optimized_output, $expected, format_string('Optimized CSS file (loaded from an URL) has expected contents (@file)', array('@file' => $file))); + $expected = file_get_contents($file_path . '.optimized.css'); + $optimized_output_url = drupal_load_stylesheet($file_url, TRUE); + $this->assertEqual($optimized_output_url, $expected, format_string('Optimized CSS file (loaded from an URL) has expected contents (@file)', array('@file' => $file))); } } } |