Skip to content

Commit af85f68

Browse files
committed
0.1.9.4 30/12/2015 Merged in changes from @minioak - fixed up tests. [1.5]
Note to self added to make sure that getting a NULL in Structure:54 is OK and not downstream problem. Fixed up the remaining usage of Yaml::parse to work with v3.0 where file names no longer work.
1 parent 17856bf commit af85f68

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
0.1.9.4 30/12/2015 Merged in changes from @minioak - fixed up tests. [1.5]
23
0.1.9.0 16/10/2015 Added request1DRanges action. [0.6]
34
0.1.8.0 16/10/2015 Added an exception catcher to provide debug info in the response object. [1.89]
45
0.1.7.0 16/10/2015 Added printDocument action. [0.2]

src/Helper/Structure.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ static function processMultipleProperty($schema, $val, $defaults, $helper = NULL
5454
$multi_schema = $schema['_multiple'];
5555

5656
if (isset($multi_schema['nest_key'])) $single_schema['_key'] = '~/' . $multi_schema['nest_key'];
57-
58-
$val = isset($val) ? $val : array();
57+
58+
if (is_null($val)) $val = []; // CHECK: required param so always set, but if this is null may not want to be here in the first place.
5959

6060
$multi_values = [];
6161

src/Request/schema/createShipment.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,12 @@ properties:
208208
multi_key: item
209209

210210
numberOfItems:
211-
_help: "Number of items for the associated weight"
212-
_required: true
213-
_validate:
214-
Range:
215-
min: 0
216-
max: 99
211+
_help: "Number of items for the associated weight"
212+
_required: true
213+
_validate:
214+
Range:
215+
min: 0
216+
max: 99
217217

218218
weight:
219219
grams:

tests/resources/requests/createShipment.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ valid:
22
request:
33
requestedShipment:
44
shipmentType: 'Delivery'
5-
serviceOccurence: 1
5+
serviceOccurrence: 1
66
serviceType: T
77
serviceOffering: TRM
88
serviceFormat: P.int
@@ -30,6 +30,7 @@ valid:
3030
country: GB
3131
items:
3232
-
33+
numberOfItems: "2"
3334
weight:
3435
grams: 100
3536

@@ -38,7 +39,7 @@ valid:
3839
shipmentType:
3940
code: 'Delivery'
4041

41-
serviceOccurence: 1
42+
serviceOccurrence: 1
4243

4344
serviceType:
4445
code: T
@@ -87,10 +88,10 @@ valid:
8788
code: GB
8889

8990
items:
90-
numberOfItems: 1
9191

9292
item:
9393
-
94+
numberOfItems: "2"
9495
weight:
9596
value: 100
9697
unitOfMeasure:

tests/unit/Connector/soapConnectorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ function testWSSecurity() {
4343
->string($this->testedInstance->getAPIFormattedRequest())
4444
->contains('Username>blah<')
4545
->contains('Created>' . date_create()->format('Y-m-d')) // Do not run this test at midnight! (Or get it wet).
46-
->matches('/:Password>\w+==</');
46+
->matches('/:Password>\w+=</');
4747
}
4848
}

tests/unit/Request/BuilderTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ function testMultiplePropertyCreation() {
6565

6666

6767
static function getTestConfigs($key) {
68-
return Yaml::parse(RESOURCES_DIR . '/' . $key . '.yml');
68+
return Yaml::parse(file_get_contents(RESOURCES_DIR . '/' . $key . '.yml'));
6969
}
70-
71-
7270
}

0 commit comments

Comments
 (0)