diff --git a/test/unit/php/includes/core/classes/endpoints/class-test-endpoint.php b/test/unit/php/includes/core/classes/endpoints/class-test-endpoint.php new file mode 100644 index 000000000..22f9e23d4 --- /dev/null +++ b/test/unit/php/includes/core/classes/endpoints/class-test-endpoint.php @@ -0,0 +1,87 @@ + 'endpoint-template.php', + 'dir_path' => '/path/to/theme', + ); + }; + $plugin_default = '/mock/plugin/templates'; + $template_default = '/default/template.php'; + + // Create a mock for Endpoint. + $endpoint_template = new Endpoint_Template( $slug, $callback, $plugin_default ); + + } */ + + /** + * Coverage for get_slugs method. + * + * @covers ::get_slugs + * + * @return void + */ + public function test_get_slugs(): void { + + // // Simulate 'init' hook being fired + // \do_action('init'); + + $callback = function(){}; + $instance = new Endpoint( + 'query_var', + 'post', + $callback, + array( + new Endpoint_Template( 'endpoint_template_1', $callback ), + new Endpoint_Template( 'endpoint_template_2', $callback ), + new Endpoint_Redirect( 'endpoint_redirect_1', $callback ), + ), + 'reg_ex', + ); + // var_dump($instance->types); + + $this->assertSame( + array( + 'endpoint_template_1', + 'endpoint_template_2', + 'endpoint_redirect_1', + ), + Utility::invoke_hidden_method( $instance, 'get_slugs' ), + 'Failed to assert that endpoint slugs match.' + ); + + // $this->mock->wp()->reset(); + + } + +}