/** * Test method for the <code>#toJSON()</code> function. */ public function testToJSON() { $array = WP::create()->setBackbackground('/Resources/Green.jpg')->setBackcontent('back content')->setBackground('/Resources/Red.jpg')->setBacktitle('back title')->setCount(3)->setType('Tile')->toJSON(); $this->assertCount(6, $array); $this->assertEquals('/Resources/Green.jpg', $array['wp_backbackground']); $this->assertEquals('back content', $array['wp_backcontent']); $this->assertEquals('/Resources/Red.jpg', $array['wp_background']); $this->assertEquals('back title', $array['wp_backtitle']); $this->assertEquals(3, $array['wp_count']); $this->assertEquals('Tile', $array['wp_type']); }