1 layout.test | public LayoutPathTest::testLayoutPath() |
Tests that null paths (in default layouts) don't cause problems.
File
- core/
modules/ layout/ tests/ layout.test, line 3703 - Tests for the Layout module.
Class
- LayoutPathTest
- Tests that default layout paths are handled properly.
Code
public function testLayoutPath() {
$layouts = layout_load_multiple_by_path('');
$default_layout = $layouts['default'];
$path = $default_layout->getPath(); // This will be NULL.
$this->assertNull($path, 'Default layout path is NULL.');
// Make sure path_is_admin() can handle a NULL path.
backdrop_static_reset('path_is_admin');
$result = path_is_admin($path);
$this->assertFalse($result, 'Default layout is not an admin path.');
// Make sure backdrop_match_path() can handle a NULL path.
backdrop_match_path($path, "foo\nbar");
}