Skip to content

Commit

Permalink
PHPCS for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
puntope committed Aug 28, 2023
1 parent 93584b2 commit 26b0bb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/Tools/HelperTrait/ProductTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ protected function generate_attribute_mapping_adapted_product( $rules, $categori
* @return WCProductAdapter The adapted products with the rules applied.
*/
protected function generate_attribute_mapping_adapted_product_variant( $rules, $categories = [] ) {
$variable = WC_Helper_Product::create_variation_product();
$variable = WC_Helper_Product::create_variation_product();
if ( ! empty( $categories ) ) {
$variable->set_category_ids( $categories );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@ public function test_maps_rules_product_cat() {
'source' => 'taxonomy:product_cat',
'category_condition_type' => 'ALL',
'categories' => '',
]
],
];

$category_1 = wp_insert_term( 'Zulu Category', 'product_cat' );
$category_2 = wp_insert_term( 'Alpha Category', 'product_cat' );

$adapted_product = $this->generate_attribute_mapping_adapted_product( $rules, [ $category_1['term_id'], $category_2['term_id'] ] );
$adapted_variation = $this->generate_attribute_mapping_adapted_product_variant( $rules, [ $category_1['term_id'], $category_2['term_id'] ] );
$adapted_variation = $this->generate_attribute_mapping_adapted_product_variant( $rules, [ $category_1['term_id'], $category_2['term_id'] ] );

$this->assertEquals( 'Alpha Category', $adapted_product->getBrand() );
$this->assertEquals( 'Alpha Category', $adapted_variation->getBrand() );
Expand Down

0 comments on commit 26b0bb5

Please sign in to comment.