public function testSetSingleLink()
{
$parent = new Resource('/dogs');
$parent->setLink(new Link('/dogs?q={text}', 'search'));
$actual = json_decode($parent);
$JSON = <<<EOF
{
"_links":{
"self":{
"href":"\\/dogs"
},
"search":{
"href":"\\/dogs?q={text}"
}
}
}
EOF;
$expected = json_decode($JSON);
$this->assertEquals($expected, $actual);
}