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/Legacy/Annotation/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/allure-framework/allure-php-commons/test/Legacy/Annotation/EpicsTest.php
<?php

declare(strict_types=1);

namespace Qameta\Allure\Test\Legacy\Annotation;

use PHPUnit\Framework\TestCase;
use Qameta\Allure\Test\Attribute\AnnotationTestTrait;
use Qameta\Allure\Attribute\Epic;
use Yandex\Allure\Adapter\Annotation\Epics;

/**
 * @covers \Yandex\Allure\Adapter\Annotation\Epics
 */
class EpicsTest extends TestCase
{
    use AnnotationTestTrait;

    public function testGetEpicNames_WithSingleValue_ReturnsSameValueInList(): void
    {
        $epics = $this->getEpicsInstance('demoWithSingleValue');
        self::assertSame(['a'], $epics->getEpicNames());
    }

    public function testGetEpicNames_WithTwoValues_ReturnsSameValuesInList(): void
    {
        $epics = $this->getEpicsInstance('demoWithTwoValues');
        self::assertSame(['a', 'b'], $epics->getEpicNames());
    }

    public function testConvert_WithSingleValue_ResultHasEpicWithSameNameInList(): void
    {
        $epics = $this->getEpicsInstance('demoWithSingleValue');
        $expectedList = [
            [
                'class' => Epic::class,
                'name' => 'epic',
                'value' => 'a',
            ],
        ];
        self::assertSame($expectedList, $this->exportLabels(...$epics->convert()));
    }

    public function testConvert_WithTwoValues_ResultHasEpicsWithSameNamesInList(): void
    {
        $epics = $this->getEpicsInstance('demoWithTwoValues');
        $expectedList = [
            [
                'class' => Epic::class,
                'name' => 'epic',
                'value' => 'a',
            ],
            [
                'class' => Epic::class,
                'name' => 'epic',
                'value' => 'b',
            ],
        ];
        self::assertSame($expectedList, $this->exportLabels(...$epics->convert()));
    }

    /**
     * @Epics("a")
     */
    protected function demoWithSingleValue(): void
    {
    }

    /**
     * @Epics("a","b")
     */
    protected function demoWithTwoValues(): void
    {
    }

    /**
     * @psalm-suppress DeprecatedClass
     */
    private function getEpicsInstance(string $methodName): Epics
    {
        return $this->getLegacyAttributeInstance(Epics::class, $methodName);
    }
}

Spamworldpro Mini