I checked out (with svn) the code for Automated Testing. However, I want to run unit tests as a specific user.
Is there a way to do that? That is, is there a way to loggin with php code alone?
I checked out (with svn) the code for Automated Testing. However, I want to run unit tests as a specific user.
Is there a way to do that? That is, is there a way to loggin with php code alone?
You must be logged in to post a comment.
as long as the class that you define the testcase in inherits from
WPTestCase
, then you can use the_make_user
function. The function is found in this svn repository, and is defined inwp-testlib/base.php
line 380.NEW:
I switched to using
wp_insert_user
.the following is in my setUp:
and the following is in my teardown: