| Server IP : 162.214.74.102 / Your IP : 216.73.217.103 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/team/application/libraries/stripe-php/tests/ |
Upload File : |
<?php
namespace Stripe;
class InvoiceTest extends TestCase
{
public function testUpcoming()
{
self::authorizeFromEnv();
$customer = self::createTestCustomer();
InvoiceItem::create(array(
'customer' => $customer->id,
'amount' => 0,
'currency' => 'usd',
));
$invoice = Invoice::upcoming(array(
'customer' => $customer->id,
));
$this->assertSame($invoice->customer, $customer->id);
$this->assertSame($invoice->attempted, false);
}
public function testItemsAccessWithParameter()
{
self::authorizeFromEnv();
$customer = self::createTestCustomer();
InvoiceItem::create(array(
'customer' => $customer->id,
'amount' => 100,
'currency' => 'usd',
));
$invoice = Invoice::upcoming(
array(
'customer' => $customer->id,
)
);
$lines = $invoice->lines->all(array('limit' => 10));
$this->assertSame(count($lines->data), 1);
$this->assertSame($lines->data[0]->amount, 100);
}
// This is really just making sure that this operation does not trigger any
// warnings, as it's highly nested.
public function testAll()
{
self::authorizeFromEnv();
$invoices = Invoice::all();
$this->assertTrue(count($invoices) > 0);
}
}