Location: PHPKode > scripts > Stripe PHP bindings > stripe-php-1.7.11/test/Stripe/Error.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());
    }
  }
}
Return current item: Stripe PHP bindings