Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/./../app/.././../../finland.picotech.app/public_html/storage/../vendor/./nikic/../dompdf/../alexandr-mironov/../guzzlehttp/../././sebastian/lines-of-code/.././version/../../phpunit/../stripe/../markbaker/./.././africastalking/africastalking/./tests
الملفات الموجودة في هذا الـ Path:
.
..
AfricasTalkingTest.php
AirtimeTest.php
ApplicationTest.php
ContentTest.php
Fixtures.php.tpl
PaymentsTest.php
SMSTest.php
TokenTest.php
VoiceTest.php

مشاهدة ملف: TokenTest.php

<?php
namespace AfricasTalking\SDK\Tests;

use AfricasTalking\SDK\AfricasTalking;
use GuzzleHttp\Exception\GuzzleException;

class TokenTest extends \PHPUnit\Framework\TestCase
{
	public function setUp(): void
	{
			$this->username = Fixtures::$username;
			$this->apiKey 	= Fixtures::$apiKey;

			$at 			= new AfricasTalking($this->username, $this->apiKey);

			$this->client 	= $at->token();		
    }

    public function testCreateCheckoutToken()
    {
			$response = $this->client->createCheckoutToken([
                'phoneNumber' => Fixtures::$phoneNumber
            ]);

			$this->assertEquals('Success', $response['data']->description);
    }

    public function testGenerateAuthToken()
    {
			$response = $this->client->generateAuthToken();
			$this->assertEquals(3600, $response['data']->lifetimeInSeconds);
    }
}