PHP Класс WC_Helper_Customer

This helper class should ONLY be used for unit tests!
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
create_customer ( $username = 'testcustomer', $password = 'hunter2', $email = '[email protected]' ) Creates a customer in the tests DB.
create_mock_customer ( ) : WC_Customer Create a mock customer for testing purposes.
get_chosen_shipping_methods ( ) : array Get the user's chosen shipping method.
get_customer_details ( ) : array Get the customer's shipping and billing info from the session.
get_expected_store_location ( ) : array Get the expected output for the store's base location settings.
get_tax_based_on ( ) : string Get the "Tax Based On" WooCommerce option.
set_chosen_shipping_methods ( $chosen_shipping_methods ) Set the user's chosen shipping method.
set_customer_details ( $customer_details ) Set the the current customer's billing details in the session.
set_tax_based_on ( string $default_shipping_method ) Set the "Tax Based On" WooCommerce option.

Описание методов

create_customer() публичный статический Метод

Creates a customer in the tests DB.
public static create_customer ( $username = 'testcustomer', $password = 'hunter2', $email = '[email protected]' )

create_mock_customer() публичный статический Метод

Create a mock customer for testing purposes.
public static create_mock_customer ( ) : WC_Customer
Результат WC_Customer

get_chosen_shipping_methods() публичный статический Метод

Get the user's chosen shipping method.
public static get_chosen_shipping_methods ( ) : array
Результат array

get_customer_details() публичный статический Метод

Get the customer's shipping and billing info from the session.
public static get_customer_details ( ) : array
Результат array

get_expected_store_location() публичный статический Метод

Get the expected output for the store's base location settings.
public static get_expected_store_location ( ) : array
Результат array

get_tax_based_on() публичный статический Метод

Get the "Tax Based On" WooCommerce option.
public static get_tax_based_on ( ) : string
Результат string base or billing

set_chosen_shipping_methods() публичный статический Метод

Set the user's chosen shipping method.
public static set_chosen_shipping_methods ( $chosen_shipping_methods )

set_customer_details() публичный статический Метод

Set the the current customer's billing details in the session.
public static set_customer_details ( $customer_details )

set_tax_based_on() публичный статический Метод

Set the "Tax Based On" WooCommerce option.
public static set_tax_based_on ( string $default_shipping_method )
$default_shipping_method string Shipping Method slug