|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace Verify2\VerifyObjects; |
| 6 | + |
| 7 | +use InvalidArgumentException; |
| 8 | +use Vonage\Verify2\VerifyObjects\VerificationWorkflow; |
| 9 | +use VonageTest\VonageTestCase; |
| 10 | + |
| 11 | +class VerificationWorkflowTest extends VonageTestCase |
| 12 | +{ |
| 13 | + public function testWillTakeValidNumericFromValue(): void |
| 14 | + { |
| 15 | + $workflow = new VerificationWorkflow( |
| 16 | + VerificationWorkflow::WORKFLOW_SMS, |
| 17 | + 'xxx', |
| 18 | + '44773666552' |
| 19 | + ); |
| 20 | + |
| 21 | + $this->assertInstanceOf(VerificationWorkflow::class, $workflow); |
| 22 | + } |
| 23 | + |
| 24 | + public function testWillTakeValidAlphaFromValue(): void |
| 25 | + { |
| 26 | + $workflow = new VerificationWorkflow( |
| 27 | + VerificationWorkflow::WORKFLOW_SMS, |
| 28 | + 'xxx', |
| 29 | + 'ACMECOMPANY' |
| 30 | + ); |
| 31 | + |
| 32 | + $this->assertInstanceOf(VerificationWorkflow::class, $workflow); |
| 33 | + } |
| 34 | + |
| 35 | + public function testWillThrowErrorOnInvalidNumericFromValue(): void |
| 36 | + { |
| 37 | + $this->expectException(InvalidArgumentException::class); |
| 38 | + |
| 39 | + $workflow = new VerificationWorkflow( |
| 40 | + VerificationWorkflow::WORKFLOW_SMS, |
| 41 | + 'xxx', |
| 42 | + '3459568445' |
| 43 | + ); |
| 44 | + } |
| 45 | + |
| 46 | + public function testWillThrowErrorOnInvalidAlphaFromValue(): void |
| 47 | + { |
| 48 | + $this->expectException(InvalidArgumentException::class); |
| 49 | + |
| 50 | + $workflow = new VerificationWorkflow( |
| 51 | + VerificationWorkflow::WORKFLOW_SMS, |
| 52 | + 'xxx', |
| 53 | + 'MYAWESOMECOMPANYISTOOBIG' |
| 54 | + ); |
| 55 | + } |
| 56 | +} |
0 commit comments