Fatal error: Uncaught Error: Call to undefined function

In your code there’s this part:

test();
ob_start();
wp_list_categories($atts);
$output = ob_get_contents();  

But I really doubt that global function called test exists on your page.

There is a function called test in your class, but it’s not static (so you can’t call it from static context unless you change it to static function test(){...}), and you should call it with self::test();