File tree Expand file tree Collapse file tree 2 files changed +0
-22
lines changed
Expand file tree Collapse file tree 2 files changed +0
-22
lines changed Original file line number Diff line number Diff line change 66
77use JsonSerializable ;
88use Linio \SellerCenter \Contract \CollectionInterface ;
9- use Linio \SellerCenter \Exception \MaxImagesExceededException ;
109
1110class Images implements CollectionInterface, JsonSerializable
1211{
@@ -27,10 +26,6 @@ public function all(): array
2726
2827 public function add (Image $ image ): void
2928 {
30- if (count ($ this ->collection ) >= self ::MAX_IMAGES_ALLOWED ) {
31- throw new MaxImagesExceededException (self ::MAX_IMAGES_ALLOWED );
32- }
33-
3429 $ this ->collection [] = $ image ;
3530 }
3631
Original file line number Diff line number Diff line change 44
55namespace Linio \SellerCenter \Product ;
66
7- use Linio \SellerCenter \Exception \MaxImagesExceededException ;
87use Linio \SellerCenter \Factory \Xml \Product \ImagesFactory ;
98use Linio \SellerCenter \LinioTestCase ;
109use Linio \SellerCenter \Model \Product \Image ;
@@ -76,22 +75,6 @@ public function testItReturnAnArrayWithTheMaxAmountOfImagesByAddingMultipleAtOnc
7675 $ this ->assertCount (8 , $ images ->all ());
7776 }
7877
79- /**
80- * @dataProvider generatedImages
81- */
82- public function testItThrowsAnExceptionByOverflow (array $ imageStack ): void
83- {
84- $ this ->expectException (MaxImagesExceededException::class);
85- $ this ->expectExceptionMessage (sprintf ('Only %s are supported into the collection. ' , Images::MAX_IMAGES_ALLOWED ));
86-
87- $ availableImages = array_slice ($ imageStack , 0 , Images::MAX_IMAGES_ALLOWED );
88- $ image = array_slice ($ imageStack , 8 , 1 )[0 ];
89-
90- $ images = new Images ();
91- $ images ->addMany ($ availableImages );
92- $ images ->add ($ image );
93- }
94-
9578 /**
9679 * @dataProvider generatedImages
9780 */
You can’t perform that action at this time.
0 commit comments