public function testChildren() {
$parentProfile = new Profile('token_parent');
$parentProfile
->setIp('127.0.0.1');
$parentProfile
->setUrl('http://foo.bar/parent');
$childProfile = new Profile('token_child');
$childProfile
->setIp('127.0.0.1');
$childProfile
->setUrl('http://foo.bar/child');
$parentProfile
->addChild($childProfile);
$this
->getStorage()
->write($parentProfile);
$this
->getStorage()
->write($childProfile);
// Load them from storage
$parentProfile = $this
->getStorage()
->read('token_parent');
$childProfile = $this
->getStorage()
->read('token_child');
// Check child has link to parent
$this
->assertNotNull($childProfile
->getParent());
$this
->assertEquals($parentProfile
->getToken(), $childProfile
->getParentToken());
// Check parent has child
$children = $parentProfile
->getChildren();
$this
->assertCount(1, $children);
$this
->assertEquals($childProfile
->getToken(), $children[0]
->getToken());
}