-
Notifications
You must be signed in to change notification settings - Fork 937
Expand file tree
/
Copy pathDocBlockVarLineTest.php
More file actions
54 lines (47 loc) · 1.13 KB
/
Copy pathDocBlockVarLineTest.php
File metadata and controls
54 lines (47 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php declare(strict_types=1);
/**
* @license Apache 2.0
*/
namespace OpenApi\Tests\Processors;
use OpenApi\Processors\Concerns\DocblockTrait;
use OpenApi\Tests\OpenApiTestCase;
use PHPUnit\Framework\Attributes\DataProvider;
final class DocBlockVarLineTest extends OpenApiTestCase
{
use DocblockTrait;
public static function varLineCases(): iterable
{
yield 'multi-line' => [
<<<END
/**
* @example Allan
* @var null|string the second name of the customer
*/
END,
[
'type' => 'null|string',
'description' => 'the second name of the customer',
],
];
yield 'split-description' => [
<<< END
/**
* The unique identifier of a product in our catalog.
*
* @var int
*
* @OA\Property(format="int64", example=1)
*/
END,
[
'type' => 'int',
'description' => null,
],
];
}
#[DataProvider('varLineCases')]
public function testDocBlockVarLine(string $comment, array $expected): void
{
$this->assertSame($expected, $this->parseVarLine($comment));
}
}