!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/dokan/script/vendor/omnipay/stripe/tests/Message/   drwxrwxrwx
Free 13.09 GB of 57.97 GB (22.59%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ResponseTest.php (9.48 KB)      -rwxrwxrwx
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Omnipay\Stripe\Message;

use 
Omnipay\Tests\TestCase;

class 
ResponseTest extends TestCase
{
    public function 
testPurchaseSuccess()
    {
        
$httpResponse $this->getMockHttpResponse('PurchaseSuccess.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertTrue($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertSame('ch_1IU9gcUiNASROd'$response->getTransactionReference());
        
$this->assertSame('card_16n3EU2baUhq7QENSrstkoN0'$response->getCardReference());
        
$this->assertNull($response->getMessage());
        
$this->assertInternalType('array'$response->getSource());
    }

    public function 
testPurchaseWithSourceSuccess()
    {
        
$httpResponse $this->getMockHttpResponse('PurchaseWithSourceSuccess.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertTrue($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertSame('ch_1IU9gcUiNASROd'$response->getTransactionReference());
        
$this->assertSame('card_15WgqxIobxWFFmzdk5V9z3g9'$response->getCardReference());
        
$this->assertNull($response->getMessage());
    }

    public function 
testPurchaseFailure()
    {
        
$httpResponse $this->getMockHttpResponse('PurchaseFailure.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertFalse($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertSame('ch_1IUAZQWFYrPooM'$response->getTransactionReference());
        
$this->assertNull($response->getCardReference());
        
$this->assertSame('Your card was declined'$response->getMessage());
        
$this->assertNull($response->getSource());
    }

    public function 
testPurchaseFailureWithoutMessage()
    {
        
$httpResponse $this->getMockHttpResponse('PurchaseFailureWithoutMessage.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertFalse($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertSame('ch_1JEJGNWFYxAwgF'$response->getTransactionReference());
        
$this->assertNull($response->getCardReference());
        
$this->assertNull($response->getMessage());
        
$this->assertNull($response->getSource());
    }

    public function 
testPurchaseFailureWithoutCode()
    {
        
$httpResponse $this->getMockHttpResponse('PurchaseFailureWithoutCode.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertFalse($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertSame('ch_1KGNWMAOUdAbbC'$response->getTransactionReference());
        
$this->assertNull($response->getCardReference());
        
$this->assertNull($response->getCode());
        
$this->assertNull($response->getSource());
    }

    public function 
testCreateCustomerSuccess()
    {
        
$httpResponse $this->getMockHttpResponse('CreateCustomerSuccess.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertTrue($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertSame('cus_1MZSEtqSghKx99'$response->getCustomerReference());
        
$this->assertNull($response->getMessage());
    }

    public function 
testCreateCustomerFailure()
    {
        
$httpResponse $this->getMockHttpResponse('CreateCustomerFailure.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertFalse($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertNull($response->getCustomerReference());
        
$this->assertSame('You must provide an integer value for \'exp_year\'.'$response->getMessage());
    }

    public function 
testUpdateCustomerSuccess()
    {
        
$httpResponse $this->getMockHttpResponse('UpdateCustomerSuccess.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertTrue($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertSame('cus_1MZeNih5LdKxDq'$response->getCustomerReference());
        
$this->assertNull($response->getMessage());
    }

    public function 
testUpdateCustomerFailure()
    {
        
$httpResponse $this->getMockHttpResponse('UpdateCustomerFailure.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertFalse($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertNull($response->getCustomerReference());
        
$this->assertSame('No such customer: cus_1MZeNih5LdKxDq'$response->getMessage());
    }

    public function 
testDeleteCustomerSuccess()
    {
        
$httpResponse $this->getMockHttpResponse('DeleteCustomerSuccess.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertTrue($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertNull($response->getCustomerReference());
        
$this->assertNull($response->getMessage());
    }

    public function 
testDeleteCustomerFailure()
    {
        
$httpResponse $this->getMockHttpResponse('DeleteCustomerFailure.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertFalse($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertNull($response->getCustomerReference());
        
$this->assertSame('No such customer: cus_1MZeNih5LdKxDq'$response->getMessage());
    }

    public function 
testCreateCardSuccess()
    {
        
$httpResponse $this->getMockHttpResponse('CreateCardSuccess.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertTrue($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertSame('card_15WgqxIobxWFFmzdk5V9z3g9'$response->getCardReference());
        
$this->assertNull($response->getMessage());
    }

    public function 
testCreateCardFailure()
    {
        
$httpResponse $this->getMockHttpResponse('CreateCardFailure.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertFalse($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertNull($response->getCardReference());
        
$this->assertSame('You must provide an integer value for \'exp_year\'.'$response->getMessage());
    }

    public function 
testUpdateCardSuccess()
    {
        
$httpResponse $this->getMockHttpResponse('UpdateCardSuccess.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertTrue($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertSame('cus_1MZeNih5LdKxDq'$response->getCardReference());
        
$this->assertNull($response->getMessage());
    }

    public function 
testUpdateCardFailure()
    {
        
$httpResponse $this->getMockHttpResponse('UpdateCardFailure.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertFalse($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertNull($response->getCardReference());
        
$this->assertSame('No such customer: cus_1MZeNih5LdKxDq'$response->getMessage());
    }

    public function 
testDeleteCardSuccess()
    {
        
$httpResponse $this->getMockHttpResponse('DeleteCardSuccess.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertTrue($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertNull($response->getCardReference());
        
$this->assertNull($response->getMessage());
    }

    public function 
testDeleteCardFailure()
    {
        
$httpResponse $this->getMockHttpResponse('DeleteCardFailure.txt');
        
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());

        
$this->assertFalse($response->isSuccessful());
        
$this->assertFalse($response->isRedirect());
        
$this->assertNull($response->getTransactionReference());
        
$this->assertNull($response->getCardReference());
        
$this->assertSame('No such customer: cus_1MZeNih5LdKxDq'$response->getMessage());
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0078 ]--