@@ -127,7 +127,7 @@ public function testCreateUploadsProvidedFileContent()
127
127
'title ' => 'Title ' ,
128
128
'sort_order ' => 1 ,
129
129
'price ' => 10.1 ,
130
- 'is_shareable ' => true ,
130
+ 'is_shareable ' => 1 ,
131
131
'number_of_downloads ' => 100 ,
132
132
'link_type ' => 'file ' ,
133
133
'link_file_content ' => [
@@ -151,7 +151,7 @@ public function testCreateUploadsProvidedFileContent()
151
151
$ this ->assertEquals ($ requestData ['link ' ]['sort_order ' ], $ link ->getSortOrder ());
152
152
$ this ->assertEquals ($ requestData ['link ' ]['price ' ], $ link ->getPrice ());
153
153
$ this ->assertEquals ($ requestData ['link ' ]['price ' ], $ globalScopeLink ->getPrice ());
154
- $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], $ link ->getIsShareable ());
154
+ $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], ( int ) $ link ->getIsShareable ());
155
155
$ this ->assertEquals ($ requestData ['link ' ]['number_of_downloads ' ], $ link ->getNumberOfDownloads ());
156
156
$ this ->assertEquals ($ requestData ['link ' ]['link_type ' ], $ link ->getLinkType ());
157
157
$ this ->assertEquals ($ requestData ['link ' ]['sample_type ' ], $ link ->getSampleType ());
@@ -173,7 +173,7 @@ public function testCreateSavesPriceAndTitleInStoreViewScope()
173
173
'title ' => 'Store View Title ' ,
174
174
'sort_order ' => 1 ,
175
175
'price ' => 150 ,
176
- 'is_shareable ' => true ,
176
+ 'is_shareable ' => 1 ,
177
177
'number_of_downloads ' => 100 ,
178
178
'link_url ' => 'http://www.example.com/ ' ,
179
179
'link_type ' => 'url ' ,
@@ -189,7 +189,7 @@ public function testCreateSavesPriceAndTitleInStoreViewScope()
189
189
$ this ->assertEquals ($ requestData ['link ' ]['title ' ], $ link ->getTitle ());
190
190
$ this ->assertEquals ($ requestData ['link ' ]['sort_order ' ], $ link ->getSortOrder ());
191
191
$ this ->assertEquals ($ requestData ['link ' ]['price ' ], $ link ->getPrice ());
192
- $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], $ link ->getIsShareable ());
192
+ $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], ( int ) $ link ->getIsShareable ());
193
193
$ this ->assertEquals ($ requestData ['link ' ]['number_of_downloads ' ], $ link ->getNumberOfDownloads ());
194
194
$ this ->assertEquals ($ requestData ['link ' ]['link_url ' ], $ link ->getLinkUrl ());
195
195
$ this ->assertEquals ($ requestData ['link ' ]['link_type ' ], $ link ->getLinkType ());
@@ -211,7 +211,7 @@ public function testCreateSavesProvidedUrls()
211
211
'title ' => 'Link with URL resources ' ,
212
212
'sort_order ' => 1 ,
213
213
'price ' => 10.1 ,
214
- 'is_shareable ' => true ,
214
+ 'is_shareable ' => 1 ,
215
215
'number_of_downloads ' => 100 ,
216
216
'link_url ' => 'http://www.example.com/ ' ,
217
217
'link_type ' => 'url ' ,
@@ -226,7 +226,7 @@ public function testCreateSavesProvidedUrls()
226
226
$ this ->assertEquals ($ requestData ['link ' ]['title ' ], $ link ->getTitle ());
227
227
$ this ->assertEquals ($ requestData ['link ' ]['sort_order ' ], $ link ->getSortOrder ());
228
228
$ this ->assertEquals ($ requestData ['link ' ]['price ' ], $ link ->getPrice ());
229
- $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], $ link ->getIsShareable ());
229
+ $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], ( int ) $ link ->getIsShareable ());
230
230
$ this ->assertEquals ($ requestData ['link ' ]['number_of_downloads ' ], $ link ->getNumberOfDownloads ());
231
231
$ this ->assertEquals ($ requestData ['link ' ]['link_url ' ], $ link ->getLinkUrl ());
232
232
$ this ->assertEquals ($ requestData ['link ' ]['link_type ' ], $ link ->getLinkType ());
@@ -248,7 +248,7 @@ public function testCreateThrowsExceptionIfLinkTypeIsNotSpecified()
248
248
'title ' => 'Link with URL resources ' ,
249
249
'sort_order ' => 1 ,
250
250
'price ' => 10.1 ,
251
- 'is_shareable ' => true ,
251
+ 'is_shareable ' => 1 ,
252
252
'number_of_downloads ' => 100 ,
253
253
'link_type ' => 'invalid ' ,
254
254
'sample_type ' => 'url ' ,
@@ -273,7 +273,7 @@ public function testCreateThrowsExceptionIfLinkFileContentIsNotAValidBase64Encod
273
273
'title ' => 'Link Title ' ,
274
274
'sort_order ' => 1 ,
275
275
'price ' => 10 ,
276
- 'is_shareable ' => true ,
276
+ 'is_shareable ' => 1 ,
277
277
'number_of_downloads ' => 100 ,
278
278
'link_type ' => 'url ' ,
279
279
'link_url ' => 'http://www.example.com/ ' ,
@@ -302,7 +302,7 @@ public function testCreateThrowsExceptionIfSampleFileContentIsNotAValidBase64Enc
302
302
'title ' => 'Link Title ' ,
303
303
'sort_order ' => 1 ,
304
304
'price ' => 10 ,
305
- 'is_shareable ' => true ,
305
+ 'is_shareable ' => 1 ,
306
306
'number_of_downloads ' => 100 ,
307
307
'link_type ' => 'file ' ,
308
308
'link_file_content ' => [
@@ -331,7 +331,7 @@ public function testCreateThrowsExceptionIfLinkFileNameContainsForbiddenCharacte
331
331
'title ' => 'Title ' ,
332
332
'sort_order ' => 15 ,
333
333
'price ' => 10 ,
334
- 'is_shareable ' => true ,
334
+ 'is_shareable ' => 1 ,
335
335
'number_of_downloads ' => 100 ,
336
336
'link_type ' => 'file ' ,
337
337
'link_file_content ' => [
@@ -360,7 +360,7 @@ public function testCreateThrowsExceptionIfSampleFileNameContainsForbiddenCharac
360
360
'title ' => 'Link Title ' ,
361
361
'sort_order ' => 1 ,
362
362
'price ' => 10 ,
363
- 'is_shareable ' => true ,
363
+ 'is_shareable ' => 1 ,
364
364
'number_of_downloads ' => 100 ,
365
365
'link_type ' => 'url ' ,
366
366
'link_url ' => 'http://www.example.com/ ' ,
@@ -389,7 +389,7 @@ public function testCreateThrowsExceptionIfLinkUrlHasWrongFormat()
389
389
'title ' => 'Link Title ' ,
390
390
'sort_order ' => 1 ,
391
391
'price ' => 10 ,
392
- 'is_shareable ' => true ,
392
+ 'is_shareable ' => 1 ,
393
393
'number_of_downloads ' => 100 ,
394
394
'link_type ' => 'url ' ,
395
395
'link_url ' => 'http://example<.>com/ ' ,
@@ -415,7 +415,7 @@ public function testCreateThrowsExceptionIfSampleUrlHasWrongFormat()
415
415
'title ' => 'Link Title ' ,
416
416
'sort_order ' => 1 ,
417
417
'price ' => 150 ,
418
- 'is_shareable ' => true ,
418
+ 'is_shareable ' => 1 ,
419
419
'number_of_downloads ' => 0 ,
420
420
'sample_type ' => 'url ' ,
421
421
'sample_url ' => 'http://example<.>com/ ' ,
@@ -442,7 +442,7 @@ public function testCreateThrowsExceptionIfLinkPriceIsInvalid($linkPrice)
442
442
'title ' => 'Link Title ' ,
443
443
'sort_order ' => 1 ,
444
444
'price ' => $ linkPrice ,
445
- 'is_shareable ' => true ,
445
+ 'is_shareable ' => 1 ,
446
446
'number_of_downloads ' => 0 ,
447
447
'sample_type ' => 'url ' ,
448
448
'sample_url ' => 'http://example.com/ ' ,
@@ -479,7 +479,7 @@ public function testCreateThrowsExceptionIfSortOrderIsInvalid($sortOrder)
479
479
'title ' => 'Link Title ' ,
480
480
'sort_order ' => $ sortOrder ,
481
481
'price ' => 10 ,
482
- 'is_shareable ' => false ,
482
+ 'is_shareable ' => 0 ,
483
483
'number_of_downloads ' => 0 ,
484
484
'sample_type ' => 'url ' ,
485
485
'sample_url ' => 'http://example.com/ ' ,
@@ -515,7 +515,7 @@ public function testCreateThrowsExceptionIfNumberOfDownloadsIsInvalid($numberOfD
515
515
'title ' => 'Link Title ' ,
516
516
'sort_order ' => 0 ,
517
517
'price ' => 10 ,
518
- 'is_shareable ' => false ,
518
+ 'is_shareable ' => 0 ,
519
519
'number_of_downloads ' => $ numberOfDownloads ,
520
520
'sample_type ' => 'url ' ,
521
521
'sample_url ' => 'http://example.com/ ' ,
@@ -551,7 +551,7 @@ public function testCreateThrowsExceptionIfTargetProductTypeIsNotDownloadable()
551
551
'title ' => 'Link Title ' ,
552
552
'sort_order ' => 50 ,
553
553
'price ' => 200 ,
554
- 'is_shareable ' => false ,
554
+ 'is_shareable ' => 0 ,
555
555
'number_of_downloads ' => 10 ,
556
556
'sample_type ' => 'url ' ,
557
557
'sample_url ' => 'http://example.com/ ' ,
@@ -576,7 +576,7 @@ public function testCreateThrowsExceptionIfTargetProductDoesNotExist()
576
576
'title ' => 'Link Title ' ,
577
577
'sort_order ' => 15 ,
578
578
'price ' => 200 ,
579
- 'is_shareable ' => true ,
579
+ 'is_shareable ' => 1 ,
580
580
'number_of_downloads ' => 100 ,
581
581
'sample_type ' => 'url ' ,
582
582
'sample_url ' => 'http://example.com/ ' ,
@@ -603,7 +603,7 @@ public function testUpdate()
603
603
'title ' => 'Updated Title ' ,
604
604
'sort_order ' => 2 ,
605
605
'price ' => 100.10 ,
606
- 'is_shareable ' => false ,
606
+ 'is_shareable ' => 0 ,
607
607
'number_of_downloads ' => 50 ,
608
608
'link_type ' => 'url ' ,
609
609
'sample_type ' => 'url ' ,
@@ -615,7 +615,7 @@ public function testUpdate()
615
615
$ this ->assertEquals ($ requestData ['link ' ]['title ' ], $ link ->getTitle ());
616
616
$ this ->assertEquals ($ requestData ['link ' ]['sort_order ' ], $ link ->getSortOrder ());
617
617
$ this ->assertEquals ($ requestData ['link ' ]['price ' ], $ link ->getPrice ());
618
- $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], (bool )$ link ->getIsShareable ());
618
+ $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], (int )$ link ->getIsShareable ());
619
619
$ this ->assertEquals ($ requestData ['link ' ]['number_of_downloads ' ], $ link ->getNumberOfDownloads ());
620
620
}
621
621
@@ -636,7 +636,7 @@ public function testUpdateSavesDataInGlobalScopeAndDoesNotAffectValuesStoredInSt
636
636
'title ' => 'Updated Title ' ,
637
637
'sort_order ' => 2 ,
638
638
'price ' => 100.10 ,
639
- 'is_shareable ' => false ,
639
+ 'is_shareable ' => 0 ,
640
640
'number_of_downloads ' => 50 ,
641
641
'link_type ' => 'url ' ,
642
642
'sample_type ' => 'url ' ,
@@ -653,7 +653,7 @@ public function testUpdateSavesDataInGlobalScopeAndDoesNotAffectValuesStoredInSt
653
653
$ this ->assertEquals ($ requestData ['link ' ]['title ' ], $ globalScopeLink ->getTitle ());
654
654
$ this ->assertEquals ($ requestData ['link ' ]['price ' ], $ globalScopeLink ->getPrice ());
655
655
$ this ->assertEquals ($ requestData ['link ' ]['sort_order ' ], $ link ->getSortOrder ());
656
- $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], (bool )$ link ->getIsShareable ());
656
+ $ this ->assertEquals ($ requestData ['link ' ]['is_shareable ' ], (int )$ link ->getIsShareable ());
657
657
$ this ->assertEquals ($ requestData ['link ' ]['number_of_downloads ' ], $ link ->getNumberOfDownloads ());
658
658
}
659
659
@@ -672,7 +672,7 @@ public function testUpdateThrowsExceptionIfTargetProductDoesNotExist()
672
672
'title ' => 'Updated Title ' ,
673
673
'sort_order ' => 2 ,
674
674
'price ' => 100.10 ,
675
- 'is_shareable ' => false ,
675
+ 'is_shareable ' => 0 ,
676
676
'number_of_downloads ' => 50 ,
677
677
'link_type ' => 'url ' ,
678
678
'sample_type ' => 'url ' ,
@@ -699,7 +699,7 @@ public function testUpdateThrowsExceptionIfThereIsNoDownloadableLinkWithGivenId(
699
699
'title ' => 'Title ' ,
700
700
'sort_order ' => 2 ,
701
701
'price ' => 100.10 ,
702
- 'is_shareable ' => false ,
702
+ 'is_shareable ' => 0 ,
703
703
'number_of_downloads ' => 50 ,
704
704
'link_type ' => 'url ' ,
705
705
'sample_type ' => 'url ' ,
@@ -728,7 +728,7 @@ public function testUpdateThrowsExceptionIfLinkPriceIsInvalid($linkPrice)
728
728
'title ' => 'Updated Link Title ' ,
729
729
'sort_order ' => 2 ,
730
730
'price ' => $ linkPrice ,
731
- 'is_shareable ' => false ,
731
+ 'is_shareable ' => 0 ,
732
732
'number_of_downloads ' => 50 ,
733
733
'link_type ' => 'url ' ,
734
734
'sample_type ' => 'url ' ,
@@ -757,7 +757,7 @@ public function testUpdateThrowsExceptionIfSortOrderIsInvalid($sortOrder)
757
757
'title ' => 'Updated Link Title ' ,
758
758
'sort_order ' => $ sortOrder ,
759
759
'price ' => 100.50 ,
760
- 'is_shareable ' => false ,
760
+ 'is_shareable ' => 0 ,
761
761
'number_of_downloads ' => 50 ,
762
762
'link_type ' => 'url ' ,
763
763
'sample_type ' => 'url ' ,
@@ -785,7 +785,7 @@ public function testUpdateThrowsExceptionIfNumberOfDownloadsIsInvalid($numberOfD
785
785
'title ' => 'Updated Link Title ' ,
786
786
'sort_order ' => 200 ,
787
787
'price ' => 100.50 ,
788
- 'is_shareable ' => false ,
788
+ 'is_shareable ' => 0 ,
789
789
'number_of_downloads ' => $ numberOfDownloads ,
790
790
'link_type ' => 'url ' ,
791
791
'sample_type ' => 'url ' ,
0 commit comments