Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/12park/web/modules/contrib/honeypot/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/12park/web/modules/contrib/honeypot/tests/src/Functional/HoneypotAdminFormTest.php

<?php

declare(strict_types=1);

namespace Drupal\Tests\honeypot\Functional;

use Drupal\Tests\BrowserTestBase;

/**
 * Test Honeypot spam protection admin form functionality.
 *
 * @group honeypot
 */
class HoneypotAdminFormTest extends BrowserTestBase {

  /**
   * Admin user.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $adminUser;

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

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

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

    // Set up admin user.
    $this->adminUser = $this->drupalCreateUser([
      'administer honeypot',
      'bypass honeypot protection',
    ]);
  }

  /**
   * Test a valid element name.
   */
  public function testElementNameUpdateSuccess(): void {
    /** @var \Drupal\Tests\WebAssert $assert */
    $assert = $this->assertSession();

    // Log in the admin user.
    $this->drupalLogin($this->adminUser);

    // Set up form and submit it.
    $edit['element_name'] = "test";
    $this->drupalGet('admin/config/content/honeypot');
    $this->submitForm($edit, 'Save configuration');

    // Form should have been submitted successfully.
    $assert->pageTextContains('The configuration options have been saved.');

    // Set up form and submit it.
    $edit['element_name'] = "test-1";
    $this->drupalGet('admin/config/content/honeypot');
    $this->submitForm($edit, 'Save configuration');

    // Form should have been submitted successfully.
    $assert->pageTextContains('The configuration options have been saved.');
  }

  /**
   * Test an invalid element name (invalid first character).
   */
  public function testElementNameUpdateFirstCharacterFail(): void {
    // Log in the admin user.
    $this->drupalLogin($this->adminUser);

    // Set up form and submit it.
    $edit['element_name'] = "1test";
    $this->drupalGet('admin/config/content/honeypot');
    $this->submitForm($edit, 'Save configuration');

    // Form submission should fail.
    $this->assertSession()->pageTextContains('The element name must start with a letter.');
  }

  /**
   * Test an invalid element name (invalid character in name).
   */
  public function testElementNameUpdateInvalidCharacterFail(): void {
    /** @var \Drupal\Tests\WebAssert $assert */
    $assert = $this->assertSession();

    // Log in the admin user.
    $this->drupalLogin($this->adminUser);

    // Set up form and submit it.
    $edit['element_name'] = "special-character-&";
    $this->drupalGet('admin/config/content/honeypot');
    $this->submitForm($edit, 'Save configuration');

    // Form submission should fail.
    $assert->pageTextContains('The element name cannot contain spaces or other special characters.');

    // Set up form and submit it.
    $edit['element_name'] = "space in name";
    $this->drupalGet('admin/config/content/honeypot');
    $this->submitForm($edit, 'Save configuration');

    // Form submission should fail.
    $assert->pageTextContains('The element name cannot contain spaces or other special characters.');
  }

}

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