File: NamespaceGroupTest.php

package info (click to toggle)
php-opis-closure 3.6.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 576 kB
  • sloc: php: 3,313; xml: 41; makefile: 17; sh: 8
file content (27 lines) | stat: -rw-r--r-- 561 bytes parent folder | download
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
<?php

namespace Opis\Closure\Test;

use Closure;
use Opis\Closure\ReflectionClosure;
use Foo\{
    Bar as Baz,
    Baz\Qux\Forest
};

final class NamespaceGroupTest extends \PHPUnit\Framework\TestCase
{
    public function test_namespace_fully_qualified()
    {
        $f = fn(): Forest => new Forest;
        $e = 'fn(): \Foo\Baz\Qux\Forest => new \Foo\Baz\Qux\Forest';
        $this->assertEquals($e, $this->c($f));
    }

    protected function c(Closure $closure)
    {
        $r = new ReflectionClosure($closure);

        return $r->getCode();
    }
}