Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/rocksensor1/web/core/modules/file/tests/src/Kernel/

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/file/tests/src/Kernel/RequirementsTest.php

<?php

declare(strict_types=1);

namespace Drupal\Tests\file\Kernel;

use Drupal\KernelTests\KernelTestBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;

/**
 * Tests the file requirements.
 *
 * @group file
 */
class RequirementsTest extends KernelTestBase {

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

  /**
   * Tests the file upload requirements.
   */
  public function testUploadRequirements(): void {
    if (\extension_loaded('uploadprogress')) {
      $this->markTestSkipped('We are testing only when the uploadprogress extension is not loaded.');
    }

    /** @var \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler */
    $moduleHandler = $this->container->get('module_handler');
    $moduleHandler->loadInclude('file', 'install');

    // Test unspecified server software.
    $this->setServerSoftware(NULL);
    $requirements = \file_requirements('runtime');
    $this->assertNotEmpty($requirements);

    $this->assertEquals('Upload progress', (string) $requirements['file_progress']['title']);
    $this->assertEquals('Not enabled', (string) $requirements['file_progress']['value']);
    $this->assertEquals('Your server is not capable of displaying file upload progress. File upload progress requires an Apache server running PHP with mod_php or Nginx with PHP-FPM.', (string) $requirements['file_progress']['description']);

    // Test Apache + mod_php.
    $this->setServerSoftware('Apache mod_php');
    $requirements = \file_requirements('runtime');
    $this->assertNotEmpty($requirements);
    $this->assertEquals('Not enabled', (string) $requirements['file_progress']['value']);
    $this->assertEquals('Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the <a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress library</a>.', (string) $requirements['file_progress']['description']);

    // Test Apache + mod_fastcgi.
    $this->setServerSoftware('Apache mod_fastcgi');
    $requirements = \file_requirements('runtime');
    $this->assertNotEmpty($requirements);
    $this->assertEquals('Not enabled', (string) $requirements['file_progress']['value']);
    $this->assertEquals('Your server is not capable of displaying file upload progress. File upload progress requires PHP be run with mod_php or PHP-FPM and not as FastCGI.', (string) $requirements['file_progress']['description']);

    // Test Nginx.
    $this->setServerSoftware('Nginx');
    $requirements = \file_requirements('runtime');
    $this->assertNotEmpty($requirements);
    $this->assertEquals('Not enabled', (string) $requirements['file_progress']['value']);
    $this->assertEquals('Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the <a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress library</a>.', (string) $requirements['file_progress']['description']);

  }

  /**
   * Sets the server software attribute in the request.
   */
  private function setServerSoftware(?string $software): void {
    $request = new Request();
    $request->setSession(new Session(new MockArraySessionStorage()));
    if (is_string($software)) {
      $request->server->set('SERVER_SOFTWARE', $software);
    }
    $requestStack = new RequestStack();
    $requestStack->push($request);
    $this->container->set('request_stack', $requestStack);
  }

}

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