| Conditions | 1 |
| Paths | 1 |
| Total Lines | 38 |
| Code Lines | 30 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | public function testAddFields() |
||
| 15 | { |
||
| 16 | $fragment1 = Fragment::create('articleFragment', 'article', [ |
||
| 17 | 'id', |
||
| 18 | 'title', |
||
| 19 | 'image' => Query::create()->fields([ |
||
| 20 | 'width', |
||
| 21 | 'height', |
||
| 22 | 'filename', |
||
| 23 | 'size', |
||
| 24 | ]), |
||
| 25 | ]); |
||
| 26 | |||
| 27 | $fragment2 = Fragment::create('articleFragment', 'article')->fields([ |
||
| 28 | 'id', |
||
| 29 | 'title', |
||
| 30 | 'image' => Query::create()->fields([ |
||
| 31 | 'width', |
||
| 32 | 'height', |
||
| 33 | 'filename', |
||
| 34 | 'size', |
||
| 35 | ]), |
||
| 36 | ]); |
||
| 37 | |||
| 38 | $expected = |
||
| 39 | 'fragment articleFragment on article { |
||
| 40 | id |
||
| 41 | image { |
||
| 42 | filename |
||
| 43 | height |
||
| 44 | size |
||
| 45 | width |
||
| 46 | } |
||
| 47 | title |
||
| 48 | } |
||
| 49 | '; |
||
| 50 | $this->assertEquals($expected, (string) $fragment1); |
||
| 51 | $this->assertEquals($expected, (string) $fragment2); |
||
| 52 | } |
||
| 74 |