Location: PHPKode > scripts > Stripe PHP bindings > stripe-php-1.7.11/test/Stripe/InvalidRequestErrorTest.php
<?php

class Stripe_InvalidRequestErrorTest extends UnitTestCase
{
  public function testInvalidObject()
  {
    authorizeFromEnv();
    try {
      Stripe_Customer::retrieve('invalid');
    } catch (Stripe_InvalidRequestError $e) {
      $this->assertEqual(404, $e->getHttpStatus());
    }
  }

  public function testBadData()
  {
    authorizeFromEnv();
    try {
      Stripe_Charge::create();
    } catch (Stripe_InvalidRequestError $e) {
      $this->assertEqual(400, $e->getHttpStatus());
    }
  }
}
Return current item: Stripe PHP bindings