Conditions | 1 |
Paths | 1 |
Total Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function testFromApi(): void |
||
18 | { |
||
19 | $data = <<<'EOD' |
||
20 | { |
||
21 | "city" : { |
||
22 | "id" : "5357527", |
||
23 | "name" : "Hollywood", |
||
24 | "stateCode" : "CA", |
||
25 | "state" : "California", |
||
26 | "coords" : { |
||
27 | "long" : -118.3267434, |
||
28 | "lat" : 34.0983425 |
||
29 | }, |
||
30 | "country" : { |
||
31 | "code" : "US", |
||
32 | "name" : "United States" |
||
33 | } |
||
34 | }, |
||
35 | "url" : "https://www.setlist.fm/venue/compaq-center-san-jose-ca-usa-6bd6ca6e.html", |
||
36 | "id" : "6bd6ca6e", |
||
37 | "name" : "Compaq Center" |
||
38 | } |
||
39 | EOD; |
||
40 | |||
41 | $venue = Venue::fromApi(json_decode($data, true)); |
||
42 | $this->assertSame('6bd6ca6e', $venue->getId()); |
||
43 | $this->assertSame('Compaq Center', $venue->getName()); |
||
44 | $this->assertNotNull($venue->getCity()); |
||
45 | $this->assertSame('https://www.setlist.fm/venue/compaq-center-san-jose-ca-usa-6bd6ca6e.html', $venue->getUrl()); |
||
46 | } |
||
47 | } |
||
48 |