-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathServicePointsTest.php
More file actions
54 lines (42 loc) · 1.75 KB
/
ServicePointsTest.php
File metadata and controls
54 lines (42 loc) · 1.75 KB
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
45
46
47
48
49
50
51
52
53
54
<?php
namespace Mvdnbrk\DhlParcel\Tests\Feature\Endpoints;
use Illuminate\Support\Collection;
use Mvdnbrk\DhlParcel\Endpoints\ServicePoints;
use Mvdnbrk\DhlParcel\Resources\ServicePoint as ServicePointResource;
use Mvdnbrk\DhlParcel\Tests\TestCase;
/** @group integration */
class ServicePointsTest extends TestCase
{
/** @test */
public function it_can_set_the_postal_code()
{
$servicePoints = new ServicePoints($this->client);
$servicePoints->setPostalCode('1234AA');
$this->assertEquals('1234AA', $servicePoints->postal_code);
$servicePoints->setPostalCode('1234xy');
$this->assertEquals('1234XY', $servicePoints->postal_code);
$servicePoints->setPostalCode('1234 AA');
$this->assertEquals('1234AA', $servicePoints->postal_code);
}
/** @test */
public function it_can_set_the_housenumber()
{
$servicePoints = new ServicePoints($this->client);
$servicePoints->setHouseNumber('111');
$this->assertEquals('111', $servicePoints->housenumber);
}
/** @test */
public function it_can_retrieve_service_points()
{
$servicepoints = $this->client->servicePoints->setPostalcode('1012AA')->setHousenumber('1')->get();
$this->assertInstanceOf(Collection::class, $servicepoints);
$this->assertInstanceOf(ServicePointResource::class, $servicepoints->first());
}
/** @test */
public function it_can_retrieve_service_points_with_country()
{
$servicepoints = $this->client->servicePoints->setPostalcode('10115')->setHousenumber('1')->setCountry('DE')->get();
$this->assertInstanceOf(Collection::class, $servicepoints);
$this->assertInstanceOf(ServicePointResource::class, $servicepoints->first());
}
}