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

Fix wrong email used for gravatar #1630

Merged
merged 3 commits into from
Jul 30, 2018
Merged
Changes from 1 commit
Commits
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
Add test
  • Loading branch information
asbiin committed Jul 30, 2018
commit 2ccac0b2900c340dd6f113c27bc84fd48a0177f2
17 changes: 17 additions & 0 deletions tests/Unit/ContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,23 @@ public function test_gravatar_set_emailnotexists()
$this->assertNull($contact->getAvatarURL());
}

public function test_gravatar_set_emailbadformat()
{
$account = factory(Account::class)->create();
$contact = factory(Contact::class)->create(['account_id' => $account->id]);
$contactFieldType = factory(ContactFieldType::class)->create(['account_id' => $account->id]);
$contactField = factory(ContactField::class)->create([
'account_id' => $account->id,
'contact_id' => $contact->id,
'contact_field_type_id' => $contactFieldType->id,
'data' => ' bad%20<email@bad.com',
]);

$contact->updateGravatar();

$this->assertNull($contact->getAvatarURL());
}

public function test_gravatar_set_emailreal()
{
$account = factory(Account::class)->create();
Expand Down