Skip to content

Commit

Permalink
Add theme name to compatibility service
Browse files Browse the repository at this point in the history
  • Loading branch information
tpaksu committed Dec 29, 2023
1 parent 60f7e86 commit ad3bc23
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelog/add-3943-send-blog-theme-to-sift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: add

Add the active theme name of the blog to the compatibility service
1 change: 1 addition & 0 deletions includes/class-compatibility-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function update_compatibility_data() {
[
'woopayments_version' => WCPAY_VERSION_NUMBER,
'woocommerce_version' => WC_VERSION,
'blog_theme' => get_stylesheet(),
]
);
} catch ( API_Exception $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/test-class-compatibility-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,19 @@ public function test_registers_woocommerce_filters_properly() {
}

public function test_update_compatibility_data() {
$stylesheet = 'my_theme_name';
add_filter(
'stylesheet',
function( $theme ) use ( $stylesheet ) {
return $stylesheet;
}
);

// Arrange: Create the expected value to be passed to update_compatibility_data.
$expected = [
'woopayments_version' => WCPAY_VERSION_NUMBER,
'woocommerce_version' => WC_VERSION,
'blog_theme' => $stylesheet,
];

// Arrange/Assert: Set the expectations for update_compatibility_data.
Expand Down

0 comments on commit ad3bc23

Please sign in to comment.