Skip to content

Commit 7c915e5

Browse files
committed
Add tests
1 parent 1b6d012 commit 7c915e5

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

tests/Fixer/PhpdocTypesCommaSpacesFixerTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,26 @@ public static function provideFixCases(): iterable
105105
* @return array<string,Foo> Description having "," should not be touched
106106
*/',
107107
];
108+
109+
yield [
110+
<<<'PHP'
111+
<?php
112+
/**
113+
* @return array{
114+
* foo: bool,
115+
* bar: null|string,
116+
* }
117+
*/
118+
PHP,
119+
<<<'PHP'
120+
<?php
121+
/**
122+
* @return array{
123+
* foo: bool ,
124+
* bar: null|string ,
125+
* }
126+
*/
127+
PHP,
128+
];
108129
}
109130
}

tests/Fixer/PhpdocTypesTrimFixerTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,5 +257,26 @@ function fooBar($x, $y) {}
257257
function baz() {}
258258
',
259259
];
260+
261+
yield [
262+
<<<'PHP'
263+
<?php
264+
/**
265+
* @return array{
266+
* foo: null|bool,
267+
* bar: string|null,
268+
* }
269+
*/
270+
PHP,
271+
<<<'PHP'
272+
<?php
273+
/**
274+
* @return array{
275+
* foo: null | bool,
276+
* bar: string | null,
277+
* }
278+
*/
279+
PHP,
280+
];
260281
}
261282
}

0 commit comments

Comments
 (0)