Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected function getOptionList()
/**
* Returns formatted option value for an item
*
* @param \Magento\Wishlist\Model\Item\Option $option
* @param array|string $option
* @return array
*/
protected function getFormattedOptionValue($option)
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Customer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ This module introduces the following layouts in the `view/frontend/layout` and `
- `customer_index_newsletter`
- `customer_index_orders`
- `customer_index_viewcart`
- `customer_index_viewwishlist`
- `customer_online_index`

- `view/frontend/layout`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

use Magento\Customer\Block\Account\Link as CustomerAccountLink;
use Magento\Customer\Block\Account\Navigation;
use Magento\Customer\Block\Account\SortLink;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
use Magento\Framework\View\Element\Template\Context;
use Magento\Framework\View\LayoutInterface;
use Magento\Wishlist\Block\Link as WishListLink;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

Expand Down Expand Up @@ -58,13 +58,13 @@ protected function setUp(): void
}

/**
* Test get links with block customer account link and wish list link
* Test get links sorts a customer account link and a sort link by sort order
*
* @return void
*/
public function testGetLinksWithCustomerAndWishList()
public function testGetLinksWithCustomerAccountLinkAndSortLink()
{
$wishListLinkMock = $this->getMockBuilder(WishListLink::class)
$sortLinkMock = $this->getMockBuilder(SortLink::class)
->disableOriginalConstructor()
->onlyMethods(['getSortOrder'])
->getMock();
Expand All @@ -74,7 +74,7 @@ public function testGetLinksWithCustomerAndWishList()
->onlyMethods(['getSortOrder'])
->getMock();

$wishListLinkMock->expects($this->any())
$sortLinkMock->expects($this->any())
->method('getSortOrder')
->willReturn(100);

Expand All @@ -85,7 +85,7 @@ public function testGetLinksWithCustomerAndWishList()
$nameInLayout = 'top.links';

$blockChildren = [
'wishListLink' => $wishListLinkMock,
'sortLink' => $sortLinkMock,
'customerAccountLink' => $customerAccountLinkMock
];

Expand All @@ -98,7 +98,7 @@ public function testGetLinksWithCustomerAndWishList()
/* Assertion */
$this->assertEquals(
[
0 => $wishListLinkMock,
0 => $sortLinkMock,
1 => $customerAccountLinkMock
],
$this->navigation->getLinks()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
use Magento\Bundle\Helper\Catalog\Product\Configuration;
use Magento\Catalog\Helper\Product\ConfigurationPool;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface;
use Magento\Customer\Block\Adminhtml\Edit\Tab\View\Grid\Renderer\Item;
use Magento\Framework\DataObject;
use Magento\Framework\Escaper;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\Attributes\DataProvider;
Expand All @@ -20,7 +22,7 @@

class ItemTest extends TestCase
{
/** @var MockObject */
/** @var DataObject&ItemInterface */
protected $item;

/** @var Item */
Expand Down Expand Up @@ -50,11 +52,31 @@ public function configure($amountOption, $withoutOptions = false)
->method('getName')
->willReturn('testProductName');

$this->item = $this->createPartialMock(\Magento\Wishlist\Model\Item::class, ['getProduct']);
$this->item
->expects($this->atLeastOnce())
->method('getProduct')
->willReturn($product);
$this->item = new class (['product' => $product]) extends DataObject implements ItemInterface {
/**
* @inheritdoc
*/
public function getProduct()
{
return $this->getData('product');
}

/**
* @inheritdoc
*/
public function getOptionByCode($code)
{
return null;
}

/**
* @inheritdoc
*/
public function getFileDownloadParams()
{
return null;
}
};

$productConfigPool = $this->createPartialMock(
ConfigurationPool::class,
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Customer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"magento/module-tax": "*",
"magento/module-theme": "*",
"magento/module-ui": "*",
"magento/module-wishlist": "*",
"magento/module-captcha": "*"
},
"suggest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright 2013 Adobe
* All Rights Reserved.
*/
namespace Magento\Customer\Block\Adminhtml\Edit\Tab\View;
namespace Magento\Wishlist\Block\Adminhtml\Customer\Edit\Tab\View;

use Magento\Customer\Controller\RegistryConstants;

Expand All @@ -16,7 +16,7 @@
class Wishlist extends \Magento\Backend\Block\Widget\Grid\Extended
{
/**
* Core registry.
* Registry holding the ID of the customer being viewed
*
* @var \Magento\Framework\Registry
*/
Expand Down Expand Up @@ -142,7 +142,7 @@ public function getHeadersVisibility()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getRowUrl($row)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright 2014 Adobe
* All Rights Reserved.
*/
namespace Magento\Customer\Controller\Adminhtml\Index;
namespace Magento\Wishlist\Controller\Adminhtml\Index;

class ViewWishlist extends \Magento\Customer\Controller\Adminhtml\Index
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright 2014 Adobe
* All Rights Reserved.
*/
namespace Magento\Customer\Controller\Adminhtml\Index;
namespace Magento\Wishlist\Controller\Adminhtml\Index;

class Wishlist extends \Magento\Customer\Controller\Adminhtml\Index
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright 2013 Adobe
* All Rights Reserved.
*/
namespace Magento\Customer\Controller\Adminhtml\Wishlist\Product\Composite;
namespace Magento\Wishlist\Controller\Adminhtml\Wishlist\Product\Composite;

use Magento\Framework\Exception\LocalizedException as CoreException;

Expand All @@ -17,7 +17,7 @@ abstract class Wishlist extends \Magento\Backend\App\Action
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Customer::manage';
public const ADMIN_RESOURCE = 'Magento_Customer::manage';

/**
* Wishlist we're working with.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Copyright 2014 Adobe
* All Rights Reserved.
*/
namespace Magento\Customer\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist;
namespace Magento\Wishlist\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist;

use Exception;

class Configure extends \Magento\Customer\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist
class Configure extends \Magento\Wishlist\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist
{
/**
* Ajax handler to response configuration fieldset of composite product in customer's wishlist.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Copyright 2014 Adobe
* All Rights Reserved.
*/
namespace Magento\Customer\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist;
namespace Magento\Wishlist\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist;

use Exception;

class Update extends \Magento\Customer\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist
class Update extends \Magento\Wishlist\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist
{
/**
* IFrame handler for submitted configuration for wishlist item.
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Wishlist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ For information about the event, see [Events and observers](https://developer.ad
This module introduces the following layouts and layout handles in the directories:

- `view/adminhtml/layout`:
- `customer_index_viewwishlist`
- `customer_index_wishlist`
- `view/base/layout`:
- `catalog_product_prices`
Expand Down
14 changes: 14 additions & 0 deletions app/code/Magento/Wishlist/etc/adminhtml/routes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Mage-OS. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
<route id="customer">
<module name="Magento_Wishlist" before="Magento_Customer"/>
</route>
</router>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<container name="root" label="Root">
<block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View\Wishlist" name="admin.customer.view.wishlist"/>
<block class="Magento\Wishlist\Block\Adminhtml\Customer\Edit\Tab\View\Wishlist" name="admin.customer.view.wishlist"/>
</container>
</layout>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
declare(strict_types=1);

namespace Magento\Customer\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist;
namespace Magento\Wishlist\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist;

use Magento\Backend\Model\Session;
use Magento\Catalog\Api\Data\ProductInterface;
Expand Down Expand Up @@ -44,6 +44,8 @@ protected function setUp(): void
}

/**
* Update the quantity of a simple product wish list item
*
* @magentoDataFixture Magento/Wishlist/_files/wishlist_with_simple_product.php
* @magentoDbIsolation disabled
*
Expand All @@ -59,6 +61,8 @@ public function testUpdateItem(): void
}

/**
* Update the options and quantity of a configurable product wish list item
*
* @magentoDataFixture Magento/Wishlist/_files/wishlist_with_configurable_product.php
* @magentoDbIsolation disabled
*
Expand All @@ -81,6 +85,8 @@ public function testUpdateItemOption(): void
}

/**
* Updating an item that does not exist reports an error
*
* @return void
*/
public function testUpdateNotExistingItem(): void
Expand All @@ -94,6 +100,8 @@ public function testUpdateNotExistingItem(): void
}

/**
* Updating without an item ID reports an error
*
* @return void
*/
public function testUpdateWithoutParams(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4332,4 +4332,10 @@
['Magento\Elasticsearch\Test\Unit\Model\DataProvider\Base\SuggestionsTest'],
['Zend_Measure_Length', 'Magento\Framework\Measure\Length'],
['Zend_Measure_Weight', 'Magento\Framework\Measure\Weight'],
['Magento\Customer\Block\Adminhtml\Edit\Tab\View\Wishlist', 'Magento\Wishlist\Block\Adminhtml\Customer\Edit\Tab\View\Wishlist'],
['Magento\Customer\Controller\Adminhtml\Index\Wishlist', 'Magento\Wishlist\Controller\Adminhtml\Index\Wishlist'],
['Magento\Customer\Controller\Adminhtml\Index\ViewWishlist', 'Magento\Wishlist\Controller\Adminhtml\Index\ViewWishlist'],
['Magento\Customer\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist', 'Magento\Wishlist\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist'],
['Magento\Customer\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist\Configure', 'Magento\Wishlist\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist\Configure'],
['Magento\Customer\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist\Update', 'Magento\Wishlist\Controller\Adminhtml\Wishlist\Product\Composite\Wishlist\Update'],
];
Loading