Skip to content

Commit e1c9cbf

Browse files
committed
Merge pull request braintree#6 from braintree/update_travis_integration
Add badge for travis integration
2 parents b0bf56d + 6b382e0 commit e1c9cbf

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
language: php
22
php:
33
- '5.4'
4+
before_script: composer install
5+
script: vendor/bin/phpunit
46
notifications:
57
email:
68
- "external-ci-notifications+braintree_php_example@getbraintree.com"

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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+
25
An example Braintree integration for PHP.
36

47
## Setup Instructions

tests/TestHelper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
session_start();
33
require_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

810
Braintree\Configuration::environment(getenv('BT_ENVIRONMENT'));
911
Braintree\Configuration::merchantId(getenv('BT_MERCHANT_ID'));

tests/integration/CheckoutPageTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)