Skip to content

Commit

Permalink
Add more unit tests for banned emails. #5440
Browse files Browse the repository at this point in the history
  • Loading branch information
pippinsplugins committed Jun 7, 2017
1 parent 4d8b5ef commit a8d70ff
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/tests-checkout.php
Expand Up @@ -105,6 +105,28 @@ public function test_edd_is_email_banned() {
$this->assertFalse( edd_is_email_banned( 'john.zip@test.com' ) );
}

public function test_edd_is_lowercase_email_banned_with_uppcase_tld_banned() {

$emails = array();
$emails[] = '.ZIP'; // Banned TLD

edd_update_option( 'banned_emails', $emails );

$this->assertTrue( edd_is_email_banned( 'john2@test.zip' ) );
$this->assertFalse( edd_is_email_banned( 'john.zip@test.com' ) );
}

public function test_edd_is_uppercase_email_banned_with_lowercase_tld_banned() {

$emails = array();
$emails[] = '.zip'; // Banned TLD

edd_update_option( 'banned_emails', $emails );

$this->assertTrue( edd_is_email_banned( 'JOHN2@test.ZIP' ) );
$this->assertFalse( edd_is_email_banned( 'john.ZIP@test.com' ) );
}

/**
* Test SSL enforced checkout
*/
Expand Down

0 comments on commit a8d70ff

Please sign in to comment.