Answer the question
In order to leave comments, you need to log in
When to use Test Doubles and when to use classic?
I started with simple testing, then I came across https://martinfowler.com/articles/mocksArentStubs.... I realized that this test can be rewritten in at least 3 more ways
/**
* @test
*/
public function Email_ValidString_ChangeShouldReturnNewEmail() : void
{
$newEmail = '[email protected]';
$user = $this->user();
$user->changeEmail($newEmail);
$this->assertSame($user->email(), $newEmail);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question