1

I am new to php and experimenting with unit_testing and wp_mock. I have an issue which I am unable to resolve. Please could somebody point me in the right direction.

I have a basic class Plugin, within Rcc_Plugin I am trying to call the method in Test_Rcc_Plugin extends TestCase, as below.

 $rcc_plugin = $this->get_subject();

This method returns a singleton which contains the method register()

When I call $rcc_plugin->register() in the test; I get undefined method in vscode intelephense.

I've tried to find a way to solve this by checking namespaces etc. The rcc_plugin class is in another file, init.php.

class RCC_Plugin {
    public function register()
    {
        // declare the shortcode
        add_shortcode('rcc-django-data', array($this, 'load_events'));
    }
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.