mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-11 03:51:25 +01:00
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Stripe;
|
|
|
|
class EphemeralKeyTest extends TestCase
|
|
{
|
|
public function testIsCreatable()
|
|
{
|
|
$this->expectsRequest(
|
|
'post',
|
|
'/v1/ephemeral_keys',
|
|
null,
|
|
["Stripe-Version: 2017-05-25"]
|
|
);
|
|
$resource = EphemeralKey::create([
|
|
"customer" => "cus_123",
|
|
], ["stripe_version" => "2017-05-25"]);
|
|
$this->assertInstanceOf("Stripe\\EphemeralKey", $resource);
|
|
}
|
|
|
|
/**
|
|
* @expectedException \InvalidArgumentException
|
|
*/
|
|
public function testIsNotCreatableWithoutAnExplicitApiVersion()
|
|
{
|
|
$resource = EphemeralKey::create([
|
|
"customer" => "cus_123",
|
|
]);
|
|
}
|
|
|
|
public function testIsDeletable()
|
|
{
|
|
$key = EphemeralKey::create([
|
|
"customer" => "cus_123",
|
|
], ["stripe_version" => "2017-05-25"]);
|
|
$this->expectsRequest(
|
|
'delete',
|
|
'/v1/ephemeral_keys/' . $key->id
|
|
);
|
|
$resource = $key->delete();
|
|
$this->assertInstanceOf("Stripe\\EphemeralKey", $resource);
|
|
}
|
|
}
|