3 namespace Drupal\Tests\demo_umami_content\Functional;
5 use Drupal\Core\Site\Settings;
6 use Drupal\Tests\BrowserTestBase;
9 * Tests that files provided by demo_umami_content are not accessible.
11 * @group demo_umami_content
13 class DefaultContentFilesAccessTest extends BrowserTestBase {
16 * Tests that sample images, recipes and articles are not accessible.
18 public function testAccessDeniedToFiles() {
19 // The demo_umami profile should not be used because we want to ensure that
20 // if you install another profile these files are not available.
21 $this->assertNotSame('demo_umami', Settings::get('install_profile'));
24 'images/chocolate-brownie-umami.jpg',
25 'recipe_instructions/chocolate-brownie-umami.html',
26 'article_body/lets-hear-it-for-carrots.html',
29 foreach ($files_to_test as $file) {
30 // Hard code the path since the demo_umami profile is not installed.
31 $content_path = "core/profiles/demo_umami/modules/demo_umami_content/default_content/$file";
32 $this->assertFileExists($this->root . '/' . $content_path);
33 $this->drupalGet($content_path);
34 $this->assertSession()->statusCodeEquals(403);