Skip to content
Permalink
Browse files

Add a couple more tests for currently-working behaviour

  • Loading branch information...
muglug committed Jun 24, 2019
1 parent fe5138f commit 44d52c86496cd321f6fb69c1319c56f5ed6e9f93
Showing with 29 additions and 0 deletions.
  1. +29 −0 tests/Template/TemplateTest.php
@@ -2752,6 +2752,35 @@ function useMockTemplated(string $className) : void
mock(A::class)->foo();'
],
'allowTemplateTypeBeingUsedInsideFunction' => [
'<?php
/**
* @template T of DateTime
* @param callable(T) $callable
* @param T $value
*/
function foo(callable $callable, DateTime $value) : void {
$callable($value);
}',
],
'callFindAnother' => [
'<?php
/**
* @template T as Foo
* @param T $foo
* @return T
*/
function loader($foo) {
return $foo::getAnother();
}
class Foo {
/** @return static */
public static function getAnother() {
return new static();
}
}',
],
];
}

0 comments on commit 44d52c8

Please sign in to comment.
You can’t perform that action at this time.