1 image.test | public ImageStylesPathAndUrlUnitTest::testImageContentTypeHeaders() |
Test that we do not pass an array to backdrop_add_http_header.
File
- core/
modules/ image/ tests/ image.test, line 199 - Tests for image.module.
Class
- ImageStylesPathAndUrlUnitTest
- Tests the functions for generating paths and URLs for image styles.
Code
public function testImageContentTypeHeaders() {
$files = $this->backdropGetTestFiles('image');
$file = array_shift($files);
// Copy the test file to private folder.
$private_uri = file_unmanaged_copy($file->uri, 'private://test.png');
// Tell image_module_test module to return the headers we want to test.
state_set('image_module_test_invalid_headers', $private_uri);
// Invoke image_style_deliver so it will try to set headers.
$generated_url = image_style_url($this->style_name, $private_uri);
$this->backdropGet($generated_url);
state_del('image_module_test_invalid_headers');
}