verifiedEmailGateway = $this->createMock(VerifiedEmailGateway::class); $this->heskSettings = array(); $this->verifiedEmailChecker = new VerifiedEmailChecker($this->verifiedEmailGateway); } function testItGetsTheValidationStateFromTheGatewayWhenItItTrue() { //-- Arrange $this->verifiedEmailGateway->method('isEmailVerified') ->with('some email', $this->heskSettings) ->willReturn(true); //-- Act $actual = $this->verifiedEmailChecker->isEmailVerified('some email', $this->heskSettings); //-- Assert self::assertThat($actual, self::isTrue()); } function testItGetsTheValidationStateFromTheGatewayWhenItItFalse() { //-- Arrange $this->verifiedEmailGateway->method('isEmailVerified') ->with('some email', $this->heskSettings) ->willReturn(false); //-- Act $actual = $this->verifiedEmailChecker->isEmailVerified('some email', $this->heskSettings); //-- Assert self::assertThat($actual, self::isFalse()); } }