1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace Test\Unit;
require_once dirname(__DIR__) . '/Setup.php';
use Test\Setup;
use Braintree;
class PayPalAccountTest extends Setup
{
public function testGet_givesErrorIfInvalidProperty()
{
$this->setExpectedException('PHPUnit_Framework_Error', 'Undefined property on Braintree\PayPalAccount: foo');
$paypalAccount = Braintree\PayPalAccount::factory([]);
$paypalAccount->foo;
}
public function testIsDefault()
{
$paypalAccount = Braintree\PayPalAccount::factory(['default' => true]);
$this->assertTrue($paypalAccount->isDefault());
$paypalAccount = Braintree\PayPalAccount::factory(['default' => false]);
$this->assertFalse($paypalAccount->isDefault());
}
public function testErrorsOnFindWithBlankArgument()
{
$this->setExpectedException('InvalidArgumentException');
Braintree\PayPalAccount::find('');
}
public function testErrorsOnFindWithWhitespaceArgument()
{
$this->setExpectedException('InvalidArgumentException');
Braintree\PayPalAccount::find(' ');
}
public function testErrorsOnFindWithWhitespaceCharacterArgument()
{
$this->setExpectedException('InvalidArgumentException');
Braintree\PayPalAccount::find('\t');
}
}