diff --git a/tests/Managers/EmailManagerTest.php b/tests/Managers/EmailManagerTest.php new file mode 100644 index 0000000..7f7fb5d --- /dev/null +++ b/tests/Managers/EmailManagerTest.php @@ -0,0 +1,42 @@ +run(); + + // Trigger phpmailer configuration action. + global $phpmailer; + assert( $phpmailer instanceof PHPMailer\PHPMailer\PHPMailer ); + do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); + + // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + $this->assertSame( $phpmailer->Mailer, 'smtp' ); + $this->assertSame( $phpmailer->Host, '127.0.0.1' ); + $this->assertSame( $phpmailer->Port, 1025 ); + $this->assertSame( $phpmailer->Username, 'test' ); + $this->assertSame( $phpmailer->Password, 'test' ); + $this->assertSame( $phpmailer->SMTPAuth, true ); + $this->assertSame( $phpmailer->SMTPSecure, 'tls' ); + // phpcs:enable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + } +}