unit testing admin password

I’m writing up unit tests for my plugin and I need a logged in user to test, but I can’t find the admin password anywhere. Does anybody know what the default admin password is? I’m extending the WP_UnitTestCase and taking the tests from https://unit-tests.svn.wordpress.org/trunk.

My code at the moment:

<?php
require_once('myPlugin.php');

class MyPluginTest extends WP_UnitTestCase{

    function setUp(){
        wp_signon(array(
            'user_login' => 'admin',
            'user_password' => 'no_idea'
        ));
    }
}

any help would be appreciated.

1 Answer
1

The password is … password. You can see that in includes/install.php:

wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password' );

The last parameter is the admin password.

Leave a Comment