|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Test\Pagantis\OrdersApiClient\Model\Order; |
|
4
|
|
|
|
|
5
|
|
|
use Pagantis\OrdersApiClient\Model\Order\Configuration; |
|
6
|
|
|
use Test\Pagantis\OrdersApiClient\AbstractTest; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class ConfigurationTest |
|
10
|
|
|
* @package Test\Pagantis\OrdersApiClient\Model\Order |
|
11
|
|
|
*/ |
|
12
|
|
|
class ConfigurationTest extends AbstractTest |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* Test Constructor creates entities |
|
16
|
|
|
*/ |
|
17
|
|
|
public function testConstruct() |
|
18
|
|
|
{ |
|
19
|
|
|
$configuration = new Configuration(); |
|
20
|
|
|
$this->assertInstanceOf( |
|
21
|
|
|
'Pagantis\OrdersApiClient\Model\Order\Configuration\Channel', |
|
22
|
|
|
$configuration->getChannel() |
|
23
|
|
|
); |
|
24
|
|
|
$this->assertInstanceOf( |
|
25
|
|
|
'Pagantis\OrdersApiClient\Model\Order\Configuration\Urls', |
|
26
|
|
|
$configuration->getUrls() |
|
27
|
|
|
); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Test setter and getter for purchase country |
|
32
|
|
|
*/ |
|
33
|
|
|
public function testSetPurchaseCountry() |
|
34
|
|
|
{ |
|
35
|
|
|
$configuration = new Configuration(); |
|
36
|
|
|
$purchaseCountry = 'IT'; |
|
37
|
|
|
$configuration->setPurchaseCountry($purchaseCountry); |
|
38
|
|
|
$this->assertSame($purchaseCountry, $configuration->getPurchaseCountry()); |
|
39
|
|
|
|
|
40
|
|
|
$configuration = new Configuration(); |
|
41
|
|
|
$purchaseCountry = 'it'; |
|
42
|
|
|
$configuration->setPurchaseCountry($purchaseCountry); |
|
43
|
|
|
$this->assertSame(strtoupper($purchaseCountry), $configuration->getPurchaseCountry()); |
|
44
|
|
|
|
|
45
|
|
|
$configuration = new Configuration(); |
|
46
|
|
|
$purchaseCountry = 'en'; |
|
47
|
|
|
$configuration->setPurchaseCountry($purchaseCountry); |
|
48
|
|
|
$this->assertNull($configuration->getPurchaseCountry()); |
|
49
|
|
|
|
|
50
|
|
|
$configuration = new Configuration(); |
|
51
|
|
|
$purchaseCountry = ''; |
|
52
|
|
|
$configuration->setPurchaseCountry($purchaseCountry); |
|
53
|
|
|
$this->assertNull($configuration->getPurchaseCountry()); |
|
54
|
|
|
|
|
55
|
|
|
$configuration = new Configuration(); |
|
56
|
|
|
$purchaseCountry = null; |
|
57
|
|
|
$configuration->setPurchaseCountry($purchaseCountry); |
|
58
|
|
|
$this->assertNull($configuration->getPurchaseCountry()); |
|
59
|
|
|
} |
|
60
|
|
|
} |
|
61
|
|
|
|