File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 11language : php
22php :
33 - ' 5.4'
4+ before_script : composer install
5+ script : vendor/bin/phpunit
46notifications :
57 email :
68 - " external-ci-notifications+braintree_php_example@getbraintree.com"
Original file line number Diff line number Diff line change 11# Braintree PHP Example
2+
3+ [ ![ Build Status] ( https://travis-ci.org/braintree/braintree_php_example.svg?branch=master )] ( https://travis-ci.org/braintree/braintree_php_example )
4+
25An example Braintree integration for PHP.
36
47## Setup Instructions
Original file line number Diff line number Diff line change 22session_start ();
33require_once ("vendor/autoload.php " );
44
5- $ dotenv = new Dotenv \Dotenv (__DIR__ . "/../ " );
6- $ dotenv ->load ();
5+ if (file_exists (__DIR__ . "/../.env " )) {
6+ $ dotenv = new Dotenv \Dotenv (__DIR__ . "/../ " );
7+ $ dotenv ->load ();
8+ }
79
810Braintree \Configuration::environment (getenv ('BT_ENVIRONMENT ' ));
911Braintree \Configuration::merchantId (getenv ('BT_MERCHANT_ID ' ));
Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ class CheckoutPageTest extends PHPUnit_Framework_TestCase
55{
66 function test_createsTransactionRedirectsToTransactionPage ()
77 {
8+ $ non_duplicate_amount = rand (1 ,100 ) . ". " . rand (1 ,99 );
89 $ fields = array (
9- 'amount ' => 10 ,
10+ 'amount ' => $ non_duplicate_amount ,
1011 'payment_method_nonce ' => "fake-valid-nonce "
1112 );
1213
@@ -30,8 +31,9 @@ function test_createsTransactionRedirectsToTransactionPage()
3031
3132 function test_displaysSuccessMessageWhenTransactionSuceeded ()
3233 {
34+ $ non_duplicate_amount = rand (1 ,100 ) . ". " . rand (1 ,99 );
3335 $ fields = array (
34- 'amount ' => 10 ,
36+ 'amount ' => $ non_duplicate_amount ,
3537 'payment_method_nonce ' => "fake-valid-nonce "
3638 );
3739
You can’t perform that action at this time.
0 commit comments