public function testToArray() { $category = new Category(array('id' => 5, 'position' => 1, 'name' => 'Games', 'description' => 'Blogs relating to games')); $categoryAsArray = $category->toArray(); $this->assertEquals(5, $categoryAsArray['id']); $this->assertEquals(1, $categoryAsArray['position']); $this->assertEquals('Games', $categoryAsArray['name']); $this->assertEquals('Blogs relating to games', $categoryAsArray['description']); }
public function toArray() { $this->__load(); return parent::toArray(); }