Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions inc/admin-pages/customer-panel/class-checkout-admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ public function output(): void {
wu_get_template(
'base/centered',
[
'screen' => get_current_screen(),
'page' => $this,
'content' => '[wu_checkout slug="wu-checkout"]',
'screen' => get_current_screen(),
'page' => $this,
'page_title' => $this->get_title(),
'content' => '[wu_checkout slug="wu-checkout"]',
]
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public function test_to_fields_array_with_domain_selection(): void {
'display_field_attachments' => false,
'enable_domain_selection' => true,
'available_domains' => "example.com\nexample.org",
'available_domains_multi' => "example.com\nexample.org",
];

$this->field->set_attributes($attributes);
Expand Down
7 changes: 4 additions & 3 deletions tests/WP_Ultimo/List_Tables/Checkout_Form_List_Table_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,20 @@ public function test_get_columns_returns_expected_keys(): void {
$this->assertIsArray( $columns );
$this->assertArrayHasKey( 'cb', $columns );
$this->assertArrayHasKey( 'name', $columns );
$this->assertArrayHasKey( 'active', $columns );
$this->assertArrayHasKey( 'slug', $columns );
$this->assertArrayHasKey( 'steps', $columns );
$this->assertArrayHasKey( 'id', $columns );
}

/**
* Test get_columns returns 5 columns.
* Test get_columns returns 6 columns.
*/
public function test_get_columns_returns_five_columns(): void {
public function test_get_columns_returns_six_columns(): void {

$columns = $this->table->get_columns();

$this->assertCount( 5, $columns );
$this->assertCount( 6, $columns );
}

// =========================================================================
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/API_Schema_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function test_checkout_form_create_optional_fields(): void {
public function test_checkout_form_create_template_enum(): void {
$schema = $this->load_schema('checkout-form-create.php');
$this->assertArrayHasKey('template', $schema);
$this->assertSame(['blank', 'single-step', 'multi-step'], $schema['template']['enum']);
$this->assertSame(['blank', 'single-step', 'multi-step', 'simple'], $schema['template']['enum']);
}

/**
Expand Down Expand Up @@ -305,7 +305,7 @@ public function test_checkout_form_update_settings_type_is_array(): void {
public function test_checkout_form_update_template_enum(): void {
$schema = $this->load_schema('checkout-form-update.php');
$this->assertArrayHasKey('template', $schema);
$this->assertSame(['blank', 'single-step', 'multi-step'], $schema['template']['enum']);
$this->assertSame(['blank', 'single-step', 'multi-step', 'simple'], $schema['template']['enum']);
}

// =========================================================================
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Checkout_Request_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@

final class Checkout_Request_Test extends TestCase {

public function test_request_or_session_accepts_empty_string(): void {

Check warning on line 6 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed
// Ensure empty string in request overrides any default/session value

Check warning on line 7 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed
$_REQUEST['discount_code'] = '';

Check warning on line 8 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed

$checkout = new \WP_Ultimo\Checkout\Checkout();
$checkout = \WP_Ultimo\Checkout\Checkout::get_instance();

Check warning on line 10 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed

$value = $checkout->request_or_session('discount_code', 'DEFAULT');

Check warning on line 12 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed

$this->assertSame('', $value, 'Expected empty discount_code to be honored (clear code).');

Check warning on line 14 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed

unset($_REQUEST['discount_code']);

Check warning on line 16 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed
}

Check warning on line 17 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed

/**

Check warning on line 19 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed
* Verify that get_checkout_variables() always includes discount_code as a

Check warning on line 20 in tests/unit/Checkout_Request_Test.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Tabs must be used to indent lines; spaces are not allowed
* string so wu_checkout.discount_code is never undefined in JS.
*
* An undefined value causes the Vue watcher to fire a spurious create_order()
Expand All @@ -25,7 +25,7 @@
*/
public function test_checkout_variables_always_has_discount_code_string(): void {

$checkout = new \WP_Ultimo\Checkout\Checkout();
$checkout = \WP_Ultimo\Checkout\Checkout::get_instance();

$vars = $checkout->get_checkout_variables();

Expand Down
Loading