Skip to content

Commit

Permalink
add tests for vimeo#9506
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomulik committed Mar 13, 2023
1 parent 24ddf9e commit ac97016
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions tests/Template/ClassTemplateTest.php
Expand Up @@ -4051,6 +4051,64 @@ public function __construct(
'ignored_issues' => [],
'php_version' => '8.0',
],
'template of simple type with additional comment without dot' => [
'code' => '<?php
/**
* @psalm-template T of string
*
* lorem ipsum
*/
class Foo {
/** @psalm-var T */
public string $t;
/** @psalm-param T $t */
public function __construct(string $t) {
$this->t = $t;
}
/**
* @psalm-return T
*/
public function t(): string {
return $this->t;
}
}
$t = (new Foo(\'\'))->t();
',
'assertions' => [
'$t===' => '\'\'',
],
],
'template of simple type with additional comment with dot' => [
'code' => '<?php
/**
* @psalm-template T of string
*
* lorem ipsum.
*/
class Foo {
/** @psalm-var T */
public string $t;
/** @psalm-param T $t */
public function __construct(string $t) {
$this->t = $t;
}
/**
* @psalm-return T
*/
public function t(): string {
return $this->t;
}
}
$t = (new Foo(\'\'))->t();
',
'assertions' => [
'$t===' => '\'\'',
],
],
];
}

Expand Down

0 comments on commit ac97016

Please sign in to comment.