![]() 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/ |
<?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\Issue; use Yandex\Allure\Adapter\Annotation\Issues; /** * @covers \Yandex\Allure\Adapter\Annotation\Issues */ class IssuesTest extends TestCase { use AnnotationTestTrait; public function testGetIssueKeys_WithSingleValue_ReturnsSameValueInList(): void { $issues = $this->getIssuesInstance('demoWithSingleValue'); self::assertSame(['a'], $issues->getIssueKeys()); } public function testGetIssueKeys_WithTwoValues_ReturnsSameValuesInList(): void { $issues = $this->getIssuesInstance('demoWithTwoValues'); self::assertSame(['a', 'b'], $issues->getIssueKeys()); } public function testConvert_WithSingleValue_ResultHasSameValueInList(): void { $issues = $this->getIssuesInstance('demoWithSingleValue'); $expectedList = [ [ 'class' => Issue::class, 'type' => 'issue', 'value' => 'a', ], ]; self::assertSame($expectedList, $this->exportLinks(...$issues->convert())); } public function testConvert_WithTwoValues_ResultHasSameValuesInList(): void { $issues = $this->getIssuesInstance('demoWithTwoValues'); $expectedList = [ [ 'class' => Issue::class, 'type' => 'issue', 'value' => 'a', ], [ 'class' => Issue::class, 'type' => 'issue', 'value' => 'b', ], ]; self::assertSame($expectedList, $this->exportLinks(...$issues->convert())); } /** * @Issues("a") */ protected function demoWithSingleValue(): void { } /** * @Issues("a","b") */ protected function demoWithTwoValues(): void { } /** * @psalm-suppress DeprecatedClass */ private function getIssuesInstance(string $methodName): Issues { return $this->getLegacyAttributeInstance(Issues::class, $methodName); } }