This file contains data for routes to test. Place the code below into your theme's functions.php and run phpunit from inside wp-on-routes plugin directory. Before you run phpunit make sure to export WOR_SITE variable, e.g. `export WOR_SITE=http://wor.dev` from your command line interface. $routing = \WoR\Main::get_instance(); $routing->add_routes( array( 'get' => array( 'path' => '/foo/bar', 'body' => 'Hello Baz!', ) ), array( 'post' => array( 'path' => '/foo/bar', 'body' => 'Hello Baz!', ) ), array( 'get' => array( 'path' => '/foo/bar/:param', 'action' => 'wor_params_intro' ) ), array( 'get' => array( 'path' => '/foo/bar/:param1/:param2', 'action' => 'wor_params_intro_2' ) ), array( 'get' => array( 'path' => '/red/green/blue/:param?', 'body' => 'no param' ) ), array( 'get' => array( 'path' => '/red/*/blue/:param?', 'body' => 'params & splats', 'action' => 'wor_params_splats' ) ) ); function wor_print() { echo 'Param: ' . $_GET['param']; } function wor_print_2() { echo 'Params: ' . $_GET['param1'] . ', ' . $_GET['param2']; } function wor_print_3() { echo 'Params & splats: ' . $_GET['param'] . ', ' . $_GET['splats'][0]; } add_action('wor_params_intro', 'wor_print'); add_action('wor_params_intro_2', 'wor_print_2'); add_action('wor_params_splats', 'wor_print_3');