*/ private array $captured = []; private function provider(): KavehNegarProvider { $client = new MockHttpClient(function (string $method, string $url, array $options): MockResponse { $this->captured = ['method' => $method, 'url' => $url]; return new MockResponse(json_encode(['return' => ['status' => 200]])); }); return new KavehNegarProvider($client, new NullLogger(), 'TESTKEY', '10004346'); } public function testSendTemplateUsesGetWithQuery(): void { $ok = $this->provider()->sendTemplate('09120671756', 'clinicpro-otp', ['token' => '1234']); $this->assertTrue($ok); $this->assertSame('GET', $this->captured['method']); $this->assertStringContainsString('/TESTKEY/verify/lookup.json', $this->captured['url']); $this->assertStringContainsString('receptor=09120671756', $this->captured['url']); $this->assertStringContainsString('template=clinicpro-otp', $this->captured['url']); $this->assertStringContainsString('token=1234', $this->captured['url']); } public function testSendUsesGetNotPost(): void { $this->provider()->send('09120671756', 'hello'); $this->assertSame('GET', $this->captured['method']); $this->assertStringContainsString('/TESTKEY/sms/send.json', $this->captured['url']); } }