BetterReflectionTest\Reflection\ReflectionTypeTest::testImplicitCastToString PHP Method

testImplicitCastToString() public method

    public function testImplicitCastToString()
    {
        $this->assertSame('int', (string) ReflectionType::createFromType(new Types\Integer(), false));
        $this->assertSame('string', (string) ReflectionType::createFromType(new Types\String_(), false));
        $this->assertSame('array', (string) ReflectionType::createFromType(new Types\Array_(), false));
        $this->assertSame('callable', (string) ReflectionType::createFromType(new Types\Callable_(), false));
        $this->assertSame('bool', (string) ReflectionType::createFromType(new Types\Boolean(), false));
        $this->assertSame('float', (string) ReflectionType::createFromType(new Types\Float_(), false));
        $this->assertSame('void', (string) ReflectionType::createFromType(new Types\Void_(), false));
        $this->assertSame('\\Foo\\Bar\\Baz', (string) ReflectionType::createFromType(new Types\Object_(new Fqsen('\\Foo\\Bar\\Baz')), false));
    }