function testShouldFindChildren() { $mapper = new DataMapper($this->db); $vehicle_id = $mapper->save(array('name' => 'vehicle')); $truck_id = $mapper->save(array('name' => 'truck', 'paths' => array($vehicle_id))); $categories = $mapper->findChildren($vehicle_id); $this->assertEquals(1, count($categories), 'should find only 1 child'); $this->assertEquals($truck_id, $categories[0]['id'], 'should find "truck" as the 1 child'); }