Code Duplication    Length = 15-17 lines in 2 locations

tests/AuctionTest.php 2 locations

@@ 68-82 (lines=15) @@
65
    }
66
67
68
    public function testApiRepresentationWithPhotos()
69
    {
70
        $auction = $this->prepareTestAuction();
71
72
        $auction->setPhotos([
73
            __DIR__ . '/i.am.a.photo.file.txt'
74
        ]);
75
76
        $apiRepresentation = $auction->toApiRepresentation();
77
78
        $this->assertArrayHasKey('fields', $apiRepresentation);
79
        $this->assertEquals(5, count($apiRepresentation['fields']));
80
81
        $this->checkTestAuctionFields($apiRepresentation['fields']);
82
    }
83
84
85
    /**
@@ 89-105 (lines=17) @@
86
     * @expectedException Radowoj\Yaah\Exception
87
     * @expectedExceptionMessage Photo file is not readable
88
     */
89
    public function testApiRepresentationWithInvalidPhotos()
90
    {
91
        $auction = $this->prepareTestAuction();
92
93
        $auction->setPhotos([
94
            __DIR__ . '/i.am.not.a.photo.file.txt'
95
        ]);
96
97
        $apiRepresentation = $auction->toApiRepresentation();
98
99
        $this->assertArrayHasKey('fields', $apiRepresentation);
100
        $this->assertEquals(5, count($apiRepresentation['fields']));
101
102
        $fields = $apiRepresentation['fields'];
103
104
        $this->checkTestAuctionFields($apiRepresentation['fields']);
105
    }
106
107
}
108