| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function testFromApi(): void |
||
| 18 | { |
||
| 19 | $data = <<<'EOD' |
||
| 20 | { |
||
| 21 | "mbid" : "b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d", |
||
| 22 | "tmid" : 735610, |
||
| 23 | "name" : "The Beatles", |
||
| 24 | "sortName" : "Beatles, The", |
||
| 25 | "disambiguation" : "John, Paul, George and Ringo", |
||
| 26 | "url" : "https://www.setlist.fm/setlists/the-beatles-23d6a88b.html" |
||
| 27 | } |
||
| 28 | EOD; |
||
| 29 | |||
| 30 | $artist = Artist::fromApi(json_decode($data, true)); |
||
| 31 | $this->assertSame('The Beatles', $artist->getName()); |
||
| 32 | $this->assertSame('Beatles, The', $artist->getSortName()); |
||
| 33 | $this->assertSame('John, Paul, George and Ringo', $artist->getDisambiguation()); |
||
| 34 | $this->assertSame('b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d', $artist->getMbid()); |
||
| 35 | $this->assertSame(735610, $artist->getTmid()); |
||
| 36 | $this->assertSame('https://www.setlist.fm/setlists/the-beatles-23d6a88b.html', $artist->getUrl()); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |