![]() 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\Story; use Yandex\Allure\Adapter\Annotation\Stories; /** * @covers \Yandex\Allure\Adapter\Annotation\Stories */ class StoriesTest extends TestCase { use AnnotationTestTrait; public function testGetStories_WithSingleValue_ReturnsSameValueInList(): void { $stories = $this->getStoriesInstance('demoWithSingleValue'); self::assertSame(['a'], $stories->getStories()); } public function testGetStories_WithTwoValues_ReturnsSameValuesInList(): void { $stories = $this->getStoriesInstance('demoWithTwoValues'); self::assertSame(['a', 'b'], $stories->getStories()); } public function testConvert_WithSingleValue_ResultHasSameValueInList(): void { $stories = $this->getStoriesInstance('demoWithSingleValue'); $expectedList = [ [ 'class' => Story::class, 'name' => 'story', 'value' => 'a', ], ]; self::assertSame($expectedList, $this->exportLabels(...$stories->convert())); } public function testConvert_WithTwoValues_ResultHasSameValuesInList(): void { $stories = $this->getStoriesInstance('demoWithTwoValues'); $expectedList = [ [ 'class' => Story::class, 'name' => 'story', 'value' => 'a', ], [ 'class' => Story::class, 'name' => 'story', 'value' => 'b', ], ]; self::assertSame($expectedList, $this->exportLabels(...$stories->convert())); } /** * @Stories("a") */ protected function demoWithSingleValue(): void { } /** * @Stories("a","b") */ protected function demoWithTwoValues(): void { } /** * @psalm-suppress DeprecatedClass */ private function getStoriesInstance(string $methodName): Stories { return $this->getLegacyAttributeInstance(Stories::class, $methodName); } }