Skip to content

Commit

Permalink
add unit tests for vimeo#9401
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomulik committed Feb 26, 2023
1 parent df671c3 commit 18e21b9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Template/ClassStringMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,28 @@ public function set(string $key, object $obj): void {
}'
,
],
'assignClassStringMapInConstruct' => [
'code' => '<?php
class A {
/** @var class-string-map<T,T> */
private array $map;
/** @param class-string-map<T,T> $map */
public function __construct(array $map) {
$this->map = $map;
}
}',
],
'assignClassStringMapInMethod' => [
'code' => '<?php
class A {
/** @var class-string-map<T,T> */
private array $map = [];
/** @param class-string-map<T,T> $map */
public function set(array $map) {
$this->map = $map;
}
}',
],
];
}

Expand Down

0 comments on commit 18e21b9

Please sign in to comment.