Skip to content

Commit e472cad

Browse files
authored
remove verification checks, API behaviour too unstable currently (#449)
1 parent e9881df commit e472cad

File tree

2 files changed

+0
-82
lines changed

2 files changed

+0
-82
lines changed

src/Verify2/VerifyObjects/VerificationLocale.php

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,8 @@
44

55
class VerificationLocale
66
{
7-
private array $allowedCodes = [
8-
'fr-fr',
9-
'en-gb',
10-
'en-us',
11-
'es-es',
12-
'es-us',
13-
'it-it',
14-
'de-de',
15-
'pt-br',
16-
'pt-pt',
17-
'ru-ru',
18-
'hi-in',
19-
'id-id',
20-
'he-il',
21-
'yue-cn',
22-
'ja-jp',
23-
'ar-xa',
24-
'cs-cz',
25-
'cy-gb',
26-
'el-gr',
27-
'en-au',
28-
'en-in',
29-
'es-mx',
30-
'fi-fi',
31-
'fil-ph',
32-
'fr-ca',
33-
'hu-hu',
34-
'is-is',
35-
'nb-no',
36-
'nl-nl',
37-
'pl-pl',
38-
'ro-ro',
39-
'sv-se',
40-
'th-th',
41-
'tr-tr',
42-
'vi-vn',
43-
'zh-cn',
44-
'zh-tw'
45-
];
46-
477
public function __construct(protected string $code = 'en-us')
488
{
49-
if (! in_array($code, $this->allowedCodes, true)) {
50-
throw new \InvalidArgumentException('Invalid Locale Code Provided');
51-
}
529
}
5310

5411
public function getCode(): string

test/Verify2/ClientTest.php

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -138,45 +138,6 @@ public function testCanBypassFraudCheck(): void
138138
$this->assertArrayHasKey('request_id', $result);
139139
}
140140

141-
/**
142-
* @dataProvider localeProvider
143-
*/
144-
public function testCannotRequestSMSWithInvalidLocale($locale, $valid): void
145-
{
146-
if (!$valid) {
147-
$this->expectException(\InvalidArgumentException::class);
148-
}
149-
150-
$verificationLocale = new VerificationLocale($locale);
151-
152-
$payload = [
153-
'to' => '07785254785',
154-
'client_ref' => 'my-verification',
155-
'brand' => 'my-brand',
156-
'locale' => $verificationLocale,
157-
];
158-
159-
$smsVerification = new SMSRequest($payload['to'], $payload['brand'], $payload['locale']);
160-
$smsVerification->setClientRef($payload['client_ref']);
161-
162-
$this->vonageClient->send(Argument::that(function (Request $request) use ($payload) {
163-
$this->assertEquals(
164-
'Basic ',
165-
mb_substr($request->getHeaders()['Authorization'][0], 0, 6)
166-
);
167-
168-
$this->assertRequestJsonBodyContains('locale', $payload['locale']->getCode(), $request);
169-
$this->assertEquals('POST', $request->getMethod());
170-
171-
return true;
172-
}))->willReturn($this->getResponse('verify-request-success', 202));
173-
174-
$result = $this->verify2Client->startVerification($smsVerification);
175-
176-
$this->assertIsArray($result);
177-
$this->assertArrayHasKey('request_id', $result);
178-
}
179-
180141
/**
181142
* @dataProvider timeoutProvider
182143
*/

0 commit comments

Comments
 (0)