Skip to content

Commit a41fe8b

Browse files
authored
Merge pull request #127 from LinioIT/fix/gsc-sdk-products-with-more-than-7-images-are-discarded
[SCP-2650] fix: gsc sdk products with more than 7 images are discarded
2 parents 826d247 + 14d6129 commit a41fe8b

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

src/Model/Product/Images.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use JsonSerializable;
88
use Linio\SellerCenter\Contract\CollectionInterface;
9-
use Linio\SellerCenter\Exception\MaxImagesExceededException;
109

1110
class 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

tests/Unit/Product/ImagesTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Linio\SellerCenter\Product;
66

7-
use Linio\SellerCenter\Exception\MaxImagesExceededException;
87
use Linio\SellerCenter\Factory\Xml\Product\ImagesFactory;
98
use Linio\SellerCenter\LinioTestCase;
109
use 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
*/

0 commit comments

Comments
 (0)