integration tests – How do I activate a plugin while testing?

Question

I want to make sure my plugin works while another plugin is activated:

    public function test_registration_3() {
        activate_plugin( 'new-user-approve/new-user-approve.php', '', false, true );
        $errors = register_new_user ( 'newuser', 'newuser@example.com' );
        $this->assertIsInt( $errors );
        wp_delete_user( $errors );
        deactivate_plugins( 'new-user-approve/new-user-approve.php' );
    }

This isn’t working. I tried the solution at PHPUnit test plugin activation but it didn’t work. My plugin is still behaving as if the other plugin is not active.

0
StevieD 3 weeks 2023-03-11T14:06:14-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse