コード例 #1
0
ファイル: mockpress.php プロジェクト: rgeyer/mockpress
/**
 * Creates a new user account
 * @param string $user_name The username of the user to be created
 * @param string $password The password of the user to be created
 * @param string $email The email address of the user to be created
 * @return integer id of the user created
 */
function wpmu_create_user($user_name, $password, $email)
{
    $user_id = rand(1, 20);
    _set_users_of_blog(array(array('ID' => $user_id)));
    return $user_id;
}
コード例 #2
0
ファイル: MockPressTest.php プロジェクト: rgeyer/mockpress
 function testGetUserIdFromString()
 {
     _set_users_of_blog(array(array('ID' => 1, 'user_login' => "admin", 'user_email' => "*****@*****.**")));
     $this->assertNull(get_user_id_from_string('*****@*****.**'));
     $this->assertEquals(get_user_id_from_string('*****@*****.**'), 1);
 }