public function testCollectionSetContent()
    {
        $obj = new Collection();
        $subject = <<<EOD
{"collection":{"version":"1.0","href":"http:\\/\\/www.ovagraph.com\\/api\\/3\\/cycles","links":[{"href":"http:\\/\\/www.ovagraph.com\\/cycles\\/1","rel":"alternate","name":"ovagraph_cycles_table","render":"link","prompt":"View on OvaGraph.com"}],"items":[{"href":"http:\\/\\/www.ovagraph.com\\/api\\/3\\/cycles\\/589161","data":[{"name":"title","prompt":"Title","value":"Cycle #13 (Starting 1\\/7\\/14)"},{"name":"ce","prompt":"Cycle end date","value":""},{"name":"cn","prompt":"Cycle number","value":13},{"name":"cl","prompt":"Cycle length","value":0},{"name":"cs","prompt":"Cycle start date","value":"2014-01-07"},{"name":"ic","prompt":"Cycle UUID","value":589161},{"name":"ms","prompt":"Fertility meds start day","value":5},{"name":"ul","prompt":"Average Cycle Length (in OvaCue)","value":31},{"name":"uo","prompt":"\\"My\\" Revised Ovulation Day","value":17},{"name":"xa","prompt":"Exclude from the All Cycles Average?","value":0},{"name":"cn","prompt":"Notes","value":"This was the cycle where we went to Disneyland."},{"name":"days(1)","prompt":"Days","value":[689582,689583,689584,689585,689586,689587,689588,689589,689590]},{"name":"days(2)","prompt":"Days","value":[{"bf":96,"d":"2014-01-07","id":689582,"or":200,"ot":"07:31-08:00","vr":100},{"bf":99,"d":"2014-01-08","id":689583,"or":210,"ot":"07:313-08:00","vr":160},{"bf":95,"d":"2014-01-09","id":689584,"or":190,"ot":"07:31-08:00","vr":140},{"bf":100,"d":"2014-01-10","id":689585,"or":200,"ot":"07:32-08:00","vr":150},{"d":"2014-01-11","id":689586,"or":200,"ot":"07:31-08:00","vr":55},{"d":"2014-01-12","id":689587,"or":200,"ot":"07:36-08:00","vr":21},{"d":"2014-01-13","id":689588,"or":100,"ot":"07:31-08:00"},{"d":"2014-01-14","id":689589,"vr":397},{"d":"2014-01-15","id":689590,"vr":1}]}],"links":[{"href":"http:\\/\\/www.ovagraph.com\\/records\\/1\\/cycles\\/589161","rel":"alternate","name":"ovagraph_node_view","render":"link","prompt":"View on OvaGraph.com"},{"href":"http:\\/\\/www.ovagraph.com\\/cycles\\/1\\/589161\\/chart","rel":"alternate","name":"ovagraph_cycle_chart","render":"link","prompt":"View chart"},{"href":"http:\\/\\/www.ovagraph.com\\/cycles\\/1\\/589161\\/calendar","rel":"alternate","name":"ovagraph_cycle_calendar","render":"link","prompt":"View calendar"},{"href":"http:\\/\\/www.ovagraph.com\\/cycles\\/1\\/589161\\/days","rel":"alternate","name":"ovagraph_cycle_table","render":"link","prompt":"View table"},{"href":"http:\\/\\/www.ovagraph.com\\/sites\\/ovagraph.com\\/files\\/tickers\\/1\\/ovagraph-ticker-small.png","rel":"icon","name":"small_ticker","render":"image","prompt":"Small ticker image for Cycle #13 (Starting 1\\/7\\/14)"},{"href":"http:\\/\\/www.ovagraph.com\\/sites\\/ovagraph.com\\/files\\/tickers\\/1\\/ovagraph-ticker-large.png","rel":"icon","name":"large_ticker","render":"image","prompt":"Large ticker image for Cycle #13 (Starting 1\\/7\\/14)"}]}],"queries":[{"href":"http:\\/\\/www.ovagraph.com\\/api\\/3\\/cycles","rel":"subsection","prompt":"Alter the results","data":[{"name":"max","prompt":"Max cycles","value":5},{"name":"order_by","prompt":"Sort order (desc, asc)","value":"desc"},{"name":"cn","prompt":"By cycle number","value":1},{"name":"cs_from","prompt":"Minimum start date","value":""},{"name":"cs_to","prompt":"Maximum start date","value":""},{"name":"days","prompt":"Include day objects (0=none, 1=ids only, 2=full objects)","value":0},{"name":"html","prompt":"Type of html markup (0=none, 1=adaptive or fixed, 2=fixed only)?","value":1},{"name":"view","prompt":"For which view to build html? (calendar, days, chart)?","value":"chart"}]}],"template":{"data":[{"name":"cs","prompt":"Cycle start date","value":"2014-01-07"},{"name":"ms","prompt":"Fertility meds start day","value":5},{"name":"ul","prompt":"Average Cycle Length (in OvaCue)","value":31},{"name":"uo","prompt":"\\"My\\" Revised Ovulation Day","value":17},{"name":"xa","prompt":"Exclude from the All Cycles Average?","value":0},{"name":"cn","prompt":"Notes","value":"This was the cycle where we went to Disneyland."},{"name":"days","prompt":"Days","value":[{"bf":96,"d":"2014-01-07","id":689582,"or":200,"ot":"07:31-08:00","vr":100},{"bf":99,"d":"2014-01-08","or":210,"ot":"07:313-08:00","vr":160},{"bf":95,"d":"2014-01-09","or":190,"ot":"07:31-08:00","vr":140},{"bf":100,"d":"2014-01-10","or":200,"ot":"07:32-08:00","vr":150},{"d":"2014-01-11","or":200,"ot":"07:31-08:00","vr":55},{"d":"2014-01-12","or":200,"ot":"07:36-08:00","vr":21},{"d":"2014-01-13","or":100,"ot":"07:31-08:00"},{"d":"2014-01-14","vr":397},{"d":"2014-01-15","vr":1}]}]}}}
EOD;
        $return = $obj->setContent($subject);
        $this->assertInstanceOf('\\AKlump\\Http\\CollectionJson\\Collection', $return);
        $items = $obj->getItems();
        $this->assertCount(1, $items);
        $links = $obj->getLinks();
        $this->assertCount(1, $links);
        $this->assertCount(7, $obj->getTemplate()->getDataArray());
        $this->assertSame($subject, (string) $obj);
    }