mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Improve NotificationMailerTest by adding an assertion
This assertion is performed by Prophecy's shouldBeCalled* method.
This commit is contained in:
parent
758ad9bc87
commit
207e109d1e
@ -37,7 +37,6 @@ class NotificationMailerTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testPostPersistComment(): void
|
public function testPostPersistComment(): void
|
||||||
{
|
{
|
||||||
$this->expectNotToPerformAssertions();
|
|
||||||
$user1 = (new User())->setEmail('user1@foo.com');
|
$user1 = (new User())->setEmail('user1@foo.com');
|
||||||
$user2 = (new User())->setEmail('user2@foo.com');
|
$user2 = (new User())->setEmail('user2@foo.com');
|
||||||
$user3 = (new User())->setEmail('user3@foo.com');
|
$user3 = (new User())->setEmail('user3@foo.com');
|
||||||
@ -67,7 +66,7 @@ class NotificationMailerTest extends TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}));
|
}))->shouldBeCalledTimes(2);
|
||||||
|
|
||||||
$objectManager = $this->prophesize(EntityManagerInterface::class);
|
$objectManager = $this->prophesize(EntityManagerInterface::class);
|
||||||
|
|
||||||
@ -77,7 +76,6 @@ class NotificationMailerTest extends TestCase
|
|||||||
|
|
||||||
public function testPostPersistCommentDestWithNullEmail(): void
|
public function testPostPersistCommentDestWithNullEmail(): void
|
||||||
{
|
{
|
||||||
$this->expectNotToPerformAssertions();
|
|
||||||
$user1 = (new User())->setEmail('user1@foo.com');
|
$user1 = (new User())->setEmail('user1@foo.com');
|
||||||
$user2 = (new User())->setEmail('user2@foo.com');
|
$user2 = (new User())->setEmail('user2@foo.com');
|
||||||
$user3 = (new User())->setEmail(null);
|
$user3 = (new User())->setEmail(null);
|
||||||
@ -107,7 +105,7 @@ class NotificationMailerTest extends TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}));
|
}))->shouldBeCalledTimes(1);
|
||||||
|
|
||||||
$objectManager = $this->prophesize(EntityManagerInterface::class);
|
$objectManager = $this->prophesize(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user