Path¶
For more complex data (array, object) you can use the path method to test something deeper in the data itself:
(new Tester((object)["key" => "value"]))
->path('key')
->assertSame('value');
By Using the path method you are making a assertion that the path is accessible. It also return a new Tester instance with the data of the path to be tested.
(new Tester((object)["key" => "value"]))
->path('key')
->assertSame('value');
The library use behind it is the symfony/property-access, make sure you read the doc https://symfony.com/doc/current/components/property_access.html