Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/allure-framework/allure-php-commons/test/Attribute/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/allure-framework/allure-php-commons/test/Attribute/ParameterTest.php
<?php

declare(strict_types=1);

namespace Qameta\Allure\Test\Attribute;

use PHPUnit\Framework\TestCase;
use Qameta\Allure\Attribute\Parameter;
use Qameta\Allure\Attribute\ParameterMode;

/**
 * @covers \Qameta\Allure\Attribute\Parameter
 * @covers \Qameta\Allure\Attribute\AbstractParameter
 */
class ParameterTest extends TestCase
{
    use AnnotationTestTrait;

    public function testGetName_WithVNameReturnsSameString(): void
    {
        $parameter = $this->getParameterInstance('demoWithNameAndValue');
        self::assertSame('a', $parameter->getName());
    }

    public function testGetValue_WithValue_ReturnsSameString(): void
    {
        $parameter = $this->getParameterInstance('demoWithNameAndValue');
        self::assertSame('b', $parameter->getValue());
    }

    public function testGetExcluded_WithoutExcluded_ReturnsNull(): void
    {
        $parameter = $this->getParameterInstance('demoWithNameAndValue');
        self::assertNull($parameter->getExcluded());
    }

    public function testGetExcluded_WithExcluded_ReturnsTrue(): void
    {
        $parameter = $this->getParameterInstance('demoWithExcluded');
        self::assertTrue($parameter->getExcluded());
    }

    public function testGetMode_WithoutMode_ReturnsNull(): void
    {
        $parameter = $this->getParameterInstance('demoWithNameAndValue');
        self::assertNull($parameter->getMode());
    }

    public function testGetMode_WithMode_ReturnsSameMode(): void
    {
        $parameter = $this->getParameterInstance('demoWithMode');
        self::assertSame('hidden', $parameter->getMode());
    }

    #[Parameter("a", "b")]
    protected function demoWithNameAndValue(): void
    {
    }

    #[Parameter("a", "b", excluded: true)]
    protected function demoWithExcluded(): void
    {
    }

    #[Parameter("a", "b", mode: ParameterMode::HIDDEN)]
    protected function demoWithMode(): void
    {
    }

    private function getParameterInstance(string $methodName): Parameter
    {
        return $this->getAttributeInstance(Parameter::class, $methodName);
    }
}

Spamworldpro Mini