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/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

declare(strict_types=1);

namespace Qameta\Allure\Test\Model;

use PHPUnit\Framework\TestCase;
use Qameta\Allure\Model\ResultFactory;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidFactoryInterface;

/**
 * @covers \Qameta\Allure\Model\ResultFactory
 */
class ResultFactoryTest extends TestCase
{
    public function testCreateContainer_FactoryProvidesUuid_ResultHasSameUuid(): void
    {
        $uuidFactory = $this->createStub(UuidFactoryInterface::class);
        $uuid = Uuid::fromString('00000000-0000-0000-0000-000000000001');
        $uuidFactory
            ->method('uuid4')
            ->willReturn($uuid);

        $resultFactory = new ResultFactory($uuidFactory);
        self::assertSame(
            '00000000-0000-0000-0000-000000000001',
            $resultFactory->createContainer()->getUuid(),
        );
    }

    public function testCreateTest_FactoryProvidesUuid_ResultHasSameUuid(): void
    {
        $uuidFactory = $this->createStub(UuidFactoryInterface::class);
        $uuid = Uuid::fromString('00000000-0000-0000-0000-000000000001');
        $uuidFactory
            ->method('uuid4')
            ->willReturn($uuid);

        $resultFactory = new ResultFactory($uuidFactory);
        self::assertSame(
            '00000000-0000-0000-0000-000000000001',
            $resultFactory->createTest()->getUuid(),
        );
    }

    public function testCreateStep_FactoryProvidesUuid_ResultHasSameUuid(): void
    {
        $uuidFactory = $this->createStub(UuidFactoryInterface::class);
        $uuid = Uuid::fromString('00000000-0000-0000-0000-000000000001');
        $uuidFactory
            ->method('uuid4')
            ->willReturn($uuid);

        $resultFactory = new ResultFactory($uuidFactory);
        self::assertSame(
            '00000000-0000-0000-0000-000000000001',
            $resultFactory->createStep()->getUuid(),
        );
    }

    public function testCreateFixture_FactoryProvidesUuid_ResultHasSameUuid(): void
    {
        $uuidFactory = $this->createStub(UuidFactoryInterface::class);
        $uuid = Uuid::fromString('00000000-0000-0000-0000-000000000001');
        $uuidFactory
            ->method('uuid4')
            ->willReturn($uuid);

        $resultFactory = new ResultFactory($uuidFactory);
        self::assertSame(
            '00000000-0000-0000-0000-000000000001',
            $resultFactory->createFixture()->getUuid(),
        );
    }

    public function testCreateAttachment_FactoryProvidesUuid_ResultHasSameUuid(): void
    {
        $uuidFactory = $this->createStub(UuidFactoryInterface::class);
        $uuid = Uuid::fromString('00000000-0000-0000-0000-000000000001');
        $uuidFactory
            ->method('uuid4')
            ->willReturn($uuid);

        $resultFactory = new ResultFactory($uuidFactory);
        self::assertSame(
            '00000000-0000-0000-0000-000000000001',
            $resultFactory->createAttachment()->getUuid(),
        );
    }
}

Spamworldpro Mini