Fix tax name with % on the Thank You page #45103
This commit is contained in:
parent
8dafe5f53b
commit
e493ac9257
|
@ -19,31 +19,36 @@ class WC_Order_Item_Tax_Test extends WC_Unit_Test_Case {
|
|||
$this->order_item_tax = new \WC_Order_Item_Tax();
|
||||
|
||||
parent::setUp();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test save label.
|
||||
* @param string $label label to save.
|
||||
* @param string $expected_label expected label.
|
||||
* @testDox Test that the label is saved correctly
|
||||
* @dataProvider data_provider_test_set_label
|
||||
*/
|
||||
public function test_set_label($label, $expected_label) {
|
||||
$this->order_item_tax->set_label($label);
|
||||
public function test_set_label( $label, $expected_label ) {
|
||||
$this->order_item_tax->set_label( $label );
|
||||
|
||||
$actual_label = $this->order_item_tax->get_label();
|
||||
|
||||
$this->assertSame($expected_label, $actual_label);
|
||||
$this->assertSame( $expected_label, $actual_label );
|
||||
}
|
||||
|
||||
public function data_provider_test_set_label() : array {
|
||||
/**
|
||||
* Data provider.
|
||||
*/
|
||||
public function data_provider_test_set_label(): array {
|
||||
return array(
|
||||
'empty' => array( '', __( 'Tax', 'woocommerce' ) ),
|
||||
'simple string' => array( 'Test Tax', 'Test Tax' ),
|
||||
'%text'=> array( 'Tax %15', 'Tax %15' ),
|
||||
'% text'=> array( 'Tax % 15', 'Tax % 15' ),
|
||||
'text%'=> array( 'Tax 15%', 'Tax 15%' ),
|
||||
'text %'=> array( 'Tax 15 %', 'Tax 15 %' ),
|
||||
'mix of special chars' => array( '<test> "Tax %15 %D0 \t' , '"Tax %15 %D0 \t'),
|
||||
'non-latin characters' => array( '%מַס %Φόρος' , '%מַס %Φόρος'),
|
||||
'%text' => array( 'Tax %15', 'Tax %15' ),
|
||||
'% text' => array( 'Tax % 15', 'Tax % 15' ),
|
||||
'text%' => array( 'Tax 15%', 'Tax 15%' ),
|
||||
'text %' => array( 'Tax 15 %', 'Tax 15 %' ),
|
||||
'mix of special chars' => array( '<test> "Tax %15 %D0 \t', '"Tax %15 %D0 \t' ),
|
||||
'non-latin characters' => array( '%מַס %Φόρος', '%מַס %Φόρος' ),
|
||||
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue