23 lines
553 B
PHP
23 lines
553 B
PHP
<?php
|
|
|
|
class Stripe_ErrorTest extends UnitTestCase
|
|
{
|
|
public function testCreation()
|
|
{
|
|
try {
|
|
throw new Stripe_Error(
|
|
"hello",
|
|
500,
|
|
"{'foo':'bar'}",
|
|
array('foo' => 'bar')
|
|
);
|
|
$this->fail("Did not raise error");
|
|
} catch (Stripe_Error $e) {
|
|
$this->assertEqual("hello", $e->getMessage());
|
|
$this->assertEqual(500, $e->getHttpStatus());
|
|
$this->assertEqual("{'foo':'bar'}", $e->getHttpBody());
|
|
$this->assertEqual(array('foo' => 'bar'), $e->getJsonBody());
|
|
}
|
|
}
|
|
}
|