Skip to content
Snippets Groups Projects
Commit 95647ffa authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Tests

parent 66fffbb4
No related branches found
No related tags found
1 merge request!1Init
Pipeline #2611 passed
<?php
use WP_Mock\Tools\TestCase;
use WPDesk\Packer\Box\BoxImplementation;
use WpDesk\WooCommerce\ShippingMethod\BuiltInBox;
use WpDesk\WooCommerce\ShippingMethod\Labels;
use WpDesk\WooCommerce\ShippingMethod\SettingsField;
use WpDesk\WooCommerce\ShippingMethod\Fields\SenderAddress\Labels;
use WpDesk\WooCommerce\ShippingMethod\Fields\SenderAddress\SettingsField;
class Test_SettingsField extends TestCase {
......@@ -47,24 +45,16 @@ class Test_SettingsField extends TestCase {
$json_values = '[{"name":"value"}]';
$built_in_boxes_from_packer = array( '01' => new BoxImplementation( 100, 100, 100, 1, null, '01', '01', array( 'id' => '01' ) ) );
$built_in_boxes = array();
foreach ( $built_in_boxes_from_packer as $code => $built_in_box_from_packer ) {
$built_in_boxes[] = BuiltInBox::create_from_code_and_packer_box( $code, $built_in_box_from_packer );;
}
$this->expectOutputString('<tr valign="top">
<th scope="row" class="titledesc">
<label for="boxes">Field Title<span>Tooltip</span></label>
</th>
<td class="forminp">
<fieldset
class="settings-field-boxes"
class="settings-field-sender-address"
id="boxes_fieldset"
data-value="' . $json_values . '"
data-name="' . $field_name . '"
data-builtinboxes="' . json_encode( array_values( $built_in_boxes ) ) . '"
data-labels="' . esc_attr( json_encode( new Labels(), JSON_FORCE_OBJECT ) ) . '"
>
</fieldset>
......@@ -76,7 +66,6 @@ class Test_SettingsField extends TestCase {
'Field Title',
'<span>Tooltip</span>',
$json_values,
$built_in_boxes_from_packer,
null
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment