Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.2.0 #2728

Merged
merged 35 commits into from
May 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a95c3e7
Remove Messenger settings tab
layoutd Apr 11, 2024
283bd2d
Remove messenger breadcrumbs
layoutd Apr 11, 2024
56cf714
Mark Settings_Screens/Messenger class as deprecated
layoutd Apr 11, 2024
6e3e505
Remove deprecation notice on upgrade
layoutd Apr 11, 2024
839598d
Deprecate and force false for is_messenger_enabled()
layoutd Apr 11, 2024
4c0bdcb
Don't initialize the messenger chat features
layoutd Apr 11, 2024
8ebf0c1
Remove messenger_chat property
layoutd Apr 11, 2024
5b4727c
Mark WC_Facebookcommerce_MessengerChat as deprecated
layoutd Apr 11, 2024
e02207d
Remove messenger_chat from magic method
layoutd Apr 11, 2024
4be30a5
Remove messenger_chat from facebookAdsToolboxConfig
layoutd Apr 11, 2024
8c9cd52
Delete messenger settings options on upgrade
layoutd Apr 11, 2024
1a3f668
Mark deprecated wc_facebook_is_messenger_enabled filter
layoutd Apr 11, 2024
cc1aac9
Mark deprecated messenger settings accessors and filters
layoutd Apr 11, 2024
656967b
No longer init the deprecation notice
layoutd Apr 11, 2024
fb5038a
No need to require the messenger-chat class file anymore
layoutd Apr 11, 2024
3c5092e
Upgrading will remove the deprecation notice, no need for deactivatio…
layoutd Apr 11, 2024
e70e1ef
messenger_enabled tests should always be false
layoutd Apr 12, 2024
fdf1863
Include 3.2.0 upgrade in list
layoutd Apr 12, 2024
65b9bea
Delete messenger settings screen class
layoutd Apr 16, 2024
3934ca2
Remove messenger-related filters and invoke _doing_it_wrong
layoutd Apr 16, 2024
e27d29b
Remove WC_Facebookcommerce_MessengerChat class
layoutd Apr 16, 2024
eb24fd0
Clarify class doc
layoutd Apr 16, 2024
84ea046
Remove Messenger config from reconnection URL params
layoutd Apr 16, 2024
5c6882c
Remove messenger deprecation notice handlers
layoutd Apr 16, 2024
061f40a
Remove messenger enabled data from WC Tracker info
layoutd Apr 16, 2024
611a19a
Leave only messenger enabled unit tests
layoutd Apr 16, 2024
12c8f43
Remove messenger functionality from FBE API and tests
layoutd Apr 16, 2024
731d15c
Merge pull request #2722 from woocommerce/release/3.1.15
rawdreeg Apr 16, 2024
868522a
Change is messenger enabled to expectedIncorrectUsage
layoutd Apr 17, 2024
fe752c0
Adding php8.3 to GitHub workflow for unit tests.
message-dimke Apr 22, 2024
1520f57
Adding php8.3 to GitHub workflow for PHPCS.
message-dimke Apr 23, 2024
330c1ae
Merge pull request #2727 from woocommerce/tweak/github-workflow-php83
message-dimke Apr 23, 2024
7c077bb
Merge pull request #2719 from woocommerce/remove/deprecate-facebook-m…
layoutd Apr 25, 2024
faa513f
Product version bump update
ibndawood May 1, 2024
839bf33
Changelog update
ibndawood May 1, 2024
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
Prev Previous commit
Next Next commit
Leave only messenger enabled unit tests
layoutd committed Apr 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 611a19a6a48fc4d8e2604eba1a02f70cc609af91
205 changes: 0 additions & 205 deletions tests/Unit/WCFacebookCommerceIntegrationTest.php
Original file line number Diff line number Diff line change
@@ -2447,211 +2447,6 @@ function ( $mode ) {
$this->assertEquals( WC_Facebookcommerce_Integration::PRODUCT_DESCRIPTION_MODE_STANDARD, $mode );
}

/**
* Tests get messenger locale returns default locale.
*
* @return void
*/
public function test_get_messenger_locale_no_filter_no_options() {
remove_all_filters( 'wc_facebook_messenger_locale' );
delete_option( WC_Facebookcommerce_Integration::SETTING_MESSENGER_LOCALE );

$locale = $this->integration->get_messenger_locale();

$this->assertEquals( 'en_US', $locale );
}

/**
* Tests get messenger locale no filter, returns option value.
*
* @return void
*/
public function test_get_messenger_locale_no_filter() {
remove_all_filters( 'wc_facebook_messenger_locale' );
add_option( WC_Facebookcommerce_Integration::SETTING_MESSENGER_LOCALE, 'fr-FR' );

$locale = $this->integration->get_messenger_locale();

$this->assertEquals( 'fr-FR', $locale );
}

/**
* Tests get messenger locale with filter.
*
* @return void
*/
public function test_get_messenger_locale_with_filter() {
add_filter(
'wc_facebook_messenger_locale',
function ( $locale ) {
return 'es-ES';
}
);
add_option( WC_Facebookcommerce_Integration::SETTING_MESSENGER_LOCALE, 'fr-FR' );

$locale = $this->integration->get_messenger_locale();

$this->assertEquals( 'es-ES', $locale );
}

/**
* Tests get messenger greeting with no filters and no options set, returns
* default greeting text which is also not truncated @see WC_Facebookcommerce_Integration::get_messenger_greeting_max_characters()
*
* @return void
*/
public function test_get_messenger_greeting_no_filter_no_options() {
remove_all_filters( 'wc_facebook_messenger_greeting' );
delete_option( WC_Facebookcommerce_Integration::SETTING_MESSENGER_GREETING );

$greeting = $this->integration->get_messenger_greeting();

$this->assertEquals( 'Hi! We\'re here to answer any questions you may have.', $greeting );
}

/**
* Tests get messenger greeting with no filters but the message exceeds characters
* limit so is truncated to the default 80 characters in length @see WC_Facebookcommerce_Integration::get_messenger_greeting_max_characters()
*
* @return void
*/
public function test_get_messenger_greeting_truncated_no_filter() {
remove_all_filters( 'wc_facebook_messenger_greeting' );
add_option(
WC_Facebookcommerce_Integration::SETTING_MESSENGER_GREETING,
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum pulvinar sit amet sit.'
);

$greeting = $this->integration->get_messenger_greeting();

$this->assertEquals( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum pulvinar sit', $greeting );
}

/**
* Tests get messenger greeting with filter.
*
* @return void
*/
public function test_get_messenger_greeting_truncated_with_filter() {
add_filter(
'wc_facebook_messenger_greeting',
function ( $greeting ) {
return 'Updated with filter. ' . $greeting;
}
);
add_option(
WC_Facebookcommerce_Integration::SETTING_MESSENGER_GREETING,
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum pulvinar sit amet sit.'
);

$greeting = $this->integration->get_messenger_greeting();

$this->assertEquals( 'Updated with filter. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ve', $greeting );
}

/**
* Tests get messenger greeting max characters returns default value when no filter is set.
*
* @return void
*/
public function test_get_messenger_greeting_max_characters_no_filter() {
remove_all_filters( 'wc_facebook_messenger_greeting_max_characters' );

$length = $this->integration->get_messenger_greeting_max_characters();

$this->assertEquals( 80, $length );
}

/**
* Tests get messenger greeting max character with filter which falls back to default
* if returned filter value is less than 1.
*
* @return void
*/
public function test_get_messenger_greeting_max_characters_with_filter_falls_back_to_default() {
add_filter(
'wc_facebook_messenger_greeting_max_characters',
function ( $length ) {
return 0;
}
);

$length = $this->integration->get_messenger_greeting_max_characters();

$this->assertEquals( 80, $length );
}

/**
* Tests get messenger greeting max character with filter.
*
* @return void
*/
public function test_get_messenger_greeting_max_characters_with_filter() {
add_filter(
'wc_facebook_messenger_greeting_max_characters',
function ( $length ) {
return 120;
}
);

$length = $this->integration->get_messenger_greeting_max_characters();

$this->assertEquals( 120, $length );
}

/**
* Tests get messenger color hex when no filters nor options are set.
*
* @return void
*/
public function test_get_messenger_color_hex_no_filter_no_options() {
remove_all_filters( 'wc_facebook_messenger_color_hex' );
delete_option( WC_Facebookcommerce_Integration::SETTING_MESSENGER_COLOR_HEX );

$hex = $this->integration->get_messenger_color_hex();

$this->assertEquals( '#0084ff', $hex );
}

/**
* Tests get messenger color hex returns option value when no filter is set.
*
* @return void
*/
public function test_get_messenger_color_hex_no_filter() {
remove_all_filters( 'wc_facebook_messenger_color_hex' );
add_option(
WC_Facebookcommerce_Integration::SETTING_MESSENGER_COLOR_HEX,
'#red'
);

$hex = $this->integration->get_messenger_color_hex();

$this->assertEquals( '#red', $hex );
}

/**
* Tests get messenger color hex uses filter.
*
* @return void
*/
public function test_get_messenger_color_hex_with_filter() {
add_filter(
'wc_facebook_messenger_color_hex',
function ( $hex ) {
return '#green';
}
);
add_option(
WC_Facebookcommerce_Integration::SETTING_MESSENGER_COLOR_HEX,
'#red'
);

$hex = $this->integration->get_messenger_color_hex();

$this->assertEquals( '#green', $hex );
}

/**
* Tests product catalog id option update with valid catalog id value.
*