@@ 39-55 (lines=17) @@ | ||
36 | $this->assertSame(42, $propertyMetadata->maxDepth); |
|
37 | } |
|
38 | ||
39 | public function testWithEmbeddedRelation() |
|
40 | { |
|
41 | $propertyMetadata = new RelationPropertyMetadata(null, new Relation( |
|
42 | 'foo', |
|
43 | null, |
|
44 | new Embedded('bar', array('name' => 'John')) |
|
45 | )); |
|
46 | ||
47 | $this->assertSame('foo', $propertyMetadata->name); |
|
48 | $this->assertSame('Hateoas\Configuration\Relation', $propertyMetadata->class); |
|
49 | $this->assertSame( |
|
50 | [ |
|
51 | 'name' => 'Hateoas\Model\Embedded', |
|
52 | 'params' => [], |
|
53 | ], $propertyMetadata->type |
|
54 | ); |
|
55 | } |
|
56 | ||
57 | public function testWithLinkRelation() |
|
58 | { |
|
@@ 57-72 (lines=16) @@ | ||
54 | ); |
|
55 | } |
|
56 | ||
57 | public function testWithLinkRelation() |
|
58 | { |
|
59 | $propertyMetadata = new RelationPropertyMetadata(null, new Relation( |
|
60 | 'foo', |
|
61 | new Route('/route', array('foo' => 'bar')) |
|
62 | )); |
|
63 | ||
64 | $this->assertSame('foo', $propertyMetadata->name); |
|
65 | $this->assertSame('Hateoas\Configuration\Relation', $propertyMetadata->class); |
|
66 | $this->assertSame( |
|
67 | [ |
|
68 | 'name' => 'Hateoas\Model\Link', |
|
69 | 'params' => [], |
|
70 | ], $propertyMetadata->type |
|
71 | ); |
|
72 | } |
|
73 | } |
|
74 |