-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: remove network dependent tests and fix a flaky one (#3541)
- Loading branch information
Showing
6 changed files
with
16 additions
and
445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,26 +51,6 @@ private static function get_test_email( $type ) { | |
* Email setup & defaults generation. | ||
*/ | ||
public function test_emails_setup() { | ||
self::assertEquals( | ||
Emails::get_emails( [ 'test-email-config' ] ), | ||
[], | ||
'Emails are empty until configured.' | ||
); | ||
self::assertFalse( | ||
Emails::can_send_email( 'test-email-config' ), | ||
'Test email cannot be sent.' | ||
); | ||
self::assertFalse( | ||
Emails::supports_emails(), | ||
'Emails are not configured until the Newspack Newsletters plugin is active.' | ||
); | ||
$send_result = Emails::send_email( | ||
'test-email-config', | ||
'[email protected]' | ||
); | ||
self::assertFalse( $send_result, 'Email cannot be sent until the instance is configured.' ); | ||
|
||
Plugin_Manager::activate( 'newspack-newsletters' ); | ||
self::assertTrue( | ||
Emails::supports_emails(), | ||
'Emails are configured after Newspack Newsletters plugin is active.' | ||
|
@@ -104,8 +84,6 @@ public function test_emails_setup() { | |
* Email sending, with a template. | ||
*/ | ||
public function test_emails_send_with_template() { | ||
Plugin_Manager::activate( 'newspack-newsletters' ); | ||
|
||
$test_email = self::get_test_email( 'test-email-config' ); | ||
|
||
$recipient = '[email protected]'; | ||
|
@@ -152,7 +130,6 @@ public function test_emails_send_with_template() { | |
* Sending by email id. | ||
*/ | ||
public function test_emails_send_by_id() { | ||
Plugin_Manager::activate( 'newspack-newsletters' ); | ||
$test_email = self::get_test_email( 'test-email-config' ); | ||
|
||
$send_result = Emails::send_email( | ||
|
@@ -172,7 +149,6 @@ public function test_emails_send_by_id() { | |
* Email post status handling. | ||
*/ | ||
public function test_emails_status() { | ||
Plugin_Manager::activate( 'newspack-newsletters' ); | ||
$test_email = self::get_test_email( 'test-email-config' ); | ||
wp_update_post( | ||
[ | ||
|
Oops, something went wrong.