![]() 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\Feature; use Yandex\Allure\Adapter\Annotation\Features; /** * @covers \Yandex\Allure\Adapter\Annotation\Features */ class FeaturesTest extends TestCase { use AnnotationTestTrait; public function testGetFeatureNames_WithSingleValue_ReturnsSameValueInList(): void { $features = $this->getFeaturesInstance('demoWithSingleValue'); self::assertSame(['a'], $features->getFeatureNames()); } public function testGetFeatureNames_WithTwoValues_ReturnsSameValuesInList(): void { $features = $this->getFeaturesInstance('demoWithTwoValues'); self::assertSame(['a', 'b'], $features->getFeatureNames()); } public function testConvert_WithSingleValue_ResultHasSameValueInList(): void { $features = $this->getFeaturesInstance('demoWithSingleValue'); $expectedList = [ [ 'class' => Feature::class, 'name' => 'feature', 'value' => 'a', ], ]; self::assertSame($expectedList, $this->exportLabels(...$features->convert())); } public function testConvert_WithTwoValues_ResultHasSameValuesInList(): void { $features = $this->getFeaturesInstance('demoWithTwoValues'); $expectedList = [ [ 'class' => Feature::class, 'name' => 'feature', 'value' => 'a', ], [ 'class' => Feature::class, 'name' => 'feature', 'value' => 'b', ], ]; self::assertSame($expectedList, $this->exportLabels(...$features->convert())); } /** * @Features("a") */ protected function demoWithSingleValue(): void { } /** * @Features("a","b") */ protected function demoWithTwoValues(): void { } /** * @psalm-suppress DeprecatedClass */ private function getFeaturesInstance(string $methodName): Features { return $this->getLegacyAttributeInstance(Features::class, $methodName); } }