File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed
app/code/Magento/Wishlist/Test/Unit/Plugin/Ui/DataProvider Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+ declare (strict_types=1 );
7+
8+ namespace Magento \Wishlist \Test \Unit \Plugin \Ui \DataProvider ;
9+
10+ use Magento \Catalog \Ui \DataProvider \Product \Listing \DataProvider ;
11+ use Magento \Wishlist \Helper \Data ;
12+ use Magento \Wishlist \Plugin \Ui \DataProvider \WishlistSettings ;
13+
14+ /**
15+ * Covers \Magento\Wishlist\Plugin\Ui\DataProvider\WishlistSettings
16+ */
17+ class WishlistSettingsTest extends \PHPUnit \Framework \TestCase
18+ {
19+ /**
20+ * Testable Object
21+ *
22+ * @var WishlistSettings
23+ */
24+ private $ wishlistSettings ;
25+
26+ /**
27+ * @var Data|\PHPUnit_Framework_MockObject_MockObject
28+ */
29+ private $ helperMock ;
30+
31+ /**
32+ * Set Up
33+ *
34+ * @return void
35+ */
36+ protected function setUp ()
37+ {
38+ $ this ->helperMock = $ this ->createMock (Data::class);
39+ $ this ->wishlistSettings = new WishlistSettings ($ this ->helperMock );
40+ }
41+
42+ /**
43+ * Test afterGetData method
44+ *
45+ * @return void
46+ */
47+ public function testAfterGetData ()
48+ {
49+ /** @var DataProvider|\PHPUnit_Framework_MockObject_MockObject $subjectMock */
50+ $ subjectMock = $ this ->createMock (DataProvider::class);
51+ $ result = [];
52+ $ isAllow = true ;
53+ $ this ->helperMock ->expects ($ this ->once ())->method ('isAllow ' )->willReturn (true );
54+
55+ $ expected = ['allowWishlist ' => $ isAllow ];
56+ $ actual = $ this ->wishlistSettings ->afterGetData ($ subjectMock , $ result );
57+ self ::assertEquals ($ expected , $ actual );
58+ }
59+ }
You can’t perform that action at this time.
0 commit comments