Code Duplication    Length = 13-17 lines in 2 locations

test/ScopeTest.php 2 locations

@@ 78-90 (lines=13) @@
75
    /**
76
     * @covers \League\Fractal\Scope::jsonSerialize()
77
     */
78
    public function testJsonSerializable()
79
    {
80
        $manager = new Manager();
81
82
        $resource = new Item(['foo' => 'bar'], function ($data) {
83
            return $data;
84
        });
85
86
        $scope = new Scope($manager, $resource);
87
88
        $this->assertInstanceOf('\JsonSerializable', $scope);
89
        $this->assertEquals($scope->jsonSerialize(), $scope->toArray());
90
    }
91
92
    public function testToJson()
93
    {
@@ 567-583 (lines=17) @@
564
     * @covers \League\Fractal\Scope::toArray
565
     * @dataProvider fieldsetsProvider
566
     */
567
    public function testToArrayWithFieldsets($fieldsetsToParse, $expected)
568
    {
569
        $manager = new Manager();
570
571
        $resource = new Item(
572
            ['foo' => 'bar', 'baz' => 'qux'],
573
            function ($data) {
574
                return $data;
575
            },
576
            'resourceName'
577
        );
578
579
        $scope = new Scope($manager, $resource);
580
581
        $manager->parseFieldsets($fieldsetsToParse);
582
        $this->assertSame($expected, $scope->toArray());
583
    }
584
585
    public function fieldsetsProvider()
586
    {