Skip to content

Commit 4117886

Browse files
committed
MAGETWO-46832: Downloadable webAPI tests tries to acces associative array via ID when keys have only natural identifiers - fix L1
1 parent eba06b0 commit 4117886

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

dev/tests/api-functional/testsuite/Magento/Downloadable/Api/LinkRepositoryTest.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function testCreateUploadsProvidedFileContent()
127127
'title' => 'Title',
128128
'sort_order' => 1,
129129
'price' => 10.1,
130-
'is_shareable' => true,
130+
'is_shareable' => 1,
131131
'number_of_downloads' => 100,
132132
'link_type' => 'file',
133133
'link_file_content' => [
@@ -151,7 +151,7 @@ public function testCreateUploadsProvidedFileContent()
151151
$this->assertEquals($requestData['link']['sort_order'], $link->getSortOrder());
152152
$this->assertEquals($requestData['link']['price'], $link->getPrice());
153153
$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());
155155
$this->assertEquals($requestData['link']['number_of_downloads'], $link->getNumberOfDownloads());
156156
$this->assertEquals($requestData['link']['link_type'], $link->getLinkType());
157157
$this->assertEquals($requestData['link']['sample_type'], $link->getSampleType());
@@ -173,7 +173,7 @@ public function testCreateSavesPriceAndTitleInStoreViewScope()
173173
'title' => 'Store View Title',
174174
'sort_order' => 1,
175175
'price' => 150,
176-
'is_shareable' => true,
176+
'is_shareable' => 1,
177177
'number_of_downloads' => 100,
178178
'link_url' => 'http://www.example.com/',
179179
'link_type' => 'url',
@@ -189,7 +189,7 @@ public function testCreateSavesPriceAndTitleInStoreViewScope()
189189
$this->assertEquals($requestData['link']['title'], $link->getTitle());
190190
$this->assertEquals($requestData['link']['sort_order'], $link->getSortOrder());
191191
$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());
193193
$this->assertEquals($requestData['link']['number_of_downloads'], $link->getNumberOfDownloads());
194194
$this->assertEquals($requestData['link']['link_url'], $link->getLinkUrl());
195195
$this->assertEquals($requestData['link']['link_type'], $link->getLinkType());
@@ -211,7 +211,7 @@ public function testCreateSavesProvidedUrls()
211211
'title' => 'Link with URL resources',
212212
'sort_order' => 1,
213213
'price' => 10.1,
214-
'is_shareable' => true,
214+
'is_shareable' => 1,
215215
'number_of_downloads' => 100,
216216
'link_url' => 'http://www.example.com/',
217217
'link_type' => 'url',
@@ -226,7 +226,7 @@ public function testCreateSavesProvidedUrls()
226226
$this->assertEquals($requestData['link']['title'], $link->getTitle());
227227
$this->assertEquals($requestData['link']['sort_order'], $link->getSortOrder());
228228
$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());
230230
$this->assertEquals($requestData['link']['number_of_downloads'], $link->getNumberOfDownloads());
231231
$this->assertEquals($requestData['link']['link_url'], $link->getLinkUrl());
232232
$this->assertEquals($requestData['link']['link_type'], $link->getLinkType());
@@ -248,7 +248,7 @@ public function testCreateThrowsExceptionIfLinkTypeIsNotSpecified()
248248
'title' => 'Link with URL resources',
249249
'sort_order' => 1,
250250
'price' => 10.1,
251-
'is_shareable' => true,
251+
'is_shareable' => 1,
252252
'number_of_downloads' => 100,
253253
'link_type' => 'invalid',
254254
'sample_type' => 'url',
@@ -273,7 +273,7 @@ public function testCreateThrowsExceptionIfLinkFileContentIsNotAValidBase64Encod
273273
'title' => 'Link Title',
274274
'sort_order' => 1,
275275
'price' => 10,
276-
'is_shareable' => true,
276+
'is_shareable' => 1,
277277
'number_of_downloads' => 100,
278278
'link_type' => 'url',
279279
'link_url' => 'http://www.example.com/',
@@ -302,7 +302,7 @@ public function testCreateThrowsExceptionIfSampleFileContentIsNotAValidBase64Enc
302302
'title' => 'Link Title',
303303
'sort_order' => 1,
304304
'price' => 10,
305-
'is_shareable' => true,
305+
'is_shareable' => 1,
306306
'number_of_downloads' => 100,
307307
'link_type' => 'file',
308308
'link_file_content' => [
@@ -331,7 +331,7 @@ public function testCreateThrowsExceptionIfLinkFileNameContainsForbiddenCharacte
331331
'title' => 'Title',
332332
'sort_order' => 15,
333333
'price' => 10,
334-
'is_shareable' => true,
334+
'is_shareable' => 1,
335335
'number_of_downloads' => 100,
336336
'link_type' => 'file',
337337
'link_file_content' => [
@@ -360,7 +360,7 @@ public function testCreateThrowsExceptionIfSampleFileNameContainsForbiddenCharac
360360
'title' => 'Link Title',
361361
'sort_order' => 1,
362362
'price' => 10,
363-
'is_shareable' => true,
363+
'is_shareable' => 1,
364364
'number_of_downloads' => 100,
365365
'link_type' => 'url',
366366
'link_url' => 'http://www.example.com/',
@@ -389,7 +389,7 @@ public function testCreateThrowsExceptionIfLinkUrlHasWrongFormat()
389389
'title' => 'Link Title',
390390
'sort_order' => 1,
391391
'price' => 10,
392-
'is_shareable' => true,
392+
'is_shareable' => 1,
393393
'number_of_downloads' => 100,
394394
'link_type' => 'url',
395395
'link_url' => 'http://example<.>com/',
@@ -415,7 +415,7 @@ public function testCreateThrowsExceptionIfSampleUrlHasWrongFormat()
415415
'title' => 'Link Title',
416416
'sort_order' => 1,
417417
'price' => 150,
418-
'is_shareable' => true,
418+
'is_shareable' => 1,
419419
'number_of_downloads' => 0,
420420
'sample_type' => 'url',
421421
'sample_url' => 'http://example<.>com/',
@@ -442,7 +442,7 @@ public function testCreateThrowsExceptionIfLinkPriceIsInvalid($linkPrice)
442442
'title' => 'Link Title',
443443
'sort_order' => 1,
444444
'price' => $linkPrice,
445-
'is_shareable' => true,
445+
'is_shareable' => 1,
446446
'number_of_downloads' => 0,
447447
'sample_type' => 'url',
448448
'sample_url' => 'http://example.com/',
@@ -479,7 +479,7 @@ public function testCreateThrowsExceptionIfSortOrderIsInvalid($sortOrder)
479479
'title' => 'Link Title',
480480
'sort_order' => $sortOrder,
481481
'price' => 10,
482-
'is_shareable' => false,
482+
'is_shareable' => 0,
483483
'number_of_downloads' => 0,
484484
'sample_type' => 'url',
485485
'sample_url' => 'http://example.com/',
@@ -515,7 +515,7 @@ public function testCreateThrowsExceptionIfNumberOfDownloadsIsInvalid($numberOfD
515515
'title' => 'Link Title',
516516
'sort_order' => 0,
517517
'price' => 10,
518-
'is_shareable' => false,
518+
'is_shareable' => 0,
519519
'number_of_downloads' => $numberOfDownloads,
520520
'sample_type' => 'url',
521521
'sample_url' => 'http://example.com/',
@@ -551,7 +551,7 @@ public function testCreateThrowsExceptionIfTargetProductTypeIsNotDownloadable()
551551
'title' => 'Link Title',
552552
'sort_order' => 50,
553553
'price' => 200,
554-
'is_shareable' => false,
554+
'is_shareable' => 0,
555555
'number_of_downloads' => 10,
556556
'sample_type' => 'url',
557557
'sample_url' => 'http://example.com/',
@@ -576,7 +576,7 @@ public function testCreateThrowsExceptionIfTargetProductDoesNotExist()
576576
'title' => 'Link Title',
577577
'sort_order' => 15,
578578
'price' => 200,
579-
'is_shareable' => true,
579+
'is_shareable' => 1,
580580
'number_of_downloads' => 100,
581581
'sample_type' => 'url',
582582
'sample_url' => 'http://example.com/',
@@ -603,7 +603,7 @@ public function testUpdate()
603603
'title' => 'Updated Title',
604604
'sort_order' => 2,
605605
'price' => 100.10,
606-
'is_shareable' => false,
606+
'is_shareable' => 0,
607607
'number_of_downloads' => 50,
608608
'link_type' => 'url',
609609
'sample_type' => 'url',
@@ -615,7 +615,7 @@ public function testUpdate()
615615
$this->assertEquals($requestData['link']['title'], $link->getTitle());
616616
$this->assertEquals($requestData['link']['sort_order'], $link->getSortOrder());
617617
$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());
619619
$this->assertEquals($requestData['link']['number_of_downloads'], $link->getNumberOfDownloads());
620620
}
621621

@@ -636,7 +636,7 @@ public function testUpdateSavesDataInGlobalScopeAndDoesNotAffectValuesStoredInSt
636636
'title' => 'Updated Title',
637637
'sort_order' => 2,
638638
'price' => 100.10,
639-
'is_shareable' => false,
639+
'is_shareable' => 0,
640640
'number_of_downloads' => 50,
641641
'link_type' => 'url',
642642
'sample_type' => 'url',
@@ -653,7 +653,7 @@ public function testUpdateSavesDataInGlobalScopeAndDoesNotAffectValuesStoredInSt
653653
$this->assertEquals($requestData['link']['title'], $globalScopeLink->getTitle());
654654
$this->assertEquals($requestData['link']['price'], $globalScopeLink->getPrice());
655655
$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());
657657
$this->assertEquals($requestData['link']['number_of_downloads'], $link->getNumberOfDownloads());
658658
}
659659

@@ -672,7 +672,7 @@ public function testUpdateThrowsExceptionIfTargetProductDoesNotExist()
672672
'title' => 'Updated Title',
673673
'sort_order' => 2,
674674
'price' => 100.10,
675-
'is_shareable' => false,
675+
'is_shareable' => 0,
676676
'number_of_downloads' => 50,
677677
'link_type' => 'url',
678678
'sample_type' => 'url',
@@ -699,7 +699,7 @@ public function testUpdateThrowsExceptionIfThereIsNoDownloadableLinkWithGivenId(
699699
'title' => 'Title',
700700
'sort_order' => 2,
701701
'price' => 100.10,
702-
'is_shareable' => false,
702+
'is_shareable' => 0,
703703
'number_of_downloads' => 50,
704704
'link_type' => 'url',
705705
'sample_type' => 'url',
@@ -728,7 +728,7 @@ public function testUpdateThrowsExceptionIfLinkPriceIsInvalid($linkPrice)
728728
'title' => 'Updated Link Title',
729729
'sort_order' => 2,
730730
'price' => $linkPrice,
731-
'is_shareable' => false,
731+
'is_shareable' => 0,
732732
'number_of_downloads' => 50,
733733
'link_type' => 'url',
734734
'sample_type' => 'url',
@@ -757,7 +757,7 @@ public function testUpdateThrowsExceptionIfSortOrderIsInvalid($sortOrder)
757757
'title' => 'Updated Link Title',
758758
'sort_order' => $sortOrder,
759759
'price' => 100.50,
760-
'is_shareable' => false,
760+
'is_shareable' => 0,
761761
'number_of_downloads' => 50,
762762
'link_type' => 'url',
763763
'sample_type' => 'url',
@@ -785,7 +785,7 @@ public function testUpdateThrowsExceptionIfNumberOfDownloadsIsInvalid($numberOfD
785785
'title' => 'Updated Link Title',
786786
'sort_order' => 200,
787787
'price' => 100.50,
788-
'is_shareable' => false,
788+
'is_shareable' => 0,
789789
'number_of_downloads' => $numberOfDownloads,
790790
'link_type' => 'url',
791791
'sample_type' => 'url',

0 commit comments

Comments
 (0)