public function test_to_string_gives_debug_tree_string() { $profileContext = TestHelper::getProfileContext(); $profileContext->getOwnEntityContext(); $profileContext->getPartyEntityContext(); $profileContext->addSubContext('assertion_01', $assertionSubContext01 = new AssertionContext()); $assertionSubContext01->addSubContext('rs', new RequestStateContext()); $actual = (string) $profileContext; $expected = <<<EOT { "root": "LightSaml\\\\Context\\\\Profile\\\\ProfileContext", "root__children": { "own_entity": "LightSaml\\\\Context\\\\Profile\\\\EntityContext", "party_entity": "LightSaml\\\\Context\\\\Profile\\\\EntityContext", "assertion_01": "LightSaml\\\\Context\\\\Profile\\\\AssertionContext", "assertion_01__children": { "rs": "LightSaml\\\\Context\\\\Profile\\\\RequestStateContext" } } } EOT; $this->assertEquals($expected, $actual); }