Skip to content

Commit

Permalink
fix: Send admin copies to admin...
Browse files Browse the repository at this point in the history
  • Loading branch information
kumy committed May 23, 2024
1 parent 2d8a773 commit 2f4c925
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected function mockeryTestSetUp() {
$this->mailer->allows()->isUnitTesting()->andReturn(true);
}

public function testNotFoundAdminsArenotAddedToTheList() {
public function testNotFoundAdminsAreNotAddedToTheList() {
$user = UserFixture::getUserFixture();

$this->mailer->shouldAllowMockingProtectedMethods();
Expand All @@ -29,11 +29,13 @@ public function testNotFoundAdminsArenotAddedToTheList() {
public function testAdminsAreAddedToTheList() {
$admin = UserFixture::getUserFixture(1);
$user = UserFixture::getUserFixture(2);
$admin_email = $admin->email;

$this->mailer->shouldAllowMockingProtectedMethods();
$this->mailer->shouldReceive('getAdmin')->once()->andReturn($admin);

$this->assertNull($this->mailer->sendCopyToAdmins($user));
$this->assertCount(1, $this->mailer->recipients);
$this->assertEquals($this->mailer->recipients[0]->email, $admin_email);
}
}
1 change: 0 additions & 1 deletion website/app/GeoKrety/Email/BasePHPMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ public function sendCopyToAdmins(User $user): void {
if (is_null($admin)) {
continue;
}
$admin->email = $user->email;
$admin->username .= $user->username.' (admin)';
$this->recipients[] = $admin;
}
Expand Down

0 comments on commit 2f4c925

Please sign in to comment.