B
B
BonBon Slick2018-05-10 16:28:14
Software testing
BonBon Slick, 2018-05-10 16:28:14

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);
    }


So what, when, why and why to apply?

Because now I'm confused.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question