Setting preconditions

Last updated at 23 March 2018 | Published at 04 March 2018

Often you’ll want to set up preconditions for tests. These are events recorded prior to the interaction you want to test in the current scenario. This can be provided using the given method. This method receives one or more events:

class SignUpRespectsBlackListTest extends SignUpProcessTestCase
     * @test
    public function blacklist_is_respected()
            new SignUpWasInitiated(),
            new EmailWasSpecifiedForSignUp('[email protected]')
            new FinalizeSignUpProcess()
            new SignUpWasFinalized()
Frank de Jonge

EventSauce is a project by Frank de Jonge.