htmlgen\test\HtmlTest::test_html_coerces_object_children_to_strings PHP Метод

test_html_coerces_object_children_to_strings() публичный Метод

    public function test_html_coerces_object_children_to_strings()
    {
        $honey = new class
        {
            public function __toString()
            {
                return 'honey';
            }
        };
        $expected = '<bees>honey</bees>';
        $actual = (string) html('bees', $honey);
        $this->assertSame($expected, $actual);
    }