1919use Swis \JsonApi \Client \Meta ;
2020use Swis \JsonApi \Client \Parsers \DocumentParser ;
2121use Swis \JsonApi \Client \Tests \Mocks \Items \ChildItem ;
22- use Swis \JsonApi \Client \Tests \Mocks \Items \MasterItem ;
22+ use Swis \JsonApi \Client \Tests \Mocks \Items \ParentItem ;
2323use Swis \JsonApi \Client \TypeMapper ;
2424
2525class DocumentParserTest extends TestCase
@@ -201,7 +201,7 @@ public function itThrowsWhenItFindsDuplicateResources()
201201 [
202202 'data ' => [
203203 [
204- 'type ' => 'master ' ,
204+ 'type ' => 'parent ' ,
205205 'id ' => '1 ' ,
206206 'attributes ' => [
207207 'foo ' => 'bar ' ,
@@ -210,7 +210,7 @@ public function itThrowsWhenItFindsDuplicateResources()
210210 ],
211211 'included ' => [
212212 [
213- 'type ' => 'master ' ,
213+ 'type ' => 'parent ' ,
214214 'id ' => '1 ' ,
215215 'attributes ' => [
216216 'foo ' => 'bar ' ,
@@ -232,7 +232,7 @@ public function itParsesAResourceDocument()
232232 json_encode (
233233 [
234234 'data ' => [
235- 'type ' => 'master ' ,
235+ 'type ' => 'parent ' ,
236236 'id ' => '1 ' ,
237237 'attributes ' => [
238238 'foo ' => 'bar ' ,
@@ -244,7 +244,7 @@ public function itParsesAResourceDocument()
244244
245245 $ this ->assertInstanceOf (ItemDocument::class, $ document );
246246 $ this ->assertInstanceOf (ItemInterface::class, $ document ->getData ());
247- $ this ->assertEquals ('master ' , $ document ->getData ()->getType ());
247+ $ this ->assertEquals ('parent ' , $ document ->getData ()->getType ());
248248 $ this ->assertEquals ('1 ' , $ document ->getData ()->getId ());
249249 }
250250
@@ -259,7 +259,7 @@ public function itParsesAResourceCollectionDocument()
259259 [
260260 'data ' => [
261261 [
262- 'type ' => 'master ' ,
262+ 'type ' => 'parent ' ,
263263 'id ' => '1 ' ,
264264 'attributes ' => [
265265 'foo ' => 'bar ' ,
@@ -273,7 +273,7 @@ public function itParsesAResourceCollectionDocument()
273273 $ this ->assertInstanceOf (CollectionDocument::class, $ document );
274274 $ this ->assertInstanceOf (Collection::class, $ document ->getData ());
275275 $ this ->assertCount (1 , $ document ->getData ());
276- $ this ->assertEquals ('master ' , $ document ->getData ()->get (0 )->getType ());
276+ $ this ->assertEquals ('parent ' , $ document ->getData ()->get (0 )->getType ());
277277 $ this ->assertEquals ('1 ' , $ document ->getData ()->get (0 )->getId ());
278278 }
279279
@@ -308,7 +308,7 @@ public function itParsesIncluded()
308308 'data ' => [],
309309 'included ' => [
310310 [
311- 'type ' => 'master ' ,
311+ 'type ' => 'parent ' ,
312312 'id ' => '1 ' ,
313313 'attributes ' => [
314314 'foo ' => 'bar ' ,
@@ -322,7 +322,7 @@ public function itParsesIncluded()
322322 $ this ->assertInstanceOf (CollectionDocument::class, $ document );
323323 $ this ->assertInstanceOf (Collection::class, $ document ->getIncluded ());
324324 $ this ->assertCount (1 , $ document ->getIncluded ());
325- $ this ->assertEquals ('master ' , $ document ->getIncluded ()->get (0 )->getType ());
325+ $ this ->assertEquals ('parent ' , $ document ->getIncluded ()->get (0 )->getType ());
326326 $ this ->assertEquals ('1 ' , $ document ->getIncluded ()->get (0 )->getId ());
327327 }
328328
@@ -332,15 +332,15 @@ public function itParsesIncluded()
332332 public function itLinksSingularRelationsToItemsFromIncluded ()
333333 {
334334 $ typeMapper = new TypeMapper ();
335- $ typeMapper ->setMapping ('master ' , MasterItem ::class);
335+ $ typeMapper ->setMapping ('parent ' , ParentItem ::class);
336336 $ typeMapper ->setMapping ('child ' , ChildItem::class);
337337 $ parser = DocumentParser::create ($ typeMapper );
338338
339339 $ document = $ parser ->parse (
340340 json_encode (
341341 [
342342 'data ' => [
343- 'type ' => 'master ' ,
343+ 'type ' => 'parent ' ,
344344 'id ' => '1 ' ,
345345 'attributes ' => [
346346 'foo ' => 'bar ' ,
@@ -367,7 +367,7 @@ public function itLinksSingularRelationsToItemsFromIncluded()
367367 )
368368 );
369369
370- $ this ->assertInstanceOf (MasterItem ::class, $ document ->getData ());
370+ $ this ->assertInstanceOf (ParentItem ::class, $ document ->getData ());
371371 $ this ->assertInstanceOf (ChildItem::class, $ document ->getData ()->child ()->getIncluded ());
372372 $ this ->assertSame ($ document ->getIncluded ()->get (0 ), $ document ->getData ()->child ()->getIncluded ());
373373 }
@@ -378,15 +378,15 @@ public function itLinksSingularRelationsToItemsFromIncluded()
378378 public function itDoesNotLinkEmptySingularRelations ()
379379 {
380380 $ typeMapper = new TypeMapper ();
381- $ typeMapper ->setMapping ('master ' , MasterItem ::class);
381+ $ typeMapper ->setMapping ('parent ' , ParentItem ::class);
382382 $ typeMapper ->setMapping ('child ' , ChildItem::class);
383383 $ parser = DocumentParser::create ($ typeMapper );
384384
385385 $ document = $ parser ->parse (
386386 json_encode (
387387 [
388388 'data ' => [
389- 'type ' => 'master ' ,
389+ 'type ' => 'parent ' ,
390390 'id ' => '1 ' ,
391391 'attributes ' => [
392392 'foo ' => 'bar ' ,
@@ -410,7 +410,7 @@ public function itDoesNotLinkEmptySingularRelations()
410410 )
411411 );
412412
413- $ this ->assertInstanceOf (MasterItem ::class, $ document ->getData ());
413+ $ this ->assertInstanceOf (ParentItem ::class, $ document ->getData ());
414414 $ this ->assertNull ($ document ->getData ()->child ()->getIncluded ());
415415 $ this ->assertInstanceOf (ChildItem::class, $ document ->getIncluded ()->get (0 ));
416416 }
@@ -421,15 +421,15 @@ public function itDoesNotLinkEmptySingularRelations()
421421 public function itLinksPluralRelationsToItemsFromIncluded ()
422422 {
423423 $ typeMapper = new TypeMapper ();
424- $ typeMapper ->setMapping ('master ' , MasterItem ::class);
424+ $ typeMapper ->setMapping ('parent ' , ParentItem ::class);
425425 $ typeMapper ->setMapping ('child ' , ChildItem::class);
426426 $ parser = DocumentParser::create ($ typeMapper );
427427
428428 $ document = $ parser ->parse (
429429 json_encode (
430430 [
431431 'data ' => [
432- 'type ' => 'master ' ,
432+ 'type ' => 'parent ' ,
433433 'id ' => '1 ' ,
434434 'attributes ' => [
435435 'foo ' => 'bar ' ,
@@ -469,7 +469,7 @@ public function itLinksPluralRelationsToItemsFromIncluded()
469469 )
470470 );
471471
472- $ this ->assertInstanceOf (MasterItem ::class, $ document ->getData ());
472+ $ this ->assertInstanceOf (ParentItem ::class, $ document ->getData ());
473473 $ this ->assertInstanceOf (Collection::class, $ document ->getData ()->children ()->getIncluded ());
474474 $ this ->assertInstanceOf (ChildItem::class, $ document ->getData ()->children ()->getIncluded ()->get (0 ));
475475 $ this ->assertSame ($ document ->getIncluded ()->get (0 ), $ document ->getData ()->children ()->getIncluded ()->get (0 ));
@@ -482,15 +482,15 @@ public function itLinksPluralRelationsToItemsFromIncluded()
482482 public function itDoesNotLinkEmptyPluralRelations ()
483483 {
484484 $ typeMapper = new TypeMapper ();
485- $ typeMapper ->setMapping ('master ' , MasterItem ::class);
485+ $ typeMapper ->setMapping ('parent ' , ParentItem ::class);
486486 $ typeMapper ->setMapping ('child ' , ChildItem::class);
487487 $ parser = DocumentParser::create ($ typeMapper );
488488
489489 $ document = $ parser ->parse (
490490 json_encode (
491491 [
492492 'data ' => [
493- 'type ' => 'master ' ,
493+ 'type ' => 'parent ' ,
494494 'id ' => '1 ' ,
495495 'attributes ' => [
496496 'foo ' => 'bar ' ,
@@ -521,7 +521,7 @@ public function itDoesNotLinkEmptyPluralRelations()
521521 )
522522 );
523523
524- $ this ->assertInstanceOf (MasterItem ::class, $ document ->getData ());
524+ $ this ->assertInstanceOf (ParentItem ::class, $ document ->getData ());
525525 $ this ->assertInstanceOf (Collection::class, $ document ->getData ()->children ()->getIncluded ());
526526 $ this ->assertEmpty ($ document ->getData ()->children ()->getIncluded ());
527527 $ this ->assertInstanceOf (ChildItem::class, $ document ->getIncluded ()->get (0 ));
@@ -605,15 +605,15 @@ public function itParsesMeta()
605605 public function itParsesMetaInRelationshipDataAndIncluded ()
606606 {
607607 $ typeMapper = new TypeMapper ();
608- $ typeMapper ->setMapping ('master ' , MasterItem ::class);
608+ $ typeMapper ->setMapping ('parent ' , ParentItem ::class);
609609 $ typeMapper ->setMapping ('child ' , ChildItem::class);
610610 $ parser = DocumentParser::create ($ typeMapper );
611611
612612 $ document = $ parser ->parse (
613613 json_encode (
614614 [
615615 'data ' => [
616- 'type ' => 'master ' ,
616+ 'type ' => 'parent ' ,
617617 'id ' => '1 ' ,
618618 'attributes ' => [
619619 'foo ' => 'bar ' ,
0 commit comments