Created
December 17, 2014 18:02
-
-
Save iCodeForBananas/06530b108b9348532c40 to your computer and use it in GitHub Desktop.
Revisions
-
iCodeForBananas created this gist
Dec 17, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ <?php use Goutte\Client; class CatalogSignupTest extends PHPUnit_Framework_TestCase { public function test_successful_catalog_purchase_where_shipping_and_billing_are_the_same_in_washington() { $email = 'rick' . mt_rand() . '@example.com'; $url = 'http://dev.example.org/catalog/create_account.php'; // 1. Register a new user $client = new Client(); $guzzle = $client->getClient(); //You'll want to pull the Guzzle client out of Goutte to inherit its defaults $guzzle->setDefaultOption('verify', false); //Set the certificate at @mtdowling recommends $client->setClient($guzzle); //Tell Goutte to use your modified Guzzle client $crawler = $client->request('GET', $url); $form = $crawler->filter("#catalog-create-account")->form(); $crawler = $client->submit($form, array( 'firstname' => "Rick", 'lastname' => "James", 'email_address' => $email, 'state' => '62', 'country' => '203', 'password' => "testme", 'confirmation' => "testme", 'action' => 'process' )); $this->assertContains('Your Account Has Been Created!', $crawler->text()); } }