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-phpunit/test/unit/Internal/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/allure-framework/allure-phpunit/test/unit/Internal/TestRunInfoTest.php
<?php

declare(strict_types=1);

namespace Qameta\Allure\PHPUnit\Test\Unit\Internal;

use PHPUnit\Framework\TestCase;
use Qameta\Allure\PHPUnit\Internal\TestInfo;
use Qameta\Allure\PHPUnit\Internal\TestRunInfo;

/**
 * @covers \Qameta\Allure\PHPUnit\Internal\TestRunInfo
 */
class TestRunInfoTest extends TestCase
{
    public function testGetTestInfo_ConstructedWithTestInfo_ReturnsSameInstance(): void
    {
        $testInfo = new TestInfo(
            test: 'a',
            class: null,
            method: null,
            dataLabel: null,
            host: null,
            thread: null,
        );
        $runInfo = new TestRunInfo(
            testInfo: $testInfo,
            uuid: 'b',
            rerunOf: null,
            runIndex: 1,
            testCaseId: 'c',
            historyId: 'd',
        );
        self::assertSame($testInfo, $runInfo->getTestInfo());
    }

    public function testGetUuid_ConstructedWithUuid_ReturnsSameUuid(): void
    {
        $testInfo = new TestInfo(
            test: 'a',
            class: null,
            method: null,
            dataLabel: null,
            host: null,
            thread: null,
        );
        $runInfo = new TestRunInfo(
            testInfo: $testInfo,
            uuid: 'b',
            rerunOf: null,
            runIndex: 1,
            testCaseId: 'c',
            historyId: 'd',
        );
        self::assertSame('b', $runInfo->getUuid());
    }

    /**
     * @param string|null $rerunOf
     * @dataProvider providerRerunOf
     */
    public function testGetRerunOf_ConstructedWithRerunOf_ReturnsSameRerunOf(?string $rerunOf): void
    {
        $testInfo = new TestInfo(
            test: 'a',
            class: null,
            method: null,
            dataLabel: null,
            host: null,
            thread: null,
        );
        $runInfo = new TestRunInfo(
            testInfo: $testInfo,
            uuid: 'b',
            rerunOf: $rerunOf,
            runIndex: 1,
            testCaseId: 'c',
            historyId: 'd',
        );
        self::assertSame($rerunOf, $runInfo->getRerunOf());
    }

    /**
     * @return iterable<string, array{string|null}>
     */
    public function providerRerunOf(): iterable
    {
        return [
            'Null' => [null],
            'Non-null' => ['e'],
        ];
    }

    public function testGetRunIndex_ConstructedWithRunIndex_ReturnsSameIndex(): void
    {
        $testInfo = new TestInfo(
            test: 'a',
            class: null,
            method: null,
            dataLabel: null,
            host: null,
            thread: null,
        );
        $runInfo = new TestRunInfo(
            testInfo: $testInfo,
            uuid: 'b',
            rerunOf: null,
            runIndex: 1,
            testCaseId: 'c',
            historyId: 'd',
        );
        self::assertSame(1, $runInfo->getRunIndex());
    }

    public function testGetTestCaseId_ConstructedWithTestCaseId_ReturnsSameId(): void
    {
        $testInfo = new TestInfo(
            test: 'a',
            class: null,
            method: null,
            dataLabel: null,
            host: null,
            thread: null,
        );
        $runInfo = new TestRunInfo(
            testInfo: $testInfo,
            uuid: 'b',
            rerunOf: null,
            runIndex: 1,
            testCaseId: 'c',
            historyId: 'd',
        );
        self::assertSame('c', $runInfo->getTestCaseId());
    }

    public function testGetHistoryId_ConstructedWithHistoryId_ReturnsSameId(): void
    {
        $testInfo = new TestInfo(
            test: 'a',
            class: null,
            method: null,
            dataLabel: null,
            host: null,
            thread: null,
        );
        $runInfo = new TestRunInfo(
            testInfo: $testInfo,
            uuid: 'b',
            rerunOf: null,
            runIndex: 1,
            testCaseId: 'c',
            historyId: 'd',
        );
        self::assertSame('d', $runInfo->getHistoryId());
    }
}

Spamworldpro Mini