| ' .
@@ -279,20 +300,21 @@ protected function processWishlistItemDescription($wishlistModelMock, $staticArg
public function testIsAllowed()
{
$customerId = 1;
- $customerServiceMock = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class);
+ $customerServiceMock = $this->getMockForAbstractClass(CustomerInterface::class);
$wishlist = $this->getMockBuilder(\Magento\Wishlist\Model\Wishlist::class)->setMethods(
['getId', '__wakeup', 'getCustomerId', 'getItemCollection', 'getSharingCode']
- )->disableOriginalConstructor()->getMock();
+ )->disableOriginalConstructor()
+ ->getMock();
$wishlist->expects($this->once())->method('getCustomerId')->willReturn($customerId);
$this->wishlistHelperMock->expects($this->any())->method('getWishlist')
- ->will($this->returnValue($wishlist));
+ ->willReturn($wishlist);
$this->wishlistHelperMock->expects($this->any())
->method('getCustomer')
- ->will($this->returnValue($customerServiceMock));
+ ->willReturn($customerServiceMock);
$customerServiceMock->expects($this->once())->method('getId')->willReturn($customerId);
$this->scopeConfig->expects($this->once())->method('isSetFlag')
- ->with('rss/wishlist/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)
- ->will($this->returnValue(true));
+ ->with('rss/wishlist/active', ScopeInterface::SCOPE_STORE)
+ ->willReturn(true);
$this->assertTrue($this->model->isAllowed());
}
@@ -302,10 +324,11 @@ public function testGetCacheKey()
$wishlistId = 1;
$wishlist = $this->getMockBuilder(\Magento\Wishlist\Model\Wishlist::class)->setMethods(
['getId', '__wakeup', 'getCustomerId', 'getItemCollection', 'getSharingCode']
- )->disableOriginalConstructor()->getMock();
+ )->disableOriginalConstructor()
+ ->getMock();
$wishlist->expects($this->once())->method('getId')->willReturn($wishlistId);
$this->wishlistHelperMock->expects($this->any())->method('getWishlist')
- ->will($this->returnValue($wishlist));
+ ->willReturn($wishlist);
$this->assertEquals('rss_wishlist_data_1', $this->model->getCacheKey());
}
@@ -318,23 +341,24 @@ public function testIsAuthRequired()
{
$wishlist = $this->getMockBuilder(\Magento\Wishlist\Model\Wishlist::class)->setMethods(
['getId', '__wakeup', 'getCustomerId', 'getItemCollection', 'getSharingCode']
- )->disableOriginalConstructor()->getMock();
+ )->disableOriginalConstructor()
+ ->getMock();
$wishlist->expects($this->any())->method('getSharingCode')
- ->will($this->returnValue('somesharingcode'));
+ ->willReturn('somesharingcode');
$this->wishlistHelperMock->expects($this->any())->method('getWishlist')
- ->will($this->returnValue($wishlist));
- $this->assertEquals(false, $this->model->isAuthRequired());
+ ->willReturn($wishlist);
+ $this->assertFalse($this->model->isAuthRequired());
}
public function testGetProductPriceHtmlBlockDoesntExists()
{
$price = 10.;
- $productMock = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
+ $productMock = $this->getMockBuilder(Product::class)
->disableOriginalConstructor()
->getMock();
- $renderBlockMock = $this->getMockBuilder(\Magento\Framework\Pricing\Render::class)
+ $renderBlockMock = $this->getMockBuilder(Render::class)
->disableOriginalConstructor()
->getMock();
$renderBlockMock->expects($this->once())
@@ -342,7 +366,7 @@ public function testGetProductPriceHtmlBlockDoesntExists()
->with(
'wishlist_configured_price',
$productMock,
- ['zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST]
+ ['zone' => Render::ZONE_ITEM_LIST]
)
->willReturn($price);
@@ -353,7 +377,7 @@ public function testGetProductPriceHtmlBlockDoesntExists()
$this->layoutMock->expects($this->once())
->method('createBlock')
->with(
- \Magento\Framework\Pricing\Render::class,
+ Render::class,
'product.price.render.default',
['data' => ['price_render_handle' => 'catalog_product_prices']]
)
@@ -366,11 +390,11 @@ public function testGetProductPriceHtmlBlockExists()
{
$price = 10.;
- $productMock = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
+ $productMock = $this->getMockBuilder(Product::class)
->disableOriginalConstructor()
->getMock();
- $renderBlockMock = $this->getMockBuilder(\Magento\Framework\Pricing\Render::class)
+ $renderBlockMock = $this->getMockBuilder(Render::class)
->disableOriginalConstructor()
->getMock();
$renderBlockMock->expects($this->once())
@@ -378,7 +402,7 @@ public function testGetProductPriceHtmlBlockExists()
->with(
'wishlist_configured_price',
$productMock,
- ['zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST]
+ ['zone' => Render::ZONE_ITEM_LIST]
)
->willReturn($price);
diff --git a/app/code/Magento/Wishlist/Test/Unit/Model/WishlistCleanerTest.php b/app/code/Magento/Wishlist/Test/Unit/Model/WishlistCleanerTest.php
index 7eca21f9cee08..9574bf47b616f 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Model/WishlistCleanerTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Model/WishlistCleanerTest.php
@@ -39,7 +39,7 @@ class WishlistCleanerTest extends TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->itemOptionResourceModel = $this->createMock(ItemOptionResourceModel::class);
$this->itemResourceModel = $this->createMock(ItemResourceModel::class);
@@ -54,9 +54,9 @@ public function testExecute()
$productId = 1;
$itemTable = 'table_item';
$itemOptionTable = 'table_item_option';
- $product = $this->createMock(ProductInterface::class);
+ $product = $this->getMockForAbstractClass(ProductInterface::class);
$product->expects($this->once())->method('getId')->willReturn($productId);
- $connection = $this->createMock(AdapterInterface::class);
+ $connection = $this->getMockForAbstractClass(AdapterInterface::class);
$this->itemResourceModel->expects($this->once())->method('getConnection')->willReturn($connection);
$this->itemResourceModel->expects($this->once())->method('getMainTable')->willReturn($itemTable);
$this->itemOptionResourceModel->expects($this->once())->method('getMainTable')->willReturn($itemOptionTable);
diff --git a/app/code/Magento/Wishlist/Test/Unit/Model/WishlistTest.php b/app/code/Magento/Wishlist/Test/Unit/Model/WishlistTest.php
index be1c11076750a..19bfb3598f0e3 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Model/WishlistTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Model/WishlistTest.php
@@ -3,6 +3,8 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Wishlist\Test\Unit\Model;
use ArrayIterator;
@@ -32,8 +34,8 @@
use Magento\Wishlist\Model\ResourceModel\Wishlist as WishlistResource;
use Magento\Wishlist\Model\ResourceModel\Wishlist\Collection as WishlistCollection;
use Magento\Wishlist\Model\Wishlist;
-use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -131,7 +133,7 @@ class WishlistTest extends TestCase
*/
private $stockRegistry;
- protected function setUp()
+ protected function setUp(): void
{
$context = $this->getMockBuilder(Context::class)
->disableOriginalConstructor()
@@ -177,20 +179,20 @@ protected function setUp()
$this->dateTime = $this->getMockBuilder(DateTime::class)
->disableOriginalConstructor()
->getMock();
- $this->productRepository = $this->createMock(ProductRepositoryInterface::class);
- $this->stockRegistry = $this->createMock(StockRegistryInterface::class);
- $this->scopeConfig = $this->createMock(ScopeConfigInterface::class);
+ $this->productRepository = $this->getMockForAbstractClass(ProductRepositoryInterface::class);
+ $this->stockRegistry = $this->getMockForAbstractClass(StockRegistryInterface::class);
+ $this->scopeConfig = $this->getMockForAbstractClass(ScopeConfigInterface::class);
$this->scopeConfig = $this->getMockBuilder(ScopeConfigInterface::class)
->disableOriginalConstructor()
- ->getMock();
+ ->getMockForAbstractClass();
$this->serializer = $this->getMockBuilder(Json::class)
->disableOriginalConstructor()
->getMock();
$context->expects($this->once())
->method('getEventDispatcher')
- ->will($this->returnValue($this->eventDispatcher));
+ ->willReturn($this->eventDispatcher);
$this->wishlist = new Wishlist(
$context,
@@ -229,7 +231,7 @@ public function testLoadByCustomerId()
->with($this->logicalOr($this->wishlist, $customerId, $customerIdFieldName));
$this->mathRandom->expects($this->once())
->method('getUniqueHash')
- ->will($this->returnValue($sharingCode));
+ ->willReturn($sharingCode);
$this->assertInstanceOf(
Wishlist::class,
@@ -259,58 +261,64 @@ public function testUpdateItem($itemId, $buyRequest, $param)
)
->disableOriginalConstructor()
->getMock();
- $newItem->expects($this->any())->method('setProductId')->will($this->returnSelf());
- $newItem->expects($this->any())->method('setWishlistId')->will($this->returnSelf());
- $newItem->expects($this->any())->method('setStoreId')->will($this->returnSelf());
- $newItem->expects($this->any())->method('setOptions')->will($this->returnSelf());
- $newItem->expects($this->any())->method('setProduct')->will($this->returnSelf());
- $newItem->expects($this->any())->method('setQty')->will($this->returnSelf());
- $newItem->expects($this->any())->method('getItem')->will($this->returnValue(2));
- $newItem->expects($this->any())->method('save')->will($this->returnSelf());
+ $newItem->expects($this->any())->method('setProductId')->willReturnSelf();
+ $newItem->expects($this->any())->method('setWishlistId')->willReturnSelf();
+ $newItem->expects($this->any())->method('setStoreId')->willReturnSelf();
+ $newItem->expects($this->any())->method('setOptions')->willReturnSelf();
+ $newItem->expects($this->any())->method('setProduct')->willReturnSelf();
+ $newItem->expects($this->any())->method('setQty')->willReturnSelf();
+ $newItem->expects($this->any())->method('getItem')->willReturn(2);
+ $newItem->expects($this->any())->method('save')->willReturnSelf();
- $this->itemFactory->expects($this->once())->method('create')->will($this->returnValue($newItem));
+ $this->itemFactory->expects($this->once())->method('create')->willReturn($newItem);
- $this->storeManager->expects($this->any())->method('getStores')->will($this->returnValue($stores));
- $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($stores[0]));
+ $this->storeManager->expects($this->any())->method('getStores')->willReturn($stores);
+ $this->storeManager->expects($this->any())->method('getStore')->willReturn($stores[0]);
$product = $this->getMockBuilder(
Product::class
- )->disableOriginalConstructor()->getMock();
- $product->expects($this->any())->method('getId')->will($this->returnValue($productId));
- $product->expects($this->any())->method('getStoreId')->will($this->returnValue($storeId));
+ )->disableOriginalConstructor()
+ ->getMock();
+ $product->expects($this->any())->method('getId')->willReturn($productId);
+ $product->expects($this->any())->method('getStoreId')->willReturn($storeId);
- $stockItem = $this->getMockBuilder(StockItem::class)->disableOriginalConstructor()->getMock();
- $stockItem->expects($this->any())->method('getIsInStock')->will($this->returnValue(true));
+ $stockItem = $this->getMockBuilder(StockItem::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $stockItem->expects($this->any())->method('getIsInStock')->willReturn(true);
$this->stockRegistry->expects($this->any())
->method('getStockItem')
- ->will($this->returnValue($stockItem));
+ ->willReturn($stockItem);
$instanceType = $this->getMockBuilder(AbstractType::class)
->disableOriginalConstructor()
->getMock();
$instanceType->expects($this->once())
->method('processConfiguration')
- ->will(
- $this->returnValue(
- $this->getMockBuilder(Product::class)->disableOriginalConstructor()->getMock()
- )
+ ->willReturn(
+ $this->getMockBuilder(Product::class)
+ ->disableOriginalConstructor()
+ ->getMock()
);
$newProduct = $this->getMockBuilder(
Product::class
- )->disableOriginalConstructor()->getMock();
+ )->disableOriginalConstructor()
+ ->getMock();
$newProduct->expects($this->any())
->method('setStoreId')
->with($storeId)
- ->will($this->returnSelf());
+ ->willReturnSelf();
$newProduct->expects($this->once())
->method('getTypeInstance')
- ->will($this->returnValue($instanceType));
+ ->willReturn($instanceType);
- $item = $this->getMockBuilder(Item::class)->disableOriginalConstructor()->getMock();
+ $item = $this->getMockBuilder(Item::class)
+ ->disableOriginalConstructor()
+ ->getMock();
$item->expects($this->once())
->method('getProduct')
- ->will($this->returnValue($product));
+ ->willReturn($product);
$items = $this->getMockBuilder(Collection::class)
->disableOriginalConstructor()
@@ -318,28 +326,28 @@ public function testUpdateItem($itemId, $buyRequest, $param)
$items->expects($this->once())
->method('addWishlistFilter')
- ->will($this->returnSelf());
+ ->willReturnSelf();
$items->expects($this->once())
->method('addStoreFilter')
- ->will($this->returnSelf());
+ ->willReturnSelf();
$items->expects($this->once())
->method('setVisibilityFilter')
- ->will($this->returnSelf());
+ ->willReturnSelf();
$items->expects($this->once())
->method('getItemById')
- ->will($this->returnValue($item));
+ ->willReturn($item);
$items->expects($this->any())
->method('getIterator')
- ->will($this->returnValue(new ArrayIterator([$item])));
+ ->willReturn(new ArrayIterator([$item]));
$this->itemsFactory->expects($this->any())
->method('create')
- ->will($this->returnValue($items));
+ ->willReturn($items);
$this->productRepository->expects($this->once())
->method('getById')
->with($productId, false, $storeId)
- ->will($this->returnValue($newProduct));
+ ->willReturn($newProduct);
$this->assertInstanceOf(
Wishlist::class,
@@ -412,12 +420,13 @@ function ($value) {
$stockItem = $this->getMockBuilder(
StockItem::class
- )->disableOriginalConstructor()->getMock();
- $stockItem->expects($this->any())->method('getIsInStock')->will($this->returnValue(true));
+ )->disableOriginalConstructor()
+ ->getMock();
+ $stockItem->expects($this->any())->method('getIsInStock')->willReturn(true);
$this->stockRegistry->expects($this->any())
->method('getStockItem')
- ->will($this->returnValue($stockItem));
+ ->willReturn($stockItem);
$this->assertEquals($result, $this->wishlist->addNewItem($productMock, $buyRequest));
}
diff --git a/app/code/Magento/Wishlist/Test/Unit/Observer/AddToCartTest.php b/app/code/Magento/Wishlist/Test/Unit/Observer/AddToCartTest.php
index a9d05a7a99eec..f51a2b41f3fdc 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Observer/AddToCartTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Observer/AddToCartTest.php
@@ -3,15 +3,28 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Wishlist\Test\Unit\Observer;
-use \Magento\Wishlist\Observer\AddToCart as Observer;
+use Magento\Checkout\Model\Session;
+use Magento\Framework\App\RequestInterface;
+use Magento\Framework\App\ResponseInterface;
+use Magento\Framework\Event;
+use Magento\Framework\Message\ManagerInterface;
+use Magento\Wishlist\Helper\Data;
+use Magento\Wishlist\Model\ResourceModel\Wishlist\Collection;
+use Magento\Wishlist\Model\Wishlist;
+use Magento\Wishlist\Model\WishlistFactory;
+use Magento\Wishlist\Observer\AddToCart as Observer;
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
-class AddToCartTest extends \PHPUnit\Framework\TestCase
+class AddToCartTest extends TestCase
{
/**
* @var Observer
@@ -19,39 +32,39 @@ class AddToCartTest extends \PHPUnit\Framework\TestCase
protected $observer;
/**
- * @var \Magento\Wishlist\Helper\Data|\PHPUnit\Framework\MockObject\MockObject
+ * @var Data|MockObject
*/
protected $helper;
/**
- * @var \Magento\Checkout\Model\Session|\PHPUnit\Framework\MockObject\MockObject
+ * @var Session|MockObject
*/
protected $checkoutSession;
/**
- * @var \Magento\Customer\Model\Session|\PHPUnit\Framework\MockObject\MockObject
+ * @var \Magento\Customer\Model\Session|MockObject
*/
protected $customerSession;
/**
- * @var \Magento\Wishlist\Model\WishlistFactory|\PHPUnit\Framework\MockObject\MockObject
+ * @var WishlistFactory|MockObject
*/
protected $wishlistFactory;
/**
- * @var \Magento\Wishlist\Model\Wishlist|\PHPUnit\Framework\MockObject\MockObject
+ * @var Wishlist|MockObject
*/
protected $wishlist;
/**
- * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var ManagerInterface|MockObject
*/
protected $messageManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->checkoutSession = $this->getMockBuilder(
- \Magento\Checkout\Model\Session::class
+ Session::class
)->setMethods(
[
'getSharedWishlist',
@@ -65,19 +78,20 @@ protected function setUp()
'setWishlistPendingMessages',
'setNoCartRedirect',
]
- )->disableOriginalConstructor()->getMock();
+ )->disableOriginalConstructor()
+ ->getMock();
$this->customerSession = $this->getMockBuilder(\Magento\Customer\Model\Session::class)
->disableOriginalConstructor()
->setMethods(['setWishlistItemCount', 'isLoggedIn', 'getCustomerId'])
->getMock();
- $this->wishlistFactory = $this->getMockBuilder(\Magento\Wishlist\Model\WishlistFactory::class)
+ $this->wishlistFactory = $this->getMockBuilder(WishlistFactory::class)
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
- $this->wishlist = $this->getMockBuilder(\Magento\Wishlist\Model\Wishlist::class)
+ $this->wishlist = $this->getMockBuilder(Wishlist::class)
->disableOriginalConstructor()
->getMock();
- $this->messageManager = $this->getMockBuilder(\Magento\Framework\Message\ManagerInterface::class)
+ $this->messageManager = $this->getMockBuilder(ManagerInterface::class)
->getMock();
$this->wishlistFactory->expects($this->any())
@@ -102,18 +116,19 @@ public function testExecute()
$eventObserver = $this->getMockBuilder(\Magento\Framework\Event\Observer::class)
->disableOriginalConstructor()
->getMock();
- $event = $this->getMockBuilder(\Magento\Framework\Event::class)
+ $event = $this->getMockBuilder(Event::class)
->setMethods(['getRequest', 'getResponse'])
->disableOriginalConstructor()
->getMock();
- $request = $this->getMockBuilder(\Magento\Framework\App\RequestInterface::class)->getMock();
- $response = $this->getMockBuilder(\Magento\Framework\App\ResponseInterface::class)
+ $request = $this->getMockBuilder(RequestInterface::class)
+ ->getMock();
+ $response = $this->getMockBuilder(ResponseInterface::class)
->setMethods(['setRedirect'])
->getMockForAbstractClass();
- $wishlists = $this->getMockBuilder(\Magento\Wishlist\Model\ResourceModel\Wishlist\Collection::class)
+ $wishlists = $this->getMockBuilder(Collection::class)
->disableOriginalConstructor()
->getMock();
- $loadedWishlist = $this->getMockBuilder(\Magento\Wishlist\Model\Wishlist::class)
+ $loadedWishlist = $this->getMockBuilder(Wishlist::class)
->setMethods(['getId', 'delete'])
->disableOriginalConstructor()
->getMock();
diff --git a/app/code/Magento/Wishlist/Test/Unit/Observer/CartUpdateBeforeTest.php b/app/code/Magento/Wishlist/Test/Unit/Observer/CartUpdateBeforeTest.php
index 08614fde9b290..1489379d18ef2 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Observer/CartUpdateBeforeTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Observer/CartUpdateBeforeTest.php
@@ -3,15 +3,29 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Wishlist\Test\Unit\Observer;
-use \Magento\Wishlist\Observer\CartUpdateBefore as Observer;
+use Magento\Checkout\Model\Cart;
+use Magento\Checkout\Model\Session;
+use Magento\Framework\DataObject;
+use Magento\Framework\Event;
+use Magento\Framework\Message\ManagerInterface;
+use Magento\Quote\Model\Quote;
+use Magento\Quote\Model\Quote\Item;
+use Magento\Wishlist\Helper\Data;
+use Magento\Wishlist\Model\Wishlist;
+use Magento\Wishlist\Model\WishlistFactory;
+use Magento\Wishlist\Observer\CartUpdateBefore as Observer;
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
-class CartUpdateBeforeTest extends \PHPUnit\Framework\TestCase
+class CartUpdateBeforeTest extends TestCase
{
/**
* @var Observer
@@ -19,45 +33,45 @@ class CartUpdateBeforeTest extends \PHPUnit\Framework\TestCase
protected $observer;
/**
- * @var \Magento\Wishlist\Helper\Data|\PHPUnit\Framework\MockObject\MockObject
+ * @var Data|MockObject
*/
protected $helper;
/**
- * @var \Magento\Checkout\Model\Session|\PHPUnit\Framework\MockObject\MockObject
+ * @var Session|MockObject
*/
protected $checkoutSession;
/**
- * @var \Magento\Customer\Model\Session|\PHPUnit\Framework\MockObject\MockObject
+ * @var \Magento\Customer\Model\Session|MockObject
*/
protected $customerSession;
/**
- * @var \Magento\Wishlist\Model\WishlistFactory|\PHPUnit\Framework\MockObject\MockObject
+ * @var WishlistFactory|MockObject
*/
protected $wishlistFactory;
/**
- * @var \Magento\Wishlist\Model\Wishlist|\PHPUnit\Framework\MockObject\MockObject
+ * @var Wishlist|MockObject
*/
protected $wishlist;
/**
- * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var ManagerInterface|MockObject
*/
protected $messageManager;
- protected function setUp()
+ protected function setUp(): void
{
- $this->helper = $this->getMockBuilder(\Magento\Wishlist\Helper\Data::class)
+ $this->helper = $this->getMockBuilder(Data::class)
->disableOriginalConstructor()
->getMock();
- $this->wishlistFactory = $this->getMockBuilder(\Magento\Wishlist\Model\WishlistFactory::class)
+ $this->wishlistFactory = $this->getMockBuilder(WishlistFactory::class)
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
- $this->wishlist = $this->getMockBuilder(\Magento\Wishlist\Model\Wishlist::class)
+ $this->wishlist = $this->getMockBuilder(Wishlist::class)
->disableOriginalConstructor()
->getMock();
$this->wishlistFactory->expects($this->any())
@@ -85,7 +99,7 @@ public function testExecute()
->disableOriginalConstructor()
->getMock();
- $event = $this->getMockBuilder(\Magento\Framework\Event::class)
+ $event = $this->getMockBuilder(Event::class)
->setMethods(['getCart', 'getInfo'])
->disableOriginalConstructor()
->getMock();
@@ -94,17 +108,17 @@ public function testExecute()
->method('getEvent')
->willReturn($event);
- $quoteItem = $this->getMockBuilder(\Magento\Quote\Model\Quote\Item::class)
+ $quoteItem = $this->getMockBuilder(Item::class)
->setMethods(['getProductId', 'getBuyRequest', '__wakeup'])
->disableOriginalConstructor()
->getMock();
- $buyRequest = $this->getMockBuilder(\Magento\Framework\DataObject::class)
+ $buyRequest = $this->getMockBuilder(DataObject::class)
->setMethods(['setQty'])
->disableOriginalConstructor()
->getMock();
- $infoData = $this->getMockBuilder(\Magento\Framework\DataObject::class)
+ $infoData = $this->getMockBuilder(DataObject::class)
->setMethods(['toArray'])
->disableOriginalConstructor()
->getMock();
@@ -113,8 +127,10 @@ public function testExecute()
->method('toArray')
->willReturn([$itemId => ['qty' => $itemQty, 'wishlist' => true]]);
- $cart = $this->getMockBuilder(\Magento\Checkout\Model\Cart::class)->disableOriginalConstructor()->getMock();
- $quote = $this->getMockBuilder(\Magento\Quote\Model\Quote::class)
+ $cart = $this->getMockBuilder(Cart::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $quote = $this->getMockBuilder(Quote::class)
->setMethods(['getCustomerId', 'getItemById', 'removeItem', '__wakeup'])
->disableOriginalConstructor()
->getMock();
diff --git a/app/code/Magento/Wishlist/Test/Unit/Observer/CustomerLoginTest.php b/app/code/Magento/Wishlist/Test/Unit/Observer/CustomerLoginTest.php
index 489fcb48da352..5e6beadd97cae 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Observer/CustomerLoginTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Observer/CustomerLoginTest.php
@@ -3,12 +3,17 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Wishlist\Test\Unit\Observer;
-use \Magento\Wishlist\Observer\CustomerLogin as Observer;
+use Magento\Wishlist\Helper\Data;
+use Magento\Wishlist\Observer\CustomerLogin as Observer;
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
-class CustomerLoginTest extends \PHPUnit\Framework\TestCase
+class CustomerLoginTest extends TestCase
{
/**
* @var Observer
@@ -16,13 +21,13 @@ class CustomerLoginTest extends \PHPUnit\Framework\TestCase
protected $observer;
/**
- * @var \Magento\Wishlist\Helper\Data|\PHPUnit\Framework\MockObject\MockObject
+ * @var Data|MockObject
*/
protected $helper;
- protected function setUp()
+ protected function setUp(): void
{
- $this->helper = $this->getMockBuilder(\Magento\Wishlist\Helper\Data::class)
+ $this->helper = $this->getMockBuilder(Data::class)
->disableOriginalConstructor()
->getMock();
@@ -34,7 +39,7 @@ public function testExecute()
$event = $this->getMockBuilder(\Magento\Framework\Event\Observer::class)
->disableOriginalConstructor()
->getMock();
- /** @var $event \Magento\Framework\Event\Observer */
+ /** @var \Magento\Framework\Event\Observer $event */
$this->helper->expects($this->once())
->method('calculate');
diff --git a/app/code/Magento/Wishlist/Test/Unit/Observer/CustomerLogoutTest.php b/app/code/Magento/Wishlist/Test/Unit/Observer/CustomerLogoutTest.php
index da5ab765a2287..7fefc248823db 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Observer/CustomerLogoutTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Observer/CustomerLogoutTest.php
@@ -3,11 +3,16 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Wishlist\Test\Unit\Observer;
-use \Magento\Wishlist\Observer\CustomerLogout as Observer;
+use Magento\Customer\Model\Session;
+use Magento\Wishlist\Observer\CustomerLogout as Observer;
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
-class CustomerLogoutTest extends \PHPUnit\Framework\TestCase
+class CustomerLogoutTest extends TestCase
{
/**
* @var Observer
@@ -15,13 +20,13 @@ class CustomerLogoutTest extends \PHPUnit\Framework\TestCase
protected $observer;
/**
- * @var \Magento\Customer\Model\Session|\PHPUnit\Framework\MockObject\MockObject
+ * @var Session|MockObject
*/
protected $customerSession;
- protected function setUp()
+ protected function setUp(): void
{
- $this->customerSession = $this->getMockBuilder(\Magento\Customer\Model\Session::class)
+ $this->customerSession = $this->getMockBuilder(Session::class)
->disableOriginalConstructor()
->setMethods(['setWishlistItemCount', 'isLoggedIn', 'getCustomerId'])
->getMock();
@@ -36,11 +41,11 @@ public function testExecute()
$event = $this->getMockBuilder(\Magento\Framework\Event\Observer::class)
->disableOriginalConstructor()
->getMock();
- /** @var $event \Magento\Framework\Event\Observer */
+ /** @var \Magento\Framework\Event\Observer $event */
$this->customerSession->expects($this->once())
->method('setWishlistItemCount')
- ->with($this->equalTo(0));
+ ->with(0);
$this->observer->execute($event);
}
diff --git a/app/code/Magento/Wishlist/Test/Unit/Plugin/Model/ResourceModel/ProductTest.php b/app/code/Magento/Wishlist/Test/Unit/Plugin/Model/ResourceModel/ProductTest.php
index ab999902f61bd..01dc72555d69d 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Plugin/Model/ResourceModel/ProductTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Plugin/Model/ResourceModel/ProductTest.php
@@ -32,7 +32,7 @@ class ProductTest extends TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->wishlistCleaner = $this->createMock(WishlistCleaner::class);
$this->model = new Plugin($this->wishlistCleaner);
@@ -45,7 +45,7 @@ protected function setUp()
*/
public function testExecute()
{
- $product = $this->createMock(ProductInterface::class);
+ $product = $this->getMockForAbstractClass(ProductInterface::class);
$productResourceModel = $this->createMock(ProductResourceModel::class);
$this->wishlistCleaner->expects($this->once())->method('execute')->with($product);
$this->model->beforeDelete($productResourceModel, $product);
diff --git a/app/code/Magento/Wishlist/Test/Unit/Plugin/Ui/DataProvider/WishlistSettingsTest.php b/app/code/Magento/Wishlist/Test/Unit/Plugin/Ui/DataProvider/WishlistSettingsTest.php
index c498ec270dea1..66354e5252132 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Plugin/Ui/DataProvider/WishlistSettingsTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Plugin/Ui/DataProvider/WishlistSettingsTest.php
@@ -10,11 +10,13 @@
use Magento\Catalog\Ui\DataProvider\Product\Listing\DataProvider;
use Magento\Wishlist\Helper\Data;
use Magento\Wishlist\Plugin\Ui\DataProvider\WishlistSettings;
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
/**
* Covers \Magento\Wishlist\Plugin\Ui\DataProvider\WishlistSettings
*/
-class WishlistSettingsTest extends \PHPUnit\Framework\TestCase
+class WishlistSettingsTest extends TestCase
{
/**
* Testable Object
@@ -24,7 +26,7 @@ class WishlistSettingsTest extends \PHPUnit\Framework\TestCase
private $wishlistSettings;
/**
- * @var Data|\PHPUnit\Framework\MockObject\MockObject
+ * @var Data|MockObject
*/
private $helperMock;
@@ -33,7 +35,7 @@ class WishlistSettingsTest extends \PHPUnit\Framework\TestCase
*
* @return void
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->helperMock = $this->createMock(Data::class);
$this->wishlistSettings = new WishlistSettings($this->helperMock);
@@ -46,7 +48,7 @@ protected function setUp()
*/
public function testAfterGetData()
{
- /** @var DataProvider|\PHPUnit\Framework\MockObject\MockObject $subjectMock */
+ /** @var DataProvider|MockObject $subjectMock */
$subjectMock = $this->createMock(DataProvider::class);
$result = [];
$isAllow = true;
diff --git a/app/code/Magento/Wishlist/Test/Unit/Pricing/ConfiguredPrice/ConfigurableProductTest.php b/app/code/Magento/Wishlist/Test/Unit/Pricing/ConfiguredPrice/ConfigurableProductTest.php
index 695ecded081c7..e3780a7af0572 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Pricing/ConfiguredPrice/ConfigurableProductTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Pricing/ConfiguredPrice/ConfigurableProductTest.php
@@ -3,54 +3,68 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Wishlist\Test\Unit\Pricing\ConfiguredPrice;
-class ConfigurableProductTest extends \PHPUnit\Framework\TestCase
+use Magento\Catalog\Model\Product;
+use Magento\Framework\Pricing\Adjustment\CalculatorInterface;
+use Magento\Framework\Pricing\Price\PriceInterface;
+use Magento\Framework\Pricing\PriceCurrencyInterface;
+use Magento\Framework\Pricing\PriceInfo\Base;
+use Magento\Framework\Pricing\PriceInfoInterface;
+use Magento\Framework\Pricing\SaleableInterface;
+use Magento\Wishlist\Model\Item\Option;
+use Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct;
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
+
+class ConfigurableProductTest extends TestCase
{
/**
- * @var \Magento\Framework\Pricing\SaleableInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var SaleableInterface|MockObject
*/
private $saleableItem;
/**
- * @var \Magento\Framework\Pricing\Adjustment\CalculatorInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var CalculatorInterface|MockObject
*/
private $calculator;
/**
- * @var \Magento\Framework\Pricing\PriceCurrencyInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var PriceCurrencyInterface|MockObject
*/
private $priceCurrency;
/**
- * @var \Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct
+ * @var ConfigurableProduct
*/
private $model;
/**
- * @var \Magento\Framework\Pricing\PriceInfoInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var PriceInfoInterface|MockObject
*/
private $priceInfoMock;
- protected function setUp()
+ protected function setUp(): void
{
- $this->priceInfoMock = $this->getMockBuilder(\Magento\Framework\Pricing\PriceInfoInterface::class)
+ $this->priceInfoMock = $this->getMockBuilder(PriceInfoInterface::class)
->getMockForAbstractClass();
-
- $this->saleableItem = $this->getMockBuilder(\Magento\Framework\Pricing\SaleableInterface::class)
+
+ $this->saleableItem = $this->getMockBuilder(SaleableInterface::class)
->setMethods([
'getPriceInfo',
'getCustomOption',
])
->getMockForAbstractClass();
- $this->calculator = $this->getMockBuilder(\Magento\Framework\Pricing\Adjustment\CalculatorInterface::class)
+ $this->calculator = $this->getMockBuilder(CalculatorInterface::class)
->getMockForAbstractClass();
- $this->priceCurrency = $this->getMockBuilder(\Magento\Framework\Pricing\PriceCurrencyInterface::class)
+ $this->priceCurrency = $this->getMockBuilder(PriceCurrencyInterface::class)
->getMockForAbstractClass();
- $this->model = new \Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct(
+ $this->model = new ConfigurableProduct(
$this->saleableItem,
null,
$this->calculator,
@@ -62,28 +76,28 @@ public function testGetValue()
{
$priceValue = 10;
- $priceMock = $this->getMockBuilder(\Magento\Framework\Pricing\Price\PriceInterface::class)
+ $priceMock = $this->getMockBuilder(PriceInterface::class)
->getMockForAbstractClass();
$priceMock->expects($this->once())
->method('getValue')
->willReturn($priceValue);
- $this->priceInfoMock = $this->getMockBuilder(\Magento\Framework\Pricing\PriceInfo\Base::class)
+ $this->priceInfoMock = $this->getMockBuilder(Base::class)
->disableOriginalConstructor()
->getMock();
$this->priceInfoMock->expects($this->once())
->method('getPrice')
- ->with(\Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct::PRICE_CODE)
+ ->with(ConfigurableProduct::PRICE_CODE)
->willReturn($priceMock);
- $productMock = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
+ $productMock = $this->getMockBuilder(Product::class)
->disableOriginalConstructor()
->getMock();
$productMock->expects($this->once())
->method('getPriceInfo')
->willReturn($this->priceInfoMock);
- $wishlistItemOptionMock = $this->getMockBuilder(\Magento\Wishlist\Model\Item\Option::class)
+ $wishlistItemOptionMock = $this->getMockBuilder(Option::class)
->disableOriginalConstructor()
->getMock();
$wishlistItemOptionMock->expects($this->once())
@@ -102,7 +116,7 @@ public function testGetValueWithNoCustomOption()
{
$priceValue = 100;
- $priceMock = $this->getMockBuilder(\Magento\Framework\Pricing\Price\PriceInterface::class)
+ $priceMock = $this->getMockBuilder(PriceInterface::class)
->getMockForAbstractClass();
$priceMock->expects($this->once())
->method('getValue')
@@ -119,7 +133,7 @@ public function testGetValueWithNoCustomOption()
$this->priceInfoMock->expects($this->once())
->method('getPrice')
- ->with(\Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct::PRICE_CODE)
+ ->with(ConfigurableProduct::PRICE_CODE)
->willReturn($priceMock);
$this->assertEquals(100, $this->model->getValue());
diff --git a/app/code/Magento/Wishlist/Test/Unit/Pricing/ConfiguredPrice/DownloadableTest.php b/app/code/Magento/Wishlist/Test/Unit/Pricing/ConfiguredPrice/DownloadableTest.php
index ed2318274d1c0..66eb9462898d2 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Pricing/ConfiguredPrice/DownloadableTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Pricing/ConfiguredPrice/DownloadableTest.php
@@ -3,29 +3,37 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Wishlist\Test\Unit\Pricing\ConfiguredPrice;
use Magento\Catalog\Pricing\Price\BasePrice;
+use Magento\Downloadable\Model\Link;
+use Magento\Downloadable\Model\Product\Type;
use Magento\Framework\Pricing\Adjustment\CalculatorInterface;
+use Magento\Framework\Pricing\Price\PriceInterface;
use Magento\Framework\Pricing\PriceCurrencyInterface;
use Magento\Framework\Pricing\PriceInfoInterface;
use Magento\Framework\Pricing\SaleableInterface;
+use Magento\Wishlist\Model\Item\Option;
use Magento\Wishlist\Pricing\ConfiguredPrice\Downloadable;
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
-class DownloadableTest extends \PHPUnit\Framework\TestCase
+class DownloadableTest extends TestCase
{
/**
- * @var SaleableInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var SaleableInterface|MockObject
*/
private $saleableItem;
/**
- * @var CalculatorInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var CalculatorInterface|MockObject
*/
private $calculator;
/**
- * @var PriceCurrencyInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var PriceCurrencyInterface|MockObject
*/
private $priceCurrency;
@@ -35,16 +43,16 @@ class DownloadableTest extends \PHPUnit\Framework\TestCase
private $model;
/**
- * @var PriceInfoInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var PriceInfoInterface|MockObject
*/
private $priceInfoMock;
- protected function setUp()
+ protected function setUp(): void
{
- $this->priceInfoMock = $this->getMockBuilder(\Magento\Framework\Pricing\PriceInfoInterface::class)
+ $this->priceInfoMock = $this->getMockBuilder(PriceInfoInterface::class)
->getMockForAbstractClass();
- $this->saleableItem = $this->getMockBuilder(\Magento\Framework\Pricing\SaleableInterface::class)
+ $this->saleableItem = $this->getMockBuilder(SaleableInterface::class)
->setMethods([
'getPriceInfo',
'getLinksPurchasedSeparately',
@@ -56,10 +64,10 @@ protected function setUp()
->method('getPriceInfo')
->willReturn($this->priceInfoMock);
- $this->calculator = $this->getMockBuilder(\Magento\Framework\Pricing\Adjustment\CalculatorInterface::class)
+ $this->calculator = $this->getMockBuilder(CalculatorInterface::class)
->getMockForAbstractClass();
- $this->priceCurrency = $this->getMockBuilder(\Magento\Framework\Pricing\PriceCurrencyInterface::class)
+ $this->priceCurrency = $this->getMockBuilder(PriceCurrencyInterface::class)
->getMockForAbstractClass();
$this->model = new Downloadable(
@@ -74,21 +82,21 @@ public function testGetValue()
{
$priceValue = 10;
- $wishlistItemOptionMock = $this->getMockBuilder(\Magento\Wishlist\Model\Item\Option::class)
+ $wishlistItemOptionMock = $this->getMockBuilder(Option::class)
->disableOriginalConstructor()
->getMock();
$wishlistItemOptionMock->expects($this->once())
->method('getValue')
->willReturn('1,2');
- $linkMock = $this->getMockBuilder(\Magento\Downloadable\Model\Link::class)
+ $linkMock = $this->getMockBuilder(Link::class)
->disableOriginalConstructor()
->getMock();
$linkMock->expects($this->once())
->method('getPrice')
->willReturn(10);
- $productTypeMock = $this->getMockBuilder(\Magento\Downloadable\Model\Product\Type::class)
+ $productTypeMock = $this->getMockBuilder(Type::class)
->disableOriginalConstructor()
->getMock();
$productTypeMock->expects($this->once())
@@ -96,7 +104,7 @@ public function testGetValue()
->with($this->saleableItem)
->willReturn([1 => $linkMock]);
- $priceMock = $this->getMockBuilder(\Magento\Framework\Pricing\Price\PriceInterface::class)
+ $priceMock = $this->getMockBuilder(PriceInterface::class)
->getMockForAbstractClass();
$priceMock->expects($this->once())
->method('getValue')
@@ -125,7 +133,7 @@ public function testGetValueNoLinksPurchasedSeparately()
{
$priceValue = 10;
- $priceMock = $this->getMockBuilder(\Magento\Framework\Pricing\Price\PriceInterface::class)
+ $priceMock = $this->getMockBuilder(PriceInterface::class)
->getMockForAbstractClass();
$priceMock->expects($this->once())
->method('getValue')
@@ -147,7 +155,7 @@ public function testGetValueNoOptions()
{
$priceValue = 10;
- $priceMock = $this->getMockBuilder(\Magento\Framework\Pricing\Price\PriceInterface::class)
+ $priceMock = $this->getMockBuilder(PriceInterface::class)
->getMockForAbstractClass();
$priceMock->expects($this->once())
->method('getValue')
@@ -158,14 +166,14 @@ public function testGetValueNoOptions()
->with(BasePrice::PRICE_CODE)
->willReturn($priceMock);
- $wishlistItemOptionMock = $this->getMockBuilder(\Magento\Wishlist\Model\Item\Option::class)
+ $wishlistItemOptionMock = $this->getMockBuilder(Option::class)
->disableOriginalConstructor()
->getMock();
$wishlistItemOptionMock->expects($this->once())
->method('getValue')
->willReturn(null);
- $productTypeMock = $this->getMockBuilder(\Magento\Downloadable\Model\Product\Type::class)
+ $productTypeMock = $this->getMockBuilder(Type::class)
->disableOriginalConstructor()
->getMock();
$productTypeMock->expects($this->once())
@@ -189,7 +197,7 @@ public function testGetValueNoOptions()
public function testGetValueWithNoCustomOption()
{
- $priceMock = $this->getMockBuilder(\Magento\Framework\Pricing\Price\PriceInterface::class)
+ $priceMock = $this->getMockBuilder(PriceInterface::class)
->getMockForAbstractClass();
$priceMock->expects($this->once())
->method('getValue')
diff --git a/app/code/Magento/Wishlist/Test/Unit/Pricing/Render/ConfiguredPriceBoxTest.php b/app/code/Magento/Wishlist/Test/Unit/Pricing/Render/ConfiguredPriceBoxTest.php
index 1ec47db91f194..8f533a6032ccf 100644
--- a/app/code/Magento/Wishlist/Test/Unit/Pricing/Render/ConfiguredPriceBoxTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/Pricing/Render/ConfiguredPriceBoxTest.php
@@ -3,29 +3,39 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Wishlist\Test\Unit\Pricing\Render;
+use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface;
+use Magento\Framework\Pricing\Price\PriceInterface;
+use Magento\Framework\Pricing\Render\RendererPool;
+use Magento\Framework\Pricing\SaleableInterface;
+use Magento\Framework\View\Element\Template\Context;
+use Magento\Framework\View\LayoutInterface;
use Magento\Wishlist\Pricing\Render\ConfiguredPriceBox;
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
-class ConfiguredPriceBoxTest extends \PHPUnit\Framework\TestCase
+class ConfiguredPriceBoxTest extends TestCase
{
/**
- * @var \Magento\Framework\View\Element\Template\Context|\PHPUnit\Framework\MockObject\MockObject
+ * @var Context|MockObject
*/
private $templateContext;
/**
- * @var \Magento\Framework\Pricing\SaleableInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var SaleableInterface|MockObject
*/
private $saleableItem;
/**
- * @var \Magento\Framework\Pricing\Price\PriceInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var PriceInterface|MockObject
*/
private $price;
/**
- * @var \Magento\Framework\Pricing\Render\RendererPool|\PHPUnit\Framework\MockObject\MockObject
+ * @var RendererPool|MockObject
*/
private $rendererPool;
@@ -35,28 +45,28 @@ class ConfiguredPriceBoxTest extends \PHPUnit\Framework\TestCase
private $model;
/**
- * @var \Magento\Catalog\Model\Product\Configuration\Item\ItemInterface|\PHPUnit\Framework\MockObject\MockObject
+ * @var ItemInterface|MockObject
*/
private $item;
- protected function setUp()
+ protected function setUp(): void
{
- $this->templateContext = $this->getMockBuilder(\Magento\Framework\View\Element\Template\Context::class)
+ $this->templateContext = $this->getMockBuilder(Context::class)
->disableOriginalConstructor()
->getMock();
- $this->saleableItem = $this->getMockBuilder(\Magento\Framework\Pricing\SaleableInterface::class)
+ $this->saleableItem = $this->getMockBuilder(SaleableInterface::class)
->getMockForAbstractClass();
- $this->price = $this->getMockBuilder(\Magento\Framework\Pricing\Price\PriceInterface::class)
+ $this->price = $this->getMockBuilder(PriceInterface::class)
->setMethods(['setItem'])
->getMockForAbstractClass();
- $this->rendererPool = $this->getMockBuilder(\Magento\Framework\Pricing\Render\RendererPool::class)
+ $this->rendererPool = $this->getMockBuilder(RendererPool::class)
->disableOriginalConstructor()
->getMock();
- $this->item = $this->getMockBuilder(\Magento\Catalog\Model\Product\Configuration\Item\ItemInterface::class)
+ $this->item = $this->getMockBuilder(ItemInterface::class)
->getMockForAbstractClass();
$this->model = new ConfiguredPriceBox(
@@ -70,7 +80,7 @@ protected function setUp()
public function testSetLayout()
{
- $layoutMock = $this->getMockBuilder(\Magento\Framework\View\LayoutInterface::class)
+ $layoutMock = $this->getMockBuilder(LayoutInterface::class)
->getMockForAbstractClass();
$this->price->expects($this->once())
@@ -79,7 +89,7 @@ public function testSetLayout()
->willReturnSelf();
$this->assertInstanceOf(
- \Magento\Wishlist\Pricing\Render\ConfiguredPriceBox::class,
+ ConfiguredPriceBox::class,
$this->model->setLayout($layoutMock)
);
}
diff --git a/app/code/Magento/Wishlist/Test/Unit/ViewModel/AllowedQuantityTest.php b/app/code/Magento/Wishlist/Test/Unit/ViewModel/AllowedQuantityTest.php
index 23e28abf20959..f272a319ea002 100644
--- a/app/code/Magento/Wishlist/Test/Unit/ViewModel/AllowedQuantityTest.php
+++ b/app/code/Magento/Wishlist/Test/Unit/ViewModel/AllowedQuantityTest.php
@@ -15,9 +15,6 @@
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
-/**
- * Class AllowedQuantityTest
- */
class AllowedQuantityTest extends TestCase
{
/**
@@ -48,7 +45,7 @@ class AllowedQuantityTest extends TestCase
/**
* Set Up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->stockRegistryMock = $this->createMock(StockRegistry::class);
$this->itemMock = $this->getMockForAbstractClass(
@@ -104,7 +101,7 @@ public function testGettingMinMaxQty(int $minSaleQty, int $maxSaleQty, array $ex
->willReturn($maxSaleQty);
$this->stockRegistryMock->expects($this->any())
->method('getStockItem')
- ->will($this->returnValue($this->itemMock));
+ ->willReturn($this->itemMock);
$result = $this->sut->getMinMaxQty();
diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json
index dc43315c6839d..b426ffe01cecc 100644
--- a/app/code/Magento/Wishlist/composer.json
+++ b/app/code/Magento/Wishlist/composer.json
@@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-catalog": "*",
diff --git a/app/code/Magento/WishlistAnalytics/composer.json b/app/code/Magento/WishlistAnalytics/composer.json
index fbd0b9e2d5c2e..309257f857ed2 100644
--- a/app/code/Magento/WishlistAnalytics/composer.json
+++ b/app/code/Magento/WishlistAnalytics/composer.json
@@ -2,7 +2,7 @@
"name": "magento/module-wishlist-analytics",
"description": "N/A",
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/module-wishlist": "*",
"magento/module-analytics": "*"
diff --git a/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php
index 67c38561c7e41..8385d3ca852a4 100644
--- a/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php
+++ b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php
@@ -51,15 +51,15 @@ class CustomerWishlistResolverTest extends TestCase
/**
* Build the Testing Environment
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->contextMock = $this->getMockBuilder(ContextInterface::class)
->setMethods(['getExtensionAttributes', 'getUserId'])
- ->getMock();
+ ->getMockForAbstractClass();
$this->extensionAttributesMock = $this->getMockBuilder(ContextExtensionInterface::class)
->setMethods(['getStore', 'setStore', 'getIsCustomer', 'setIsCustomer'])
- ->getMock();
+ ->getMockForAbstractClass();
$this->contextMock->method('getExtensionAttributes')
->willReturn($this->extensionAttributesMock);
diff --git a/app/code/Magento/WishlistGraphQl/composer.json b/app/code/Magento/WishlistGraphQl/composer.json
index 11dd9944d6938..7a3fca599a4b3 100644
--- a/app/code/Magento/WishlistGraphQl/composer.json
+++ b/app/code/Magento/WishlistGraphQl/composer.json
@@ -3,7 +3,7 @@
"description": "N/A",
"type": "magento2-module",
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/module-catalog-graph-ql": "*",
"magento/module-wishlist": "*",
diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json
index a7553f8b6fb09..249441be1753e 100644
--- a/app/design/adminhtml/Magento/backend/composer.json
+++ b/app/design/adminhtml/Magento/backend/composer.json
@@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*"
},
"type": "magento2-theme",
diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json
index 1857d9d597d05..066d0cd1cc9f2 100644
--- a/app/design/frontend/Magento/blank/composer.json
+++ b/app/design/frontend/Magento/blank/composer.json
@@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*"
},
"type": "magento2-theme",
diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json
index 586d255cf4ec7..16bed43fe8cbf 100644
--- a/app/design/frontend/Magento/luma/composer.json
+++ b/app/design/frontend/Magento/luma/composer.json
@@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/theme-frontend-blank": "*"
},
diff --git a/composer.json b/composer.json
index 6d63a5328cec2..bb70029021765 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
"sort-packages": true
},
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"ext-bcmath": "*",
"ext-ctype": "*",
"ext-curl": "*",
@@ -31,13 +31,13 @@
"braintree/braintree_php": "3.35.0",
"colinmollenhour/cache-backend-file": "~1.4.1",
"colinmollenhour/cache-backend-redis": "1.11.0",
- "colinmollenhour/credis": "1.10.0",
+ "colinmollenhour/credis": "1.11.1",
"colinmollenhour/php-redis-session-abstract": "~1.4.0",
- "composer/composer": "^1.6",
+ "composer/composer": "^1.9",
"elasticsearch/elasticsearch": "~7.6",
"guzzlehttp/guzzle": "^6.3.3",
"laminas/laminas-captcha": "^2.7.1",
- "laminas/laminas-code": "~3.3.0",
+ "laminas/laminas-code": "~3.4.1",
"laminas/laminas-config": "^2.6.0",
"laminas/laminas-console": "^2.6.0",
"laminas/laminas-crypt": "^2.6.0",
@@ -70,7 +70,7 @@
"magento/zendframework1": "~1.14.2",
"monolog/monolog": "^1.17",
"paragonie/sodium_compat": "^1.6",
- "pelago/emogrifier": "^2.0.0",
+ "pelago/emogrifier": "^3.1.0",
"php-amqplib/php-amqplib": "~2.7.0||~2.10.0",
"phpseclib/mcrypt_compat": "1.0.8",
"phpseclib/phpseclib": "2.0.*",
@@ -86,17 +86,17 @@
"require-dev": {
"allure-framework/allure-phpunit": "~1.2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
- "friendsofphp/php-cs-fixer": "~2.14.0",
+ "friendsofphp/php-cs-fixer": "~2.16.0",
"lusitanian/oauth": "~0.8.10",
"magento/magento-coding-standard": "*",
- "magento/magento2-functional-testing-framework": "dev-3.0.0-RC1",
- "pdepend/pdepend": "2.5.2",
+ "magento/magento2-functional-testing-framework": "dev-3.0.0-RC2",
+ "pdepend/pdepend": "~2.7.1",
"phpcompatibility/php-compatibility": "^9.3",
- "phpmd/phpmd": "@stable",
+ "phpmd/phpmd": "^2.8.0",
"phpstan/phpstan": "^0.12.3",
- "phpunit/phpunit": "~6.5.0",
- "sebastian/phpcpd": "~3.0.0",
- "squizlabs/php_codesniffer": "~3.4.0"
+ "phpunit/phpunit": "^9",
+ "sebastian/phpcpd": "~5.0.0",
+ "squizlabs/php_codesniffer": "~3.5.4"
},
"suggest": {
"ext-pcntl": "Need for run processes in parallel mode"
diff --git a/composer.lock b/composer.lock
index 8a41c7b609e70..350a2f9c5a2ed 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "02c03e264c9040e0e229bc22fbdcec61",
+ "content-hash": "087f8432a6f317056b40a0b8a160a2cf",
"packages": [
{
"name": "braintree/braintree_php",
@@ -124,16 +124,16 @@
},
{
"name": "colinmollenhour/credis",
- "version": "1.10.0",
+ "version": "1.11.1",
"source": {
"type": "git",
"url": "https://github.com/colinmollenhour/credis.git",
- "reference": "8ab6db707c821055f9856b8cf76d5f44beb6fd8a"
+ "reference": "bd1da4698ab1918477f9e71e5ff0062b9a345008"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/8ab6db707c821055f9856b8cf76d5f44beb6fd8a",
- "reference": "8ab6db707c821055f9856b8cf76d5f44beb6fd8a",
+ "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/bd1da4698ab1918477f9e71e5ff0062b9a345008",
+ "reference": "bd1da4698ab1918477f9e71e5ff0062b9a345008",
"shasum": ""
},
"require": {
@@ -160,7 +160,7 @@
],
"description": "Credis is a lightweight interface to the Redis key-value store which wraps the phpredis library when available for better performance.",
"homepage": "https://github.com/colinmollenhour/credis",
- "time": "2018-05-07T14:45:04+00:00"
+ "time": "2019-11-26T18:09:45+00:00"
},
{
"name": "colinmollenhour/php-redis-session-abstract",
@@ -257,16 +257,16 @@
},
{
"name": "composer/composer",
- "version": "1.10.5",
+ "version": "1.10.6",
"source": {
"type": "git",
"url": "https://github.com/composer/composer.git",
- "reference": "7a4d5b6aa30d2118af27c04f5e897b57156ccfa9"
+ "reference": "be81b9c4735362c26876bdbfd3b5bc7e7f711c88"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/composer/zipball/7a4d5b6aa30d2118af27c04f5e897b57156ccfa9",
- "reference": "7a4d5b6aa30d2118af27c04f5e897b57156ccfa9",
+ "url": "https://api.github.com/repos/composer/composer/zipball/be81b9c4735362c26876bdbfd3b5bc7e7f711c88",
+ "reference": "be81b9c4735362c26876bdbfd3b5bc7e7f711c88",
"shasum": ""
},
"require": {
@@ -285,7 +285,8 @@
"symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0"
},
"conflict": {
- "symfony/console": "2.8.38"
+ "symfony/console": "2.8.38",
+ "symfony/phpunit-bridge": "3.4.40"
},
"require-dev": {
"phpspec/prophecy": "^1.10",
@@ -333,7 +334,7 @@
"dependency",
"package"
],
- "time": "2020-04-10T09:44:22+00:00"
+ "time": "2020-05-06T08:28:10+00:00"
},
{
"name": "composer/semver",
@@ -1015,16 +1016,16 @@
},
{
"name": "laminas/laminas-code",
- "version": "3.3.2",
+ "version": "3.4.1",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-code.git",
- "reference": "128784abc7a0d9e1fcc30c446533aa6f1db1f999"
+ "reference": "1cb8f203389ab1482bf89c0e70a04849bacd7766"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laminas/laminas-code/zipball/128784abc7a0d9e1fcc30c446533aa6f1db1f999",
- "reference": "128784abc7a0d9e1fcc30c446533aa6f1db1f999",
+ "url": "https://api.github.com/repos/laminas/laminas-code/zipball/1cb8f203389ab1482bf89c0e70a04849bacd7766",
+ "reference": "1cb8f203389ab1482bf89c0e70a04849bacd7766",
"shasum": ""
},
"require": {
@@ -1032,15 +1033,18 @@
"laminas/laminas-zendframework-bridge": "^1.0",
"php": "^7.1"
},
+ "conflict": {
+ "phpspec/prophecy": "<1.9.0"
+ },
"replace": {
"zendframework/zend-code": "self.version"
},
"require-dev": {
- "doctrine/annotations": "^1.0",
+ "doctrine/annotations": "^1.7",
"ext-phar": "*",
"laminas/laminas-coding-standard": "^1.0",
"laminas/laminas-stdlib": "^2.7 || ^3.0",
- "phpunit/phpunit": "^7.5.15"
+ "phpunit/phpunit": "^7.5.16 || ^8.4"
},
"suggest": {
"doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features",
@@ -1049,8 +1053,9 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.3.x-dev",
- "dev-develop": "3.4.x-dev"
+ "dev-master": "3.4.x-dev",
+ "dev-develop": "3.5.x-dev",
+ "dev-dev-4.0": "4.0.x-dev"
}
},
"autoload": {
@@ -1068,7 +1073,7 @@
"code",
"laminas"
],
- "time": "2019-12-31T16:28:14+00:00"
+ "time": "2019-12-31T16:28:24+00:00"
},
{
"name": "laminas/laminas-config",
@@ -2242,16 +2247,16 @@
},
{
"name": "laminas/laminas-mail",
- "version": "2.10.0",
+ "version": "2.10.1",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-mail.git",
- "reference": "019fb670c1dff6be7fc91d3b88942bd0a5f68792"
+ "reference": "cfe0711446c8d9c392e9fc664c9ccc180fa89005"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laminas/laminas-mail/zipball/019fb670c1dff6be7fc91d3b88942bd0a5f68792",
- "reference": "019fb670c1dff6be7fc91d3b88942bd0a5f68792",
+ "url": "https://api.github.com/repos/laminas/laminas-mail/zipball/cfe0711446c8d9c392e9fc664c9ccc180fa89005",
+ "reference": "cfe0711446c8d9c392e9fc664c9ccc180fa89005",
"shasum": ""
},
"require": {
@@ -2265,7 +2270,7 @@
"true/punycode": "^2.1"
},
"replace": {
- "zendframework/zend-mail": "self.version"
+ "zendframework/zend-mail": "^2.10.0"
},
"require-dev": {
"laminas/laminas-coding-standard": "~1.0.0",
@@ -2304,7 +2309,7 @@
"laminas",
"mail"
],
- "time": "2019-12-31T17:21:22+00:00"
+ "time": "2020-04-21T16:42:19+00:00"
},
{
"name": "laminas/laminas-math",
@@ -3304,21 +3309,21 @@
"source": {
"type": "git",
"url": "https://github.com/magento/composer.git",
- "reference": "fe738ac9155f550b669b260b3cfa6422eacb53fa"
+ "reference": "f3e4bec8fc73a97a6cbc391b1b93d4c32566763d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/magento/composer/zipball/fe738ac9155f550b669b260b3cfa6422eacb53fa",
- "reference": "fe738ac9155f550b669b260b3cfa6422eacb53fa",
+ "url": "https://api.github.com/repos/magento/composer/zipball/f3e4bec8fc73a97a6cbc391b1b93d4c32566763d",
+ "reference": "f3e4bec8fc73a97a6cbc391b1b93d4c32566763d",
"shasum": ""
},
"require": {
- "composer/composer": "^1.6",
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "composer/composer": "^1.9",
+ "php": "~7.3.0||~7.4.0",
"symfony/console": "~4.4.0"
},
"require-dev": {
- "phpunit/phpunit": "~7.0.0"
+ "phpunit/phpunit": "^9"
},
"type": "library",
"autoload": {
@@ -3332,7 +3337,7 @@
"AFL-3.0"
],
"description": "Magento composer library helps to instantiate Composer application and run composer commands.",
- "time": "2020-01-17T16:43:51+00:00"
+ "time": "2020-05-08T01:07:09+00:00"
},
{
"name": "magento/magento-composer-installer",
@@ -3667,34 +3672,34 @@
},
{
"name": "pelago/emogrifier",
- "version": "v2.2.0",
+ "version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/MyIntervals/emogrifier.git",
- "reference": "2472bc1c3a2dee8915ecc2256139c6100024332f"
+ "reference": "f6a5c7d44612d86c3901c93f1592f5440e6b2cd8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/MyIntervals/emogrifier/zipball/2472bc1c3a2dee8915ecc2256139c6100024332f",
- "reference": "2472bc1c3a2dee8915ecc2256139c6100024332f",
+ "url": "https://api.github.com/repos/MyIntervals/emogrifier/zipball/f6a5c7d44612d86c3901c93f1592f5440e6b2cd8",
+ "reference": "f6a5c7d44612d86c3901c93f1592f5440e6b2cd8",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
- "php": "^5.5.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0",
- "symfony/css-selector": "^3.4.0 || ^4.0.0"
+ "php": "^5.6 || ~7.0 || ~7.1 || ~7.2 || ~7.3 || ~7.4",
+ "symfony/css-selector": "^2.8 || ^3.0 || ^4.0 || ^5.0"
},
"require-dev": {
- "friendsofphp/php-cs-fixer": "^2.2.0",
- "phpmd/phpmd": "^2.6.0",
- "phpunit/phpunit": "^4.8.0",
- "squizlabs/php_codesniffer": "^3.3.2"
+ "friendsofphp/php-cs-fixer": "^2.15.3",
+ "phpmd/phpmd": "^2.7.0",
+ "phpunit/phpunit": "^5.7.27",
+ "squizlabs/php_codesniffer": "^3.5.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0.x-dev"
+ "dev-master": "4.0.x-dev"
}
},
"autoload": {
@@ -3737,7 +3742,7 @@
"email",
"pre-processing"
],
- "time": "2019-09-04T16:07:59+00:00"
+ "time": "2019-12-26T19:37:31+00:00"
},
{
"name": "php-amqplib/php-amqplib",
@@ -4269,20 +4274,20 @@
},
{
"name": "seld/jsonlint",
- "version": "1.7.2",
+ "version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/jsonlint.git",
- "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19"
+ "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/e2e5d290e4d2a4f0eb449f510071392e00e10d19",
- "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19",
+ "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1",
+ "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1",
"shasum": ""
},
"require": {
- "php": "^5.3 || ^7.0"
+ "php": "^5.3 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
@@ -4314,7 +4319,7 @@
"parser",
"validator"
],
- "time": "2019-10-24T14:27:39+00:00"
+ "time": "2020-04-30T19:05:18+00:00"
},
{
"name": "seld/phar-utils",
@@ -4362,7 +4367,7 @@
},
{
"name": "symfony/console",
- "version": "v4.4.7",
+ "version": "v4.4.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
@@ -4438,25 +4443,25 @@
},
{
"name": "symfony/css-selector",
- "version": "v4.4.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "afc26133a6fbdd4f8842e38893e0ee4685c7c94b"
+ "reference": "5f8d5271303dad260692ba73dfa21777d38e124e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/afc26133a6fbdd4f8842e38893e0ee4685c7c94b",
- "reference": "afc26133a6fbdd4f8842e38893e0ee4685c7c94b",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/5f8d5271303dad260692ba73dfa21777d38e124e",
+ "reference": "5f8d5271303dad260692ba73dfa21777d38e124e",
"shasum": ""
},
"require": {
- "php": "^7.1.3"
+ "php": "^7.2.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -4487,11 +4492,11 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
- "time": "2020-03-27T16:54:36+00:00"
+ "time": "2020-03-27T16:56:45+00:00"
},
{
"name": "symfony/event-dispatcher",
- "version": "v4.4.7",
+ "version": "v4.4.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
@@ -4619,26 +4624,26 @@
},
{
"name": "symfony/filesystem",
- "version": "v4.4.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "fe297193bf2e6866ed900ed2d5869362768df6a7"
+ "reference": "7cd0dafc4353a0f62e307df90b48466379c8cc91"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/fe297193bf2e6866ed900ed2d5869362768df6a7",
- "reference": "fe297193bf2e6866ed900ed2d5869362768df6a7",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/7cd0dafc4353a0f62e307df90b48466379c8cc91",
+ "reference": "7cd0dafc4353a0f62e307df90b48466379c8cc91",
"shasum": ""
},
"require": {
- "php": "^7.1.3",
+ "php": "^7.2.5",
"symfony/polyfill-ctype": "~1.8"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -4665,29 +4670,29 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2020-03-27T16:54:36+00:00"
+ "time": "2020-04-12T14:40:17+00:00"
},
{
"name": "symfony/finder",
- "version": "v4.4.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "5729f943f9854c5781984ed4907bbb817735776b"
+ "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/5729f943f9854c5781984ed4907bbb817735776b",
- "reference": "5729f943f9854c5781984ed4907bbb817735776b",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/600a52c29afc0d1caa74acbec8d3095ca7e9910d",
+ "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d",
"shasum": ""
},
"require": {
- "php": "^7.1.3"
+ "php": "^7.2.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -4714,7 +4719,7 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2020-03-27T16:54:36+00:00"
+ "time": "2020-03-27T16:56:45+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -5010,16 +5015,16 @@
},
{
"name": "symfony/process",
- "version": "v4.4.7",
+ "version": "v4.4.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "3e40e87a20eaf83a1db825e1fa5097ae89042db3"
+ "reference": "4b6a9a4013baa65d409153cbb5a895bf093dc7f4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/3e40e87a20eaf83a1db825e1fa5097ae89042db3",
- "reference": "3e40e87a20eaf83a1db825e1fa5097ae89042db3",
+ "url": "https://api.github.com/repos/symfony/process/zipball/4b6a9a4013baa65d409153cbb5a895bf093dc7f4",
+ "reference": "4b6a9a4013baa65d409153cbb5a895bf093dc7f4",
"shasum": ""
},
"require": {
@@ -5055,7 +5060,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2020-03-27T16:54:36+00:00"
+ "time": "2020-04-15T15:56:18+00:00"
},
{
"name": "symfony/service-contracts",
@@ -5377,22 +5382,22 @@
"packages-dev": [
{
"name": "allure-framework/allure-codeception",
- "version": "1.3.0",
+ "version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/allure-framework/allure-codeception.git",
- "reference": "9d31d781b3622b028f1f6210bc76ba88438bd518"
+ "reference": "9e0e25f8960fa5ac17c65c932ea8153ce6700713"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/allure-framework/allure-codeception/zipball/9d31d781b3622b028f1f6210bc76ba88438bd518",
- "reference": "9d31d781b3622b028f1f6210bc76ba88438bd518",
+ "url": "https://api.github.com/repos/allure-framework/allure-codeception/zipball/9e0e25f8960fa5ac17c65c932ea8153ce6700713",
+ "reference": "9e0e25f8960fa5ac17c65c932ea8153ce6700713",
"shasum": ""
},
"require": {
- "allure-framework/allure-php-api": "~1.1.0",
- "codeception/codeception": "~2.1",
- "php": ">=5.4.0",
+ "allure-framework/allure-php-api": "~1.1.8",
+ "codeception/codeception": "^2.3|^3.0|^4.0",
+ "php": ">=5.6",
"symfony/filesystem": ">=2.6",
"symfony/finder": ">=2.6"
},
@@ -5424,7 +5429,7 @@
"steps",
"testing"
],
- "time": "2018-12-18T19:47:23+00:00"
+ "time": "2020-03-13T11:07:13+00:00"
},
{
"name": "allure-framework/allure-php-api",
@@ -5481,23 +5486,23 @@
},
{
"name": "allure-framework/allure-phpunit",
- "version": "1.2.3",
+ "version": "1.2.4",
"source": {
"type": "git",
"url": "https://github.com/allure-framework/allure-phpunit.git",
- "reference": "45504aeba41304cf155a898fa9ac1aae79f4a089"
+ "reference": "9399629c6eed79da4be18fd22adf83ef36c2d2e0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/allure-framework/allure-phpunit/zipball/45504aeba41304cf155a898fa9ac1aae79f4a089",
- "reference": "45504aeba41304cf155a898fa9ac1aae79f4a089",
+ "url": "https://api.github.com/repos/allure-framework/allure-phpunit/zipball/9399629c6eed79da4be18fd22adf83ef36c2d2e0",
+ "reference": "9399629c6eed79da4be18fd22adf83ef36c2d2e0",
"shasum": ""
},
"require": {
"allure-framework/allure-php-api": "~1.1.0",
"mikey179/vfsstream": "1.*",
- "php": ">=7.0.0",
- "phpunit/phpunit": ">=6.0.0"
+ "php": ">=7.1.0",
+ "phpunit/phpunit": ">=7.0.0"
},
"type": "library",
"autoload": {
@@ -5527,20 +5532,20 @@
"steps",
"testing"
],
- "time": "2017-11-03T13:08:21+00:00"
+ "time": "2018-10-25T12:03:54+00:00"
},
{
"name": "aws/aws-sdk-php",
- "version": "3.134.8",
+ "version": "3.137.5",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "8a9b598a0ede2165be5988899dcebead6fcc4d41"
+ "reference": "b3309075ec2a2c695c33d8e21c07b3d5c10cdb9a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8a9b598a0ede2165be5988899dcebead6fcc4d41",
- "reference": "8a9b598a0ede2165be5988899dcebead6fcc4d41",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b3309075ec2a2c695c33d8e21c07b3d5c10cdb9a",
+ "reference": "b3309075ec2a2c695c33d8e21c07b3d5c10cdb9a",
"shasum": ""
},
"require": {
@@ -5611,7 +5616,7 @@
"s3",
"sdk"
],
- "time": "2020-04-17T18:11:57+00:00"
+ "time": "2020-05-07T18:16:43+00:00"
},
{
"name": "behat/gherkin",
@@ -5767,57 +5772,51 @@
},
{
"name": "codeception/codeception",
- "version": "2.4.5",
+ "version": "4.1.4",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Codeception.git",
- "reference": "5fee32d5c82791548931cbc34806b4de6aa1abfc"
+ "reference": "55d8d1d882fa0777e47de17b04c29b3c50fe29e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Codeception/Codeception/zipball/5fee32d5c82791548931cbc34806b4de6aa1abfc",
- "reference": "5fee32d5c82791548931cbc34806b4de6aa1abfc",
+ "url": "https://api.github.com/repos/Codeception/Codeception/zipball/55d8d1d882fa0777e47de17b04c29b3c50fe29e7",
+ "reference": "55d8d1d882fa0777e47de17b04c29b3c50fe29e7",
"shasum": ""
},
"require": {
"behat/gherkin": "^4.4.0",
- "codeception/phpunit-wrapper": "^6.0.9|^7.0.6",
- "codeception/stub": "^2.0",
+ "codeception/lib-asserts": "^1.0",
+ "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.1.1 | ^9.0",
+ "codeception/stub": "^2.0 | ^3.0",
+ "ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
- "facebook/webdriver": ">=1.1.3 <2.0",
- "guzzlehttp/guzzle": ">=4.1.4 <7.0",
- "guzzlehttp/psr7": "~1.0",
+ "guzzlehttp/psr7": "~1.4",
"php": ">=5.6.0 <8.0",
- "symfony/browser-kit": ">=2.7 <5.0",
- "symfony/console": ">=2.7 <5.0",
- "symfony/css-selector": ">=2.7 <5.0",
- "symfony/dom-crawler": ">=2.7 <5.0",
- "symfony/event-dispatcher": ">=2.7 <5.0",
- "symfony/finder": ">=2.7 <5.0",
- "symfony/yaml": ">=2.7 <5.0"
- },
- "require-dev": {
+ "symfony/console": ">=2.7 <6.0",
+ "symfony/css-selector": ">=2.7 <6.0",
+ "symfony/event-dispatcher": ">=2.7 <6.0",
+ "symfony/finder": ">=2.7 <6.0",
+ "symfony/yaml": ">=2.7 <6.0"
+ },
+ "require-dev": {
+ "codeception/module-asserts": "*@dev",
+ "codeception/module-cli": "*@dev",
+ "codeception/module-db": "*@dev",
+ "codeception/module-filesystem": "*@dev",
+ "codeception/module-phpbrowser": "*@dev",
"codeception/specify": "~0.3",
- "facebook/graph-sdk": "~5.3",
- "flow/jsonpath": "~0.2",
+ "codeception/util-universalframework": "*@dev",
"monolog/monolog": "~1.8",
- "pda/pheanstalk": "~3.0",
- "php-amqplib/php-amqplib": "~2.4",
- "predis/predis": "^1.0",
"squizlabs/php_codesniffer": "~2.0",
- "symfony/process": ">=2.7 <5.0",
- "vlucas/phpdotenv": "^2.4.0"
+ "symfony/process": ">=2.7 <6.0",
+ "vlucas/phpdotenv": "^2.0 | ^3.0 | ^4.0"
},
"suggest": {
- "aws/aws-sdk-php": "For using AWS Auth in REST module and Queue module",
- "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests",
"codeception/specify": "BDD-style code blocks",
"codeception/verify": "BDD-style assertions",
- "flow/jsonpath": "For using JSONPath in REST module",
- "league/factory-muffin": "For DataFactory module",
- "league/factory-muffin-faker": "For Faker support in DataFactory module",
- "phpseclib/phpseclib": "for SFTP option in FTP Module",
+ "hoa/console": "For interactive console functionality",
"stecman/symfony-console-completion": "For BASH autocompletion",
"symfony/phpunit-bridge": "For phpunit-bridge support"
},
@@ -5830,7 +5829,7 @@
},
"autoload": {
"psr-4": {
- "Codeception\\": "src\\Codeception",
+ "Codeception\\": "src/Codeception",
"Codeception\\Extension\\": "ext"
}
},
@@ -5854,30 +5853,220 @@
"functional testing",
"unit testing"
],
- "time": "2018-08-01T07:21:49+00:00"
+ "time": "2020-03-23T17:07:20+00:00"
+ },
+ {
+ "name": "codeception/lib-asserts",
+ "version": "1.12.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Codeception/lib-asserts.git",
+ "reference": "acd0dc8b394595a74b58dcc889f72569ff7d8e71"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Codeception/lib-asserts/zipball/acd0dc8b394595a74b58dcc889f72569ff7d8e71",
+ "reference": "acd0dc8b394595a74b58dcc889f72569ff7d8e71",
+ "shasum": ""
+ },
+ "require": {
+ "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.3 | ^9.0",
+ "php": ">=5.6.0 <8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Bodnarchuk",
+ "email": "davert@mail.ua",
+ "homepage": "http://codegyre.com"
+ },
+ {
+ "name": "Gintautas Miselis"
+ }
+ ],
+ "description": "Assertion methods used by Codeception core and Asserts module",
+ "homepage": "http://codeception.com/",
+ "keywords": [
+ "codeception"
+ ],
+ "time": "2020-04-17T18:20:46+00:00"
+ },
+ {
+ "name": "codeception/module-asserts",
+ "version": "1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Codeception/module-asserts.git",
+ "reference": "79f13d05b63f2fceba4d0e78044bab668c9b2a6b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Codeception/module-asserts/zipball/79f13d05b63f2fceba4d0e78044bab668c9b2a6b",
+ "reference": "79f13d05b63f2fceba4d0e78044bab668c9b2a6b",
+ "shasum": ""
+ },
+ "require": {
+ "codeception/codeception": "*@dev",
+ "codeception/lib-asserts": "^1.12.0",
+ "php": ">=5.6.0 <8.0"
+ },
+ "conflict": {
+ "codeception/codeception": "<4.0"
+ },
+ "require-dev": {
+ "codeception/util-robohelpers": "dev-master"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Bodnarchuk"
+ },
+ {
+ "name": "Gintautas Miselis"
+ }
+ ],
+ "description": "Codeception module containing various assertions",
+ "homepage": "http://codeception.com/",
+ "keywords": [
+ "assertions",
+ "asserts",
+ "codeception"
+ ],
+ "time": "2020-04-20T07:26:11+00:00"
+ },
+ {
+ "name": "codeception/module-sequence",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Codeception/module-sequence.git",
+ "reference": "70563527b768194d6ab22e1ff943a5e69741c5dd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Codeception/module-sequence/zipball/70563527b768194d6ab22e1ff943a5e69741c5dd",
+ "reference": "70563527b768194d6ab22e1ff943a5e69741c5dd",
+ "shasum": ""
+ },
+ "require": {
+ "codeception/codeception": "4.0.x-dev | ^4.0",
+ "php": ">=5.6.0 <8.0"
+ },
+ "require-dev": {
+ "codeception/util-robohelpers": "dev-master"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Bodnarchuk"
+ }
+ ],
+ "description": "Sequence module for Codeception",
+ "homepage": "http://codeception.com/",
+ "keywords": [
+ "codeception"
+ ],
+ "time": "2019-10-10T12:08:50+00:00"
+ },
+ {
+ "name": "codeception/module-webdriver",
+ "version": "1.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Codeception/module-webdriver.git",
+ "reference": "da55466876d9e73c09917f495b923395b1cdf92a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/da55466876d9e73c09917f495b923395b1cdf92a",
+ "reference": "da55466876d9e73c09917f495b923395b1cdf92a",
+ "shasum": ""
+ },
+ "require": {
+ "codeception/codeception": "^4.0",
+ "php": ">=5.6.0 <8.0",
+ "php-webdriver/webdriver": "^1.6.0"
+ },
+ "require-dev": {
+ "codeception/util-robohelpers": "dev-master"
+ },
+ "suggest": {
+ "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Bodnarchuk"
+ },
+ {
+ "name": "Gintautas Miselis"
+ },
+ {
+ "name": "Zaahid Bateson"
+ }
+ ],
+ "description": "WebDriver module for Codeception",
+ "homepage": "http://codeception.com/",
+ "keywords": [
+ "acceptance-testing",
+ "browser-testing",
+ "codeception"
+ ],
+ "time": "2020-04-29T13:45:52+00:00"
},
{
"name": "codeception/phpunit-wrapper",
- "version": "6.8.1",
+ "version": "9.0.2",
"source": {
"type": "git",
"url": "https://github.com/Codeception/phpunit-wrapper.git",
- "reference": "ca6e94c6dadc19db05698d4e0d84214e570ce045"
+ "reference": "eb27243d8edde68593bf8d9ef5e9074734777931"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/ca6e94c6dadc19db05698d4e0d84214e570ce045",
- "reference": "ca6e94c6dadc19db05698d4e0d84214e570ce045",
+ "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/eb27243d8edde68593bf8d9ef5e9074734777931",
+ "reference": "eb27243d8edde68593bf8d9ef5e9074734777931",
"shasum": ""
},
"require": {
- "phpunit/php-code-coverage": ">=4.0.4 <6.0",
- "phpunit/phpunit": ">=6.5.13 <7.0",
- "sebastian/comparator": ">=1.2.4 <3.0",
- "sebastian/diff": ">=1.4 <4.0"
- },
- "replace": {
- "codeception/phpunit-wrapper": "*"
+ "php": ">=7.2",
+ "phpunit/phpunit": "^9.0"
},
"require-dev": {
"codeception/specify": "*",
@@ -5897,27 +6086,30 @@
{
"name": "Davert",
"email": "davert.php@resend.cc"
+ },
+ {
+ "name": "Naktibalda"
}
],
"description": "PHPUnit classes used by Codeception",
- "time": "2020-03-20T08:05:05+00:00"
+ "time": "2020-04-17T18:16:31+00:00"
},
{
"name": "codeception/stub",
- "version": "2.1.0",
+ "version": "3.6.1",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Stub.git",
- "reference": "853657f988942f7afb69becf3fd0059f192c705a"
+ "reference": "a3ba01414cbee76a1bced9f9b6b169cc8d203880"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Codeception/Stub/zipball/853657f988942f7afb69becf3fd0059f192c705a",
- "reference": "853657f988942f7afb69becf3fd0059f192c705a",
+ "url": "https://api.github.com/repos/Codeception/Stub/zipball/a3ba01414cbee76a1bced9f9b6b169cc8d203880",
+ "reference": "a3ba01414cbee76a1bced9f9b6b169cc8d203880",
"shasum": ""
},
"require": {
- "codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.3"
+ "phpunit/phpunit": "^8.4 | ^9.0"
},
"type": "library",
"autoload": {
@@ -5930,7 +6122,7 @@
"MIT"
],
"description": "Flexible Stub wrapper for PHPUnit's Mock Builder",
- "time": "2019-03-02T15:35:10+00:00"
+ "time": "2020-02-07T18:42:28+00:00"
},
{
"name": "csharpru/vault-php",
@@ -6086,16 +6278,16 @@
},
{
"name": "doctrine/annotations",
- "version": "1.10.1",
+ "version": "1.10.2",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
- "reference": "5eb79f3dbdffed6544e1fc287572c0f462bd29bb"
+ "reference": "b9d758e831c70751155c698c2f7df4665314a1cb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/5eb79f3dbdffed6544e1fc287572c0f462bd29bb",
- "reference": "5eb79f3dbdffed6544e1fc287572c0f462bd29bb",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/b9d758e831c70751155c698c2f7df4665314a1cb",
+ "reference": "b9d758e831c70751155c698c2f7df4665314a1cb",
"shasum": ""
},
"require": {
@@ -6151,7 +6343,7 @@
"docblock",
"parser"
],
- "time": "2020-04-02T12:33:25+00:00"
+ "time": "2020-04-20T09:18:32+00:00"
},
{
"name": "doctrine/cache",
@@ -6422,16 +6614,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
- "version": "v2.14.6",
+ "version": "v2.16.3",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
- "reference": "8d18a8bb180e2acde1c8031db09aefb9b73f6127"
+ "reference": "83baf823a33a1cbd5416c8626935cf3f843c10b0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/8d18a8bb180e2acde1c8031db09aefb9b73f6127",
- "reference": "8d18a8bb180e2acde1c8031db09aefb9b73f6127",
+ "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/83baf823a33a1cbd5416c8626935cf3f843c10b0",
+ "reference": "83baf823a33a1cbd5416c8626935cf3f843c10b0",
"shasum": ""
},
"require": {
@@ -6442,15 +6634,15 @@
"ext-tokenizer": "*",
"php": "^5.6 || ^7.0",
"php-cs-fixer/diff": "^1.3",
- "symfony/console": "^3.4.17 || ^4.1.6",
- "symfony/event-dispatcher": "^3.0 || ^4.0",
- "symfony/filesystem": "^3.0 || ^4.0",
- "symfony/finder": "^3.0 || ^4.0",
- "symfony/options-resolver": "^3.0 || ^4.0",
+ "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0",
+ "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0",
+ "symfony/filesystem": "^3.0 || ^4.0 || ^5.0",
+ "symfony/finder": "^3.0 || ^4.0 || ^5.0",
+ "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0",
"symfony/polyfill-php70": "^1.0",
"symfony/polyfill-php72": "^1.4",
- "symfony/process": "^3.0 || ^4.0",
- "symfony/stopwatch": "^3.0 || ^4.0"
+ "symfony/process": "^3.0 || ^4.0 || ^5.0",
+ "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0"
},
"require-dev": {
"johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0",
@@ -6462,11 +6654,12 @@
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1",
"phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1",
- "phpunitgoodpractices/traits": "^1.5.1",
- "symfony/phpunit-bridge": "^4.0",
- "symfony/yaml": "^3.0 || ^4.0"
+ "phpunitgoodpractices/traits": "^1.8",
+ "symfony/phpunit-bridge": "^4.3 || ^5.0",
+ "symfony/yaml": "^3.0 || ^4.0 || ^5.0"
},
"suggest": {
+ "ext-dom": "For handling output formats in XML",
"ext-mbstring": "For handling non-UTF8 characters in cache signature.",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.",
@@ -6489,6 +6682,7 @@
"tests/Test/IntegrationCaseFactory.php",
"tests/Test/IntegrationCaseFactoryInterface.php",
"tests/Test/InternalIntegrationCaseFactory.php",
+ "tests/Test/IsIdenticalConstraint.php",
"tests/TestCase.php"
]
},
@@ -6507,7 +6701,7 @@
}
],
"description": "A tool to automatically fix PHP code style",
- "time": "2019-08-31T12:47:52+00:00"
+ "time": "2020-04-15T18:51:10+00:00"
},
{
"name": "jms/metadata",
@@ -6875,35 +7069,39 @@
},
{
"name": "magento/magento2-functional-testing-framework",
- "version": "dev-3.0.0-RC1",
+ "version": "dev-3.0.0-RC2",
"source": {
"type": "git",
"url": "https://github.com/magento/magento2-functional-testing-framework.git",
- "reference": "5a3d146d082f8073a328d4e961da1c9f56a2c572"
+ "reference": "b525101e1ea02b2691f389982b0cb91b76c71ff4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/5a3d146d082f8073a328d4e961da1c9f56a2c572",
- "reference": "5a3d146d082f8073a328d4e961da1c9f56a2c572",
+ "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/b525101e1ea02b2691f389982b0cb91b76c71ff4",
+ "reference": "b525101e1ea02b2691f389982b0cb91b76c71ff4",
"shasum": ""
},
"require": {
- "allure-framework/allure-codeception": "~1.3.0",
+ "allure-framework/allure-codeception": "~1.4.0",
"aws/aws-sdk-php": "^3.132",
- "codeception/codeception": "~2.4.5",
- "composer/composer": "^1.6",
+ "codeception/codeception": "~4.1.4",
+ "codeception/module-asserts": "^1.1",
+ "codeception/module-sequence": "^1.0",
+ "codeception/module-webdriver": "^1.0",
+ "composer/composer": "^1.9",
"csharpru/vault-php": "~3.5.3",
"csharpru/vault-php-guzzle6-transport": "^2.0",
"ext-curl": "*",
"ext-dom": "*",
+ "ext-intl": "*",
"ext-json": "*",
"ext-openssl": "*",
- "monolog/monolog": "^1.0",
+ "monolog/monolog": "^1.17",
"mustache/mustache": "~2.5",
- "php": "~7.2.0||~7.3.0",
+ "php": "^7.3",
"php-webdriver/webdriver": "^1.8.0",
"symfony/console": "^4.4",
- "symfony/finder": "^4.4",
+ "symfony/finder": "^5.0",
"symfony/mime": "^5.0",
"symfony/process": "^4.4",
"vlucas/phpdotenv": "^2.4"
@@ -6916,18 +7114,15 @@
"codacy/coverage": "^1.4",
"codeception/aspect-mock": "^3.0",
"doctrine/cache": "<1.7.0",
- "goaop/framework": "2.2.0",
+ "goaop/framework": "~2.3.4",
"php-coveralls/php-coveralls": "^1.0",
- "phpmd/phpmd": "^2.6.0",
- "phpunit/phpunit": "~6.5.0 || ~7.0.0",
+ "phpmd/phpmd": "^2.8.0",
+ "phpunit/phpunit": "^9.0",
"rregeer/phpunit-coverage-check": "^0.1.4",
- "sebastian/phpcpd": "~3.0 || ~4.0",
- "squizlabs/php_codesniffer": "~3.2",
+ "sebastian/phpcpd": "~5.0.0",
+ "squizlabs/php_codesniffer": "~3.5.4",
"symfony/stopwatch": "~3.4.6"
},
- "suggest": {
- "epfremme/swagger-php": "^2.0"
- },
"bin": [
"bin/mftf"
],
@@ -6957,7 +7152,7 @@
"magento",
"testing"
],
- "time": "2020-03-24T22:00:41+00:00"
+ "time": "2020-04-30T14:54:28+00:00"
},
{
"name": "mikey179/vfsstream",
@@ -7158,32 +7353,39 @@
},
{
"name": "pdepend/pdepend",
- "version": "2.5.2",
+ "version": "2.7.1",
"source": {
"type": "git",
"url": "https://github.com/pdepend/pdepend.git",
- "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239"
+ "reference": "daba1cf0a6edaf172fa02a17807ae29f4c1c7471"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/pdepend/pdepend/zipball/9daf26d0368d4a12bed1cacae1a9f3a6f0adf239",
- "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239",
+ "url": "https://api.github.com/repos/pdepend/pdepend/zipball/daba1cf0a6edaf172fa02a17807ae29f4c1c7471",
+ "reference": "daba1cf0a6edaf172fa02a17807ae29f4c1c7471",
"shasum": ""
},
"require": {
"php": ">=5.3.7",
- "symfony/config": "^2.3.0|^3|^4",
- "symfony/dependency-injection": "^2.3.0|^3|^4",
- "symfony/filesystem": "^2.3.0|^3|^4"
+ "symfony/config": "^2.3.0|^3|^4|^5",
+ "symfony/dependency-injection": "^2.3.0|^3|^4|^5",
+ "symfony/filesystem": "^2.3.0|^3|^4|^5"
},
"require-dev": {
- "phpunit/phpunit": "^4.8|^5.7",
+ "easy-doc/easy-doc": "0.0.0 || ^1.2.3",
+ "gregwar/rst": "^1.0",
+ "phpunit/phpunit": "^4.8.35|^5.7",
"squizlabs/php_codesniffer": "^2.0.0"
},
"bin": [
"src/bin/pdepend"
],
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.x-dev"
+ }
+ },
"autoload": {
"psr-4": {
"PDepend\\": "src/main/php/PDepend"
@@ -7194,26 +7396,26 @@
"BSD-3-Clause"
],
"description": "Official version of pdepend to be handled with Composer",
- "time": "2017-12-13T13:21:38+00:00"
+ "time": "2020-02-08T12:06:13+00:00"
},
{
"name": "phar-io/manifest",
- "version": "1.0.1",
+ "version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/phar-io/manifest.git",
- "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0"
+ "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0",
- "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4",
+ "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-phar": "*",
- "phar-io/version": "^1.0.1",
+ "phar-io/version": "^2.0",
"php": "^5.6 || ^7.0"
},
"type": "library",
@@ -7249,20 +7451,20 @@
}
],
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
- "time": "2017-03-05T18:14:27+00:00"
+ "time": "2018-07-08T19:23:20+00:00"
},
{
"name": "phar-io/version",
- "version": "1.0.1",
+ "version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
- "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df"
+ "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df",
- "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6",
+ "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6",
"shasum": ""
},
"require": {
@@ -7296,7 +7498,7 @@
}
],
"description": "Library for handling version information and constraints",
- "time": "2017-03-05T17:38:23+00:00"
+ "time": "2018-07-08T19:19:57+00:00"
},
{
"name": "php-cs-fixer/diff",
@@ -7522,24 +7724,21 @@
},
{
"name": "phpdocumentor/reflection-common",
- "version": "2.0.0",
+ "version": "2.1.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
- "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a"
+ "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a",
- "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b",
+ "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
- "require-dev": {
- "phpunit/phpunit": "~6"
- },
"type": "library",
"extra": {
"branch-alias": {
@@ -7570,7 +7769,7 @@
"reflection",
"static analysis"
],
- "time": "2018-08-07T13:53:10+00:00"
+ "time": "2020-04-27T09:25:28+00:00"
},
{
"name": "phpdocumentor/reflection-docblock",
@@ -7673,24 +7872,26 @@
},
{
"name": "phpmd/phpmd",
- "version": "2.7.0",
+ "version": "2.8.2",
"source": {
"type": "git",
"url": "https://github.com/phpmd/phpmd.git",
- "reference": "a05a999c644f4bc9a204846017db7bb7809fbe4c"
+ "reference": "714629ed782537f638fe23c4346637659b779a77"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpmd/phpmd/zipball/a05a999c644f4bc9a204846017db7bb7809fbe4c",
- "reference": "a05a999c644f4bc9a204846017db7bb7809fbe4c",
+ "url": "https://api.github.com/repos/phpmd/phpmd/zipball/714629ed782537f638fe23c4346637659b779a77",
+ "reference": "714629ed782537f638fe23c4346637659b779a77",
"shasum": ""
},
"require": {
+ "composer/xdebug-handler": "^1.0",
"ext-xml": "*",
- "pdepend/pdepend": "^2.5",
+ "pdepend/pdepend": "^2.7.1",
"php": ">=5.3.9"
},
"require-dev": {
+ "easy-doc/easy-doc": "0.0.0 || ^1.3.2",
"gregwar/rst": "^1.0",
"mikey179/vfsstream": "^1.6.4",
"phpunit/phpunit": "^4.8.36 || ^5.7.27",
@@ -7737,7 +7938,7 @@
"phpmd",
"pmd"
],
- "time": "2019-07-30T21:13:32+00:00"
+ "time": "2020-02-16T20:15:50+00:00"
},
{
"name": "phpoption/phpoption",
@@ -7859,21 +8060,24 @@
},
{
"name": "phpstan/phpstan",
- "version": "0.12.18",
+ "version": "0.12.23",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "1ce27fe29c8660a27926127d350d53d80c4d4286"
+ "reference": "71e529efced79e055fa8318b692e7f7d03ea4e75"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1ce27fe29c8660a27926127d350d53d80c4d4286",
- "reference": "1ce27fe29c8660a27926127d350d53d80c4d4286",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/71e529efced79e055fa8318b692e7f7d03ea4e75",
+ "reference": "71e529efced79e055fa8318b692e7f7d03ea4e75",
"shasum": ""
},
"require": {
"php": "^7.1"
},
+ "conflict": {
+ "phpstan/phpstan-shim": "*"
+ },
"bin": [
"phpstan",
"phpstan.phar"
@@ -7894,44 +8098,45 @@
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
- "time": "2020-03-22T16:51:47+00:00"
+ "time": "2020-05-05T12:55:44+00:00"
},
{
"name": "phpunit/php-code-coverage",
- "version": "5.3.2",
+ "version": "8.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "c89677919c5dd6d3b3852f230a663118762218ac"
+ "reference": "31e94ccc084025d6abee0585df533eb3a792b96a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac",
- "reference": "c89677919c5dd6d3b3852f230a663118762218ac",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/31e94ccc084025d6abee0585df533eb3a792b96a",
+ "reference": "31e94ccc084025d6abee0585df533eb3a792b96a",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-xmlwriter": "*",
- "php": "^7.0",
- "phpunit/php-file-iterator": "^1.4.2",
- "phpunit/php-text-template": "^1.2.1",
- "phpunit/php-token-stream": "^2.0.1",
- "sebastian/code-unit-reverse-lookup": "^1.0.1",
- "sebastian/environment": "^3.0",
- "sebastian/version": "^2.0.1",
- "theseer/tokenizer": "^1.1"
+ "php": "^7.3",
+ "phpunit/php-file-iterator": "^3.0",
+ "phpunit/php-text-template": "^2.0",
+ "phpunit/php-token-stream": "^4.0",
+ "sebastian/code-unit-reverse-lookup": "^2.0",
+ "sebastian/environment": "^5.0",
+ "sebastian/version": "^3.0",
+ "theseer/tokenizer": "^1.1.3"
},
"require-dev": {
- "phpunit/phpunit": "^6.0"
+ "phpunit/phpunit": "^9.0"
},
"suggest": {
- "ext-xdebug": "^2.5.5"
+ "ext-pcov": "*",
+ "ext-xdebug": "*"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "5.3.x-dev"
+ "dev-master": "8.0-dev"
}
},
"autoload": {
@@ -7957,29 +8162,32 @@
"testing",
"xunit"
],
- "time": "2018-04-06T15:36:58+00:00"
+ "time": "2020-02-19T13:41:19+00:00"
},
{
"name": "phpunit/php-file-iterator",
- "version": "1.4.5",
+ "version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
+ "reference": "4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
- "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4",
+ "reference": "4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.4.x-dev"
+ "dev-master": "3.0-dev"
}
},
"autoload": {
@@ -7994,7 +8202,7 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
+ "email": "sebastian@phpunit.de",
"role": "lead"
}
],
@@ -8004,26 +8212,84 @@
"filesystem",
"iterator"
],
- "time": "2017-11-27T13:52:08+00:00"
+ "time": "2020-04-18T05:02:12+00:00"
+ },
+ {
+ "name": "phpunit/php-invoker",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-invoker.git",
+ "reference": "7579d5a1ba7f3ac11c80004d205877911315ae7a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/7579d5a1ba7f3ac11c80004d205877911315ae7a",
+ "reference": "7579d5a1ba7f3ac11c80004d205877911315ae7a",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.3"
+ },
+ "require-dev": {
+ "ext-pcntl": "*",
+ "phpunit/phpunit": "^9.0"
+ },
+ "suggest": {
+ "ext-pcntl": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Invoke callables with a timeout",
+ "homepage": "https://github.com/sebastianbergmann/php-invoker/",
+ "keywords": [
+ "process"
+ ],
+ "time": "2020-02-07T06:06:11+00:00"
},
{
"name": "phpunit/php-text-template",
- "version": "1.2.1",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+ "reference": "526dc996cc0ebdfa428cd2dfccd79b7b53fee346"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/526dc996cc0ebdfa428cd2dfccd79b7b53fee346",
+ "reference": "526dc996cc0ebdfa428cd2dfccd79b7b53fee346",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^7.3"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
"autoload": {
"classmap": [
"src/"
@@ -8045,32 +8311,32 @@
"keywords": [
"template"
],
- "time": "2015-06-21T13:50:34+00:00"
+ "time": "2020-02-01T07:43:44+00:00"
},
{
"name": "phpunit/php-timer",
- "version": "1.0.9",
+ "version": "3.1.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
+ "reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/dc9368fae6ef2ffa57eba80a7410bcef81df6258",
+ "reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258",
"shasum": ""
},
"require": {
- "php": "^5.3.3 || ^7.0"
+ "php": "^7.3"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-master": "3.1-dev"
}
},
"autoload": {
@@ -8085,7 +8351,7 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
+ "email": "sebastian@phpunit.de",
"role": "lead"
}
],
@@ -8094,33 +8360,33 @@
"keywords": [
"timer"
],
- "time": "2017-02-26T11:10:40+00:00"
+ "time": "2020-04-20T06:00:37+00:00"
},
{
"name": "phpunit/php-token-stream",
- "version": "2.0.2",
+ "version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "791198a2c6254db10131eecfe8c06670700904db"
+ "reference": "cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
- "reference": "791198a2c6254db10131eecfe8c06670700904db",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c",
+ "reference": "cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
- "php": "^7.0"
+ "php": "^7.3"
},
"require-dev": {
- "phpunit/phpunit": "^6.2.4"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -8143,57 +8409,58 @@
"keywords": [
"tokenizer"
],
- "time": "2017-11-27T05:48:46+00:00"
+ "time": "2020-05-06T09:56:31+00:00"
},
{
"name": "phpunit/phpunit",
- "version": "6.5.14",
+ "version": "9.1.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7"
+ "reference": "2d7080c622cf7884992e7c3cf87853877bae8ff4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7",
- "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2d7080c622cf7884992e7c3cf87853877bae8ff4",
+ "reference": "2d7080c622cf7884992e7c3cf87853877bae8ff4",
"shasum": ""
},
"require": {
+ "doctrine/instantiator": "^1.2.0",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
- "myclabs/deep-copy": "^1.6.1",
- "phar-io/manifest": "^1.0.1",
- "phar-io/version": "^1.0",
- "php": "^7.0",
- "phpspec/prophecy": "^1.7",
- "phpunit/php-code-coverage": "^5.3",
- "phpunit/php-file-iterator": "^1.4.3",
- "phpunit/php-text-template": "^1.2.1",
- "phpunit/php-timer": "^1.0.9",
- "phpunit/phpunit-mock-objects": "^5.0.9",
- "sebastian/comparator": "^2.1",
- "sebastian/diff": "^2.0",
- "sebastian/environment": "^3.1",
- "sebastian/exporter": "^3.1",
- "sebastian/global-state": "^2.0",
- "sebastian/object-enumerator": "^3.0.3",
- "sebastian/resource-operations": "^1.0",
- "sebastian/version": "^2.0.1"
- },
- "conflict": {
- "phpdocumentor/reflection-docblock": "3.0.2",
- "phpunit/dbunit": "<3.0"
+ "ext-xmlwriter": "*",
+ "myclabs/deep-copy": "^1.9.1",
+ "phar-io/manifest": "^1.0.3",
+ "phar-io/version": "^2.0.1",
+ "php": "^7.3",
+ "phpspec/prophecy": "^1.8.1",
+ "phpunit/php-code-coverage": "^8.0.1",
+ "phpunit/php-file-iterator": "^3.0",
+ "phpunit/php-invoker": "^3.0",
+ "phpunit/php-text-template": "^2.0",
+ "phpunit/php-timer": "^3.1.4",
+ "sebastian/code-unit": "^1.0.2",
+ "sebastian/comparator": "^4.0",
+ "sebastian/diff": "^4.0",
+ "sebastian/environment": "^5.0.1",
+ "sebastian/exporter": "^4.0",
+ "sebastian/global-state": "^4.0",
+ "sebastian/object-enumerator": "^4.0",
+ "sebastian/resource-operations": "^3.0",
+ "sebastian/type": "^2.0",
+ "sebastian/version": "^3.0"
},
"require-dev": {
- "ext-pdo": "*"
+ "ext-pdo": "*",
+ "phpspec/prophecy-phpunit": "^2.0"
},
"suggest": {
- "ext-xdebug": "*",
- "phpunit/php-invoker": "^1.1"
+ "ext-soap": "*",
+ "ext-xdebug": "*"
},
"bin": [
"phpunit"
@@ -8201,12 +8468,15 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "6.5.x-dev"
+ "dev-master": "9.1-dev"
}
},
"autoload": {
"classmap": [
"src/"
+ ],
+ "files": [
+ "src/Framework/Assert/Functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -8227,67 +8497,7 @@
"testing",
"xunit"
],
- "time": "2019-02-01T05:22:47+00:00"
- },
- {
- "name": "phpunit/phpunit-mock-objects",
- "version": "5.0.10",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f",
- "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f",
- "shasum": ""
- },
- "require": {
- "doctrine/instantiator": "^1.0.5",
- "php": "^7.0",
- "phpunit/php-text-template": "^1.2.1",
- "sebastian/exporter": "^3.1"
- },
- "conflict": {
- "phpunit/phpunit": "<6.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^6.5.11"
- },
- "suggest": {
- "ext-soap": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Mock Object library for PHPUnit",
- "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
- "keywords": [
- "mock",
- "xunit"
- ],
- "abandoned": true,
- "time": "2018-08-09T05:50:03+00:00"
+ "time": "2020-04-30T06:32:53+00:00"
},
{
"name": "psr/cache",
@@ -8383,30 +8593,76 @@
],
"time": "2017-10-23T01:57:42+00:00"
},
+ {
+ "name": "sebastian/code-unit",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit.git",
+ "reference": "ac958085bc19fcd1d36425c781ef4cbb5b06e2a5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ac958085bc19fcd1d36425c781ef4cbb5b06e2a5",
+ "reference": "ac958085bc19fcd1d36425c781ef4cbb5b06e2a5",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/code-unit",
+ "time": "2020-04-30T05:58:10+00:00"
+ },
{
"name": "sebastian/code-unit-reverse-lookup",
- "version": "1.0.1",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
+ "reference": "5b5dbe0044085ac41df47e79d34911a15b96d82e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
- "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5b5dbe0044085ac41df47e79d34911a15b96d82e",
+ "reference": "5b5dbe0044085ac41df47e79d34911a15b96d82e",
"shasum": ""
},
"require": {
- "php": "^5.6 || ^7.0"
+ "php": "^7.3"
},
"require-dev": {
- "phpunit/phpunit": "^5.7 || ^6.0"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "2.0-dev"
}
},
"autoload": {
@@ -8426,34 +8682,34 @@
],
"description": "Looks up which function or method a line of code belongs to",
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
- "time": "2017-03-04T06:30:41+00:00"
+ "time": "2020-02-07T06:20:13+00:00"
},
{
"name": "sebastian/comparator",
- "version": "2.1.3",
+ "version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9"
+ "reference": "85b3435da967696ed618ff745f32be3ff4a2b8e8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9",
- "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/85b3435da967696ed618ff745f32be3ff4a2b8e8",
+ "reference": "85b3435da967696ed618ff745f32be3ff4a2b8e8",
"shasum": ""
},
"require": {
- "php": "^7.0",
- "sebastian/diff": "^2.0 || ^3.0",
- "sebastian/exporter": "^3.1"
+ "php": "^7.3",
+ "sebastian/diff": "^4.0",
+ "sebastian/exporter": "^4.0"
},
"require-dev": {
- "phpunit/phpunit": "^6.4"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.1.x-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -8466,6 +8722,10 @@
"BSD-3-Clause"
],
"authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
@@ -8477,10 +8737,6 @@
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
- },
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
}
],
"description": "Provides the functionality to compare PHP values for equality",
@@ -8490,32 +8746,33 @@
"compare",
"equality"
],
- "time": "2018-02-01T13:46:46+00:00"
+ "time": "2020-02-07T06:08:51+00:00"
},
{
"name": "sebastian/diff",
- "version": "2.0.1",
+ "version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd"
+ "reference": "c0c26c9188b538bfa985ae10c9f05d278f12060d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd",
- "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c0c26c9188b538bfa985ae10c9f05d278f12060d",
+ "reference": "c0c26c9188b538bfa985ae10c9f05d278f12060d",
"shasum": ""
},
"require": {
- "php": "^7.0"
+ "php": "^7.3"
},
"require-dev": {
- "phpunit/phpunit": "^6.2"
+ "phpunit/phpunit": "^9.0",
+ "symfony/process": "^4 || ^5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -8528,46 +8785,52 @@
"BSD-3-Clause"
],
"authors": [
- {
- "name": "Kore Nordmann",
- "email": "mail@kore-nordmann.de"
- },
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
}
],
"description": "Diff implementation",
"homepage": "https://github.com/sebastianbergmann/diff",
"keywords": [
- "diff"
+ "diff",
+ "udiff",
+ "unidiff",
+ "unified diff"
],
- "time": "2017-08-03T08:09:46+00:00"
+ "time": "2020-02-07T06:09:38+00:00"
},
{
"name": "sebastian/environment",
- "version": "3.1.0",
+ "version": "5.1.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5"
+ "reference": "c753f04d68cd489b6973cf9b4e505e191af3b05c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5",
- "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/c753f04d68cd489b6973cf9b4e505e191af3b05c",
+ "reference": "c753f04d68cd489b6973cf9b4e505e191af3b05c",
"shasum": ""
},
"require": {
- "php": "^7.0"
+ "php": "^7.3"
},
"require-dev": {
- "phpunit/phpunit": "^6.1"
+ "phpunit/phpunit": "^9.0"
+ },
+ "suggest": {
+ "ext-posix": "*"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1.x-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -8592,34 +8855,34 @@
"environment",
"hhvm"
],
- "time": "2017-07-01T08:51:00+00:00"
+ "time": "2020-04-14T13:36:52+00:00"
},
{
"name": "sebastian/exporter",
- "version": "3.1.2",
+ "version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e"
+ "reference": "80c26562e964016538f832f305b2286e1ec29566"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e",
- "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/80c26562e964016538f832f305b2286e1ec29566",
+ "reference": "80c26562e964016538f832f305b2286e1ec29566",
"shasum": ""
},
"require": {
- "php": "^7.0",
- "sebastian/recursion-context": "^3.0"
+ "php": "^7.3",
+ "sebastian/recursion-context": "^4.0"
},
"require-dev": {
"ext-mbstring": "*",
- "phpunit/phpunit": "^6.0"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1.x-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -8659,30 +8922,33 @@
"export",
"exporter"
],
- "time": "2019-09-14T09:02:43+00:00"
+ "time": "2020-02-07T06:10:52+00:00"
},
{
"name": "sebastian/finder-facade",
- "version": "1.2.3",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/finder-facade.git",
- "reference": "167c45d131f7fc3d159f56f191a0a22228765e16"
+ "reference": "9d3e74b845a2ce50e19b25b5f0c2718e153bee6c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/167c45d131f7fc3d159f56f191a0a22228765e16",
- "reference": "167c45d131f7fc3d159f56f191a0a22228765e16",
+ "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/9d3e74b845a2ce50e19b25b5f0c2718e153bee6c",
+ "reference": "9d3e74b845a2ce50e19b25b5f0c2718e153bee6c",
"shasum": ""
},
"require": {
- "php": "^7.1",
- "symfony/finder": "^2.3|^3.0|^4.0|^5.0",
+ "ext-ctype": "*",
+ "php": "^7.3",
+ "symfony/finder": "^4.1|^5.0",
"theseer/fdomdocument": "^1.6"
},
"type": "library",
"extra": {
- "branch-alias": []
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
},
"autoload": {
"classmap": [
@@ -8702,27 +8968,30 @@
],
"description": "FinderFacade is a convenience wrapper for Symfony's Finder component.",
"homepage": "https://github.com/sebastianbergmann/finder-facade",
- "time": "2020-01-16T08:08:45+00:00"
+ "time": "2020-02-08T06:07:58+00:00"
},
{
"name": "sebastian/global-state",
- "version": "2.0.0",
+ "version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4"
+ "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4",
- "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bdb1e7c79e592b8c82cb1699be3c8743119b8a72",
+ "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72",
"shasum": ""
},
"require": {
- "php": "^7.0"
+ "php": "^7.3",
+ "sebastian/object-reflector": "^2.0",
+ "sebastian/recursion-context": "^4.0"
},
"require-dev": {
- "phpunit/phpunit": "^6.0"
+ "ext-dom": "*",
+ "phpunit/phpunit": "^9.0"
},
"suggest": {
"ext-uopz": "*"
@@ -8730,7 +8999,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -8753,34 +9022,34 @@
"keywords": [
"global state"
],
- "time": "2017-04-27T15:39:26+00:00"
+ "time": "2020-02-07T06:11:37+00:00"
},
{
"name": "sebastian/object-enumerator",
- "version": "3.0.3",
+ "version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5"
+ "reference": "e67516b175550abad905dc952f43285957ef4363"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5",
- "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67516b175550abad905dc952f43285957ef4363",
+ "reference": "e67516b175550abad905dc952f43285957ef4363",
"shasum": ""
},
"require": {
- "php": "^7.0",
- "sebastian/object-reflector": "^1.1.1",
- "sebastian/recursion-context": "^3.0"
+ "php": "^7.3",
+ "sebastian/object-reflector": "^2.0",
+ "sebastian/recursion-context": "^4.0"
},
"require-dev": {
- "phpunit/phpunit": "^6.0"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0.x-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -8800,32 +9069,32 @@
],
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
- "time": "2017-08-03T12:35:26+00:00"
+ "time": "2020-02-07T06:12:23+00:00"
},
{
"name": "sebastian/object-reflector",
- "version": "1.1.1",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "773f97c67f28de00d397be301821b06708fca0be"
+ "reference": "f4fd0835cabb0d4a6546d9fe291e5740037aa1e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be",
- "reference": "773f97c67f28de00d397be301821b06708fca0be",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f4fd0835cabb0d4a6546d9fe291e5740037aa1e7",
+ "reference": "f4fd0835cabb0d4a6546d9fe291e5740037aa1e7",
"shasum": ""
},
"require": {
- "php": "^7.0"
+ "php": "^7.3"
},
"require-dev": {
- "phpunit/phpunit": "^6.0"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1-dev"
+ "dev-master": "2.0-dev"
}
},
"autoload": {
@@ -8845,28 +9114,29 @@
],
"description": "Allows reflection of object attributes, including inherited and non-public ones",
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
- "time": "2017-03-29T09:07:27+00:00"
+ "time": "2020-02-07T06:19:40+00:00"
},
{
"name": "sebastian/phpcpd",
- "version": "3.0.1",
+ "version": "5.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpcpd.git",
- "reference": "dfed51c1288790fc957c9433e2f49ab152e8a564"
+ "reference": "8724382966b1861df4e12db915eaed2165e10bf3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/dfed51c1288790fc957c9433e2f49ab152e8a564",
- "reference": "dfed51c1288790fc957c9433e2f49ab152e8a564",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/8724382966b1861df4e12db915eaed2165e10bf3",
+ "reference": "8724382966b1861df4e12db915eaed2165e10bf3",
"shasum": ""
},
"require": {
- "php": "^5.6|^7.0",
- "phpunit/php-timer": "^1.0.6",
- "sebastian/finder-facade": "^1.1",
- "sebastian/version": "^1.0|^2.0",
- "symfony/console": "^2.7|^3.0|^4.0"
+ "ext-dom": "*",
+ "php": "^7.3",
+ "phpunit/php-timer": "^3.0",
+ "sebastian/finder-facade": "^2.0",
+ "sebastian/version": "^3.0",
+ "symfony/console": "^4.0|^5.0"
},
"bin": [
"phpcpd"
@@ -8874,7 +9144,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -8895,32 +9165,32 @@
],
"description": "Copy/Paste Detector (CPD) for PHP code.",
"homepage": "https://github.com/sebastianbergmann/phpcpd",
- "time": "2017-11-16T08:49:28+00:00"
+ "time": "2020-02-22T06:03:17+00:00"
},
{
"name": "sebastian/recursion-context",
- "version": "3.0.0",
+ "version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8"
+ "reference": "cdd86616411fc3062368b720b0425de10bd3d579"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8",
- "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cdd86616411fc3062368b720b0425de10bd3d579",
+ "reference": "cdd86616411fc3062368b720b0425de10bd3d579",
"shasum": ""
},
"require": {
- "php": "^7.0"
+ "php": "^7.3"
},
"require-dev": {
- "phpunit/phpunit": "^6.0"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0.x-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -8933,14 +9203,14 @@
"BSD-3-Clause"
],
"authors": [
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
@@ -8948,29 +9218,32 @@
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
- "time": "2017-03-03T06:23:57+00:00"
+ "time": "2020-02-07T06:18:20+00:00"
},
{
"name": "sebastian/resource-operations",
- "version": "1.0.0",
+ "version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/resource-operations.git",
- "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
+ "reference": "8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
- "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98",
+ "reference": "8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98",
"shasum": ""
},
"require": {
- "php": ">=5.6.0"
+ "php": "^7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "3.0-dev"
}
},
"autoload": {
@@ -8990,29 +9263,32 @@
],
"description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
- "time": "2015-07-28T20:34:47+00:00"
+ "time": "2020-02-07T06:13:02+00:00"
},
{
- "name": "sebastian/version",
- "version": "2.0.1",
+ "name": "sebastian/type",
+ "version": "2.0.0",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/version.git",
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
+ "url": "https://github.com/sebastianbergmann/type.git",
+ "reference": "9e8f42f740afdea51f5f4e8cec2035580e797ee1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/9e8f42f740afdea51f5f4e8cec2035580e797ee1",
+ "reference": "9e8f42f740afdea51f5f4e8cec2035580e797ee1",
"shasum": ""
},
"require": {
- "php": ">=5.6"
+ "php": "^7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "2.0-dev"
}
},
"autoload": {
@@ -9031,148 +9307,132 @@
"role": "lead"
}
],
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
- "homepage": "https://github.com/sebastianbergmann/version",
- "time": "2016-10-03T07:35:21+00:00"
+ "description": "Collection of value objects that represent the types of the PHP type system",
+ "homepage": "https://github.com/sebastianbergmann/type",
+ "time": "2020-02-07T06:13:43+00:00"
},
{
- "name": "squizlabs/php_codesniffer",
- "version": "3.4.2",
+ "name": "sebastian/version",
+ "version": "3.0.0",
"source": {
"type": "git",
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8"
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "0411bde656dce64202b39c2f4473993a9081d39e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
- "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/0411bde656dce64202b39c2f4473993a9081d39e",
+ "reference": "0411bde656dce64202b39c2f4473993a9081d39e",
"shasum": ""
},
"require": {
- "ext-simplexml": "*",
- "ext-tokenizer": "*",
- "ext-xmlwriter": "*",
- "php": ">=5.4.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ "php": "^7.3"
},
- "bin": [
- "bin/phpcs",
- "bin/phpcbf"
- ],
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.x-dev"
+ "dev-master": "3.0-dev"
}
},
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
- "name": "Greg Sherwood",
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
"role": "lead"
}
],
- "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
- "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
- "keywords": [
- "phpcs",
- "standards"
- ],
- "time": "2019-04-10T23:49:02+00:00"
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "time": "2020-01-21T06:36:37+00:00"
},
{
- "name": "symfony/browser-kit",
- "version": "v4.4.7",
+ "name": "squizlabs/php_codesniffer",
+ "version": "3.5.5",
"source": {
"type": "git",
- "url": "https://github.com/symfony/browser-kit.git",
- "reference": "e4b0dc1b100bf75b5717c5b451397f230a618a42"
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e4b0dc1b100bf75b5717c5b451397f230a618a42",
- "reference": "e4b0dc1b100bf75b5717c5b451397f230a618a42",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6",
+ "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6",
"shasum": ""
},
"require": {
- "php": "^7.1.3",
- "symfony/dom-crawler": "^3.4|^4.0|^5.0"
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.4.0"
},
"require-dev": {
- "symfony/css-selector": "^3.4|^4.0|^5.0",
- "symfony/http-client": "^4.3|^5.0",
- "symfony/mime": "^4.3|^5.0",
- "symfony/process": "^3.4|^4.0|^5.0"
- },
- "suggest": {
- "symfony/process": ""
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
+ "bin": [
+ "bin/phpcs",
+ "bin/phpcbf"
+ ],
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "3.x-dev"
}
},
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\BrowserKit\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "BSD-3-Clause"
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
+ "name": "Greg Sherwood",
+ "role": "lead"
}
],
- "description": "Symfony BrowserKit Component",
- "homepage": "https://symfony.com",
- "time": "2020-03-28T10:15:50+00:00"
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "keywords": [
+ "phpcs",
+ "standards"
+ ],
+ "time": "2020-04-17T01:09:41+00:00"
},
{
"name": "symfony/config",
- "version": "v4.4.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "3f4a3de1af498ed0ea653d4dc2317794144e6ca4"
+ "reference": "db1674e1a261148429f123871f30d211992294e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/3f4a3de1af498ed0ea653d4dc2317794144e6ca4",
- "reference": "3f4a3de1af498ed0ea653d4dc2317794144e6ca4",
+ "url": "https://api.github.com/repos/symfony/config/zipball/db1674e1a261148429f123871f30d211992294e7",
+ "reference": "db1674e1a261148429f123871f30d211992294e7",
"shasum": ""
},
"require": {
- "php": "^7.1.3",
- "symfony/filesystem": "^3.4|^4.0|^5.0",
+ "php": "^7.2.5",
+ "symfony/filesystem": "^4.4|^5.0",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
- "symfony/finder": "<3.4"
+ "symfony/finder": "<4.4"
},
"require-dev": {
- "symfony/event-dispatcher": "^3.4|^4.0|^5.0",
- "symfony/finder": "^3.4|^4.0|^5.0",
- "symfony/messenger": "^4.1|^5.0",
+ "symfony/event-dispatcher": "^4.4|^5.0",
+ "symfony/finder": "^4.4|^5.0",
+ "symfony/messenger": "^4.4|^5.0",
"symfony/service-contracts": "^1.1|^2",
- "symfony/yaml": "^3.4|^4.0|^5.0"
+ "symfony/yaml": "^4.4|^5.0"
},
"suggest": {
"symfony/yaml": "To use the yaml reference dumper"
@@ -9180,7 +9440,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -9207,41 +9467,41 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
- "time": "2020-03-27T16:54:36+00:00"
+ "time": "2020-04-15T15:59:10+00:00"
},
{
"name": "symfony/dependency-injection",
- "version": "v4.4.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
- "reference": "755b18859be26b90f4bf63753432d3387458bf31"
+ "reference": "92d8b3bd896a87cdd8aba0a3dd041bc072e8cfba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/755b18859be26b90f4bf63753432d3387458bf31",
- "reference": "755b18859be26b90f4bf63753432d3387458bf31",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/92d8b3bd896a87cdd8aba0a3dd041bc072e8cfba",
+ "reference": "92d8b3bd896a87cdd8aba0a3dd041bc072e8cfba",
"shasum": ""
},
"require": {
- "php": "^7.1.3",
+ "php": "^7.2.5",
"psr/container": "^1.0",
"symfony/service-contracts": "^1.1.6|^2"
},
"conflict": {
- "symfony/config": "<4.3|>=5.0",
- "symfony/finder": "<3.4",
- "symfony/proxy-manager-bridge": "<3.4",
- "symfony/yaml": "<3.4"
+ "symfony/config": "<5.0",
+ "symfony/finder": "<4.4",
+ "symfony/proxy-manager-bridge": "<4.4",
+ "symfony/yaml": "<4.4"
},
"provide": {
"psr/container-implementation": "1.0",
"symfony/service-implementation": "1.0"
},
"require-dev": {
- "symfony/config": "^4.3",
- "symfony/expression-language": "^3.4|^4.0|^5.0",
- "symfony/yaml": "^3.4|^4.0|^5.0"
+ "symfony/config": "^5.0",
+ "symfony/expression-language": "^4.4|^5.0",
+ "symfony/yaml": "^4.4|^5.0"
},
"suggest": {
"symfony/config": "",
@@ -9253,7 +9513,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -9280,81 +9540,20 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
- "time": "2020-03-30T10:09:30+00:00"
- },
- {
- "name": "symfony/dom-crawler",
- "version": "v4.4.7",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/dom-crawler.git",
- "reference": "4d0fb3374324071ecdd94898367a3fa4b5563162"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4d0fb3374324071ecdd94898367a3fa4b5563162",
- "reference": "4d0fb3374324071ecdd94898367a3fa4b5563162",
- "shasum": ""
- },
- "require": {
- "php": "^7.1.3",
- "symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-mbstring": "~1.0"
- },
- "conflict": {
- "masterminds/html5": "<2.6"
- },
- "require-dev": {
- "masterminds/html5": "^2.6",
- "symfony/css-selector": "^3.4|^4.0|^5.0"
- },
- "suggest": {
- "symfony/css-selector": ""
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.4-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\DomCrawler\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony DomCrawler Component",
- "homepage": "https://symfony.com",
- "time": "2020-03-29T19:12:22+00:00"
+ "time": "2020-04-28T17:58:55+00:00"
},
{
"name": "symfony/http-foundation",
- "version": "v5.0.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "26fb006a2c7b6cdd23d52157b05f8414ffa417b6"
+ "reference": "e47fdf8b24edc12022ba52923150ec6484d7f57d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/26fb006a2c7b6cdd23d52157b05f8414ffa417b6",
- "reference": "26fb006a2c7b6cdd23d52157b05f8414ffa417b6",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e47fdf8b24edc12022ba52923150ec6484d7f57d",
+ "reference": "e47fdf8b24edc12022ba52923150ec6484d7f57d",
"shasum": ""
},
"require": {
@@ -9396,20 +9595,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
- "time": "2020-03-30T14:14:32+00:00"
+ "time": "2020-04-18T20:50:06+00:00"
},
{
"name": "symfony/mime",
- "version": "v5.0.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
- "reference": "481b7d6da88922fb1e0d86a943987722b08f3955"
+ "reference": "5d6c81c39225a750f3f43bee15f03093fb9aaa0b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/mime/zipball/481b7d6da88922fb1e0d86a943987722b08f3955",
- "reference": "481b7d6da88922fb1e0d86a943987722b08f3955",
+ "url": "https://api.github.com/repos/symfony/mime/zipball/5d6c81c39225a750f3f43bee15f03093fb9aaa0b",
+ "reference": "5d6c81c39225a750f3f43bee15f03093fb9aaa0b",
"shasum": ""
},
"require": {
@@ -9458,29 +9657,29 @@
"mime",
"mime-type"
],
- "time": "2020-03-27T16:56:45+00:00"
+ "time": "2020-04-17T03:29:44+00:00"
},
{
"name": "symfony/options-resolver",
- "version": "v4.4.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
- "reference": "9072131b5e6e21203db3249c7db26b52897bc73e"
+ "reference": "3707e3caeff2b797c0bfaadd5eba723dd44e6bf1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/options-resolver/zipball/9072131b5e6e21203db3249c7db26b52897bc73e",
- "reference": "9072131b5e6e21203db3249c7db26b52897bc73e",
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/3707e3caeff2b797c0bfaadd5eba723dd44e6bf1",
+ "reference": "3707e3caeff2b797c0bfaadd5eba723dd44e6bf1",
"shasum": ""
},
"require": {
- "php": "^7.1.3"
+ "php": "^7.2.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -9512,7 +9711,7 @@
"configuration",
"options"
],
- "time": "2020-03-27T16:54:36+00:00"
+ "time": "2020-04-06T10:40:56+00:00"
},
{
"name": "symfony/polyfill-php70",
@@ -9575,26 +9774,26 @@
},
{
"name": "symfony/stopwatch",
- "version": "v4.4.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
- "reference": "e0324d3560e4128270e3f08617480d9233d81cfc"
+ "reference": "a1d86d30d4522423afc998f32404efa34fcf5a73"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e0324d3560e4128270e3f08617480d9233d81cfc",
- "reference": "e0324d3560e4128270e3f08617480d9233d81cfc",
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/a1d86d30d4522423afc998f32404efa34fcf5a73",
+ "reference": "a1d86d30d4522423afc998f32404efa34fcf5a73",
"shasum": ""
},
"require": {
- "php": "^7.1.3",
+ "php": "^7.2.5",
"symfony/service-contracts": "^1.0|^2"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -9621,31 +9820,31 @@
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
- "time": "2020-03-27T16:54:36+00:00"
+ "time": "2020-03-27T16:56:45+00:00"
},
{
"name": "symfony/yaml",
- "version": "v4.4.7",
+ "version": "v5.0.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "ef166890d821518106da3560086bfcbeb4fadfec"
+ "reference": "482fb4e710e5af3e0e78015f19aa716ad953392f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/ef166890d821518106da3560086bfcbeb4fadfec",
- "reference": "ef166890d821518106da3560086bfcbeb4fadfec",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/482fb4e710e5af3e0e78015f19aa716ad953392f",
+ "reference": "482fb4e710e5af3e0e78015f19aa716ad953392f",
"shasum": ""
},
"require": {
- "php": "^7.1.3",
+ "php": "^7.2.5",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
- "symfony/console": "<3.4"
+ "symfony/console": "<4.4"
},
"require-dev": {
- "symfony/console": "^3.4|^4.0|^5.0"
+ "symfony/console": "^4.4|^5.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
@@ -9653,7 +9852,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.4-dev"
+ "dev-master": "5.0-dev"
}
},
"autoload": {
@@ -9680,7 +9879,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2020-03-30T11:41:10+00:00"
+ "time": "2020-04-28T17:58:55+00:00"
},
{
"name": "theseer/fdomdocument",
@@ -9764,20 +9963,20 @@
},
{
"name": "vlucas/phpdotenv",
- "version": "v2.6.3",
+ "version": "v2.6.4",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
- "reference": "df4c4d08a639be4ef5d6d1322868f9e477553679"
+ "reference": "67d472b1794c986381a8950e4958e1adb779d561"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/df4c4d08a639be4ef5d6d1322868f9e477553679",
- "reference": "df4c4d08a639be4ef5d6d1322868f9e477553679",
+ "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/67d472b1794c986381a8950e4958e1adb779d561",
+ "reference": "67d472b1794c986381a8950e4958e1adb779d561",
"shasum": ""
},
"require": {
- "php": ">=5.3.9",
+ "php": "^5.3.9 || ^7.0 || ^8.0",
"symfony/polyfill-ctype": "^1.9"
},
"require-dev": {
@@ -9805,10 +10004,15 @@
"BSD-3-Clause"
],
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "graham@alt-three.com",
+ "homepage": "https://gjcampbell.co.uk/"
+ },
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
- "homepage": "http://www.vancelucas.com"
+ "homepage": "https://vancelucas.com/"
}
],
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
@@ -9817,7 +10021,7 @@
"env",
"environment"
],
- "time": "2020-04-12T15:11:38+00:00"
+ "time": "2020-05-02T13:38:00+00:00"
},
{
"name": "webmozart/assert",
@@ -9909,13 +10113,12 @@
"minimum-stability": "stable",
"stability-flags": {
"magento/composer": 20,
- "magento/magento2-functional-testing-framework": 20,
- "phpmd/phpmd": 0
+ "magento/magento2-functional-testing-framework": 20
},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"ext-bcmath": "*",
"ext-ctype": "*",
"ext-curl": "*",
@@ -9933,6 +10136,5 @@
"ext-zip": "*",
"lib-libxml": "*"
},
- "platform-dev": [],
- "plugin-api-version": "1.1.0"
+ "platform-dev": []
}
diff --git a/dev/tests/acceptance/tests/functional/Magento/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest/EndToEndB2CGuestUserMysqlTest.xml b/dev/tests/acceptance/tests/functional/Magento/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest/EndToEndB2CGuestUserMysqlTest.xml
deleted file mode 100644
index 77040cbbd3a03..0000000000000
--- a/dev/tests/acceptance/tests/functional/Magento/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest/EndToEndB2CGuestUserMysqlTest.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- $searchGrabConfigProductImageSrc
- '/placeholder\/small_image\.jpg/'
-
-
-
-
-
-
-
-
-
- $searchGrabConfigProductPageImageSrc
- '/placeholder\/image\.jpg/'
-
-
-
diff --git a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json
index 0629d3ded5963..faeda3aa5c22e 100644
--- a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json
+++ b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json
@@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/module-integration": "*"
},
diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json
index c15dc55b05046..bdfe1d7aee0ff 100644
--- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json
+++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json
@@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/module-sales": "*"
},
diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/WebapiAbstract.php b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/WebapiAbstract.php
index 6400a61b3ef35..7ccab097d7778 100644
--- a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/WebapiAbstract.php
+++ b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/WebapiAbstract.php
@@ -105,7 +105,7 @@ abstract class WebapiAbstract extends \PHPUnit\Framework\TestCase
* Initialize fixture namespaces.
* //phpcs:disable
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
//phpcs:enable
parent::setUpBeforeClass();
@@ -118,7 +118,7 @@ public static function setUpBeforeClass()
* @return void
* //phpcs:disable
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
//phpcs:enable
//clear garbage in memory
@@ -142,7 +142,7 @@ public static function tearDownAfterClass()
*
* @return void
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$fixtureNamespace = self::_getFixtureNamespace();
if (isset(self::$_methodLevelFixtures[$fixtureNamespace])
@@ -258,10 +258,10 @@ public static function getFixture($key)
*
* @param \Magento\Framework\Model\AbstractModel $model
* @param bool $secure
- * @return \Magento\TestFramework\TestCase\WebapiAbstract
+ * @return void
* //phpcs:disable
*/
- public static function callModelDelete($model, $secure = false)
+ public static function callModelDelete($model, $secure = false) : void
{
//phpcs:enable
if ($model instanceof \Magento\Framework\Model\AbstractModel && $model->getId()) {
@@ -592,7 +592,11 @@ protected function checkSoapFault(
$expectedWrappedErrors = [],
$traceString = null
) {
- $this->assertContains($expectedMessage, $soapFault->getMessage(), "Fault message is invalid.");
+ $this->assertStringContainsString(
+ $expectedMessage,
+ $soapFault->getMessage(),
+ "Fault message is invalid."
+ );
$errorDetailsNode = 'GenericFault';
$errorDetails = isset($soapFault->detail->$errorDetailsNode) ? $soapFault->detail->$errorDetailsNode : null;
@@ -611,7 +615,7 @@ protected function checkSoapFault(
->getMode();
if ($mode == \Magento\Framework\App\State::MODE_DEVELOPER) {
/** Developer mode changes tested behavior and it cannot properly be tested for now */
- $this->assertContains(
+ $this->assertStringContainsString(
$traceString,
$errorDetails->$traceNode,
'Trace Information is incorrect.'
diff --git a/dev/tests/api-functional/testsuite/Magento/Analytics/Api/LinkProviderTest.php b/dev/tests/api-functional/testsuite/Magento/Analytics/Api/LinkProviderTest.php
index 4bf1335f20667..6ece4ddc9f0c1 100644
--- a/dev/tests/api-functional/testsuite/Magento/Analytics/Api/LinkProviderTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Analytics/Api/LinkProviderTest.php
@@ -31,7 +31,7 @@ class LinkProviderTest extends WebapiAbstract
/**
* @return void
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
@@ -67,7 +67,7 @@ public function testGetAll()
try {
$this->_webApiCall($serviceInfo);
} catch (\Exception $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
'Operation allowed only in HTTPS',
$e->getMessage()
);
@@ -76,7 +76,7 @@ public function testGetAll()
$this->fail("Exception 'Operation allowed only in HTTPS' should be thrown");
} else {
$response = $this->_webApiCall($serviceInfo);
- $this->assertEquals(2, count($response));
+ $this->assertCount(2, $response);
$this->assertEquals(
base64_encode($fileInfo->getInitializationVector()),
$response['initialization_vector']
diff --git a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/OperationRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/OperationRepositoryInterfaceTest.php
index 81ed561a9803e..78956f10cb813 100644
--- a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/OperationRepositoryInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/OperationRepositoryInterfaceTest.php
@@ -58,7 +58,7 @@ public function testGetListByBulkStartTime()
$this->assertEquals($searchCriteria['searchCriteria'], $response['search_criteria']);
$this->assertEquals(5, $response['total_count']);
- $this->assertEquals(5, count($response['items']));
+ $this->assertCount(5, $response['items']);
foreach ($response['items'] as $item) {
$this->assertEquals('bulk-uuid-searchable-6', $item['bulk_uuid']);
@@ -115,7 +115,7 @@ public function testGetList()
$this->assertEquals($searchCriteria['searchCriteria'], $response['search_criteria']);
$this->assertEquals(1, $response['total_count']);
- $this->assertEquals(1, count($response['items']));
+ $this->assertCount(1, $response['items']);
foreach ($response['items'] as $item) {
$this->assertEquals('bulk-uuid-searchable-6', $item['bulk_uuid']);
diff --git a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/CartItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/CartItemRepositoryTest.php
index 6c172d8fb679b..a272481deba8a 100644
--- a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/CartItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/CartItemRepositoryTest.php
@@ -18,7 +18,7 @@ class CartItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -47,7 +47,7 @@ public function testGetAll()
],
];
$response = $this->_webApiCall($serviceInfo, ['cartId' => $quoteId]);
- $this->assertEquals(1, count($response));
+ $this->assertCount(1, $response);
$response = $response[0];
$bundleOption = $quote->getItemById($response['item_id'])->getBuyRequest()->getBundleOption();
$bundleOptionQty = $quote->getItemById($response['item_id'])->getBuyRequest()->getBundleOptionQty();
@@ -192,7 +192,7 @@ public function testUpdate()
$cartItems = $quoteUpdated->getAllVisibleItems();
$buyRequest = $cartItems[0]->getBuyRequest()->toArray();
- $this->assertEquals(1, count($cartItems));
+ $this->assertCount(1, $cartItems);
$this->assertEquals(count($buyRequest['bundle_option']), count($bundleOptions));
foreach ($bundleOptions as $option) {
$optionId = $option['option_id'];
diff --git a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderInvoiceCreateTest.php b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderInvoiceCreateTest.php
index 3a40e510326a4..54789fdd23c5f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderInvoiceCreateTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderInvoiceCreateTest.php
@@ -28,7 +28,7 @@ class OrderInvoiceCreateTest extends \Magento\TestFramework\TestCase\WebapiAbstr
*
* @return void
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->invoiceRepository = $this->objectManager->get(
diff --git a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderItemRepositoryTest.php
index cd208c0f9efaf..0ec48af5d7367 100644
--- a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderItemRepositoryTest.php
@@ -21,7 +21,7 @@ class OrderItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -50,7 +50,7 @@ public function testGet()
$response = $this->_webApiCall($serviceInfo, ['id' => $orderItem->getId()]);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertOrderItem($orderItem, $response);
}
@@ -92,10 +92,10 @@ public function testGetList()
$response = $this->_webApiCall($serviceInfo, $requestData);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertArrayHasKey('items', $response);
$this->assertCount(1, $response['items']);
- $this->assertTrue(is_array($response['items'][0]));
+ $this->assertIsArray($response['items'][0]);
$this->assertOrderItem(current($order->getItems()), $response['items'][0]);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductOptionRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductOptionRepositoryTest.php
index 5fb2020de3e81..88b8796a3d078 100644
--- a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductOptionRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductOptionRepositoryTest.php
@@ -96,10 +96,11 @@ public function testGetList()
/**
* @magentoApiDataFixture Magento/Bundle/_files/product.php
- * @expectedException \Magento\Framework\Exception\NoSuchEntityException
*/
public function testRemove()
{
+ $this->expectException(\Magento\Framework\Exception\NoSuchEntityException::class);
+
$productSku = 'bundle-product';
$optionId = $this->getList($productSku)[0]['option_id'];
diff --git a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductServiceTest.php b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductServiceTest.php
index 6388684466d10..7a4f472c69513 100644
--- a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductServiceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/ProductServiceTest.php
@@ -30,7 +30,7 @@ class ProductServiceTest extends WebapiAbstract
/**
* Execute per test initialization
*/
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productCollection = $objectManager->get(\Magento\Catalog\Model\ResourceModel\Product\Collection::class);
@@ -39,7 +39,7 @@ public function setUp()
/**
* Execute per test cleanup
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->deleteProductBySku(self::BUNDLE_PRODUCT_ID);
parent::tearDown();
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetManagementTest.php
index 8ad55207b5f8b..f201db4041c66 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetManagementTest.php
@@ -17,7 +17,7 @@ class AttributeSetManagementTest extends WebapiAbstract
*/
private $createServiceInfo;
- protected function setUp()
+ protected function setUp(): void
{
$this->createServiceInfo = [
'rest' => [
@@ -61,11 +61,12 @@ public function testCreate()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid value
*/
public function testCreateThrowsExceptionIfGivenAttributeSetAlreadyHasId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid value');
+
$entityTypeCode = 'catalog_product';
$entityType = $this->getEntityTypeByCode($entityTypeCode);
$attributeSetName = 'new_attribute_set';
@@ -82,10 +83,11 @@ public function testCreateThrowsExceptionIfGivenAttributeSetAlreadyHasId()
}
/**
- * @expectedException \Exception
*/
public function testCreateThrowsExceptionIfGivenSkeletonIdIsInvalid()
{
+ $this->expectException(\Exception::class);
+
$attributeSetName = 'new_attribute_set';
$arguments = [
'attributeSet' => [
@@ -102,10 +104,11 @@ public function testCreateThrowsExceptionIfGivenSkeletonIdIsInvalid()
}
/**
- * @expectedException \Exception
*/
public function testCreateThrowsExceptionIfGivenSkeletonIdHasWrongEntityType()
{
+ $this->expectException(\Exception::class);
+
$attributeSetName = 'new_attribute_set';
$arguments = [
'attributeSet' => [
@@ -122,10 +125,11 @@ public function testCreateThrowsExceptionIfGivenSkeletonIdHasWrongEntityType()
}
/**
- * @expectedException \Exception
*/
public function testCreateThrowsExceptionIfGivenSkeletonAttributeSetDoesNotExist()
{
+ $this->expectException(\Exception::class);
+
$attributeSetName = 'new_attribute_set';
$arguments = [
'attributeSet' => [
@@ -142,11 +146,12 @@ public function testCreateThrowsExceptionIfGivenSkeletonAttributeSetDoesNotExist
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The attribute set name is empty. Enter the name and try again.
*/
public function testCreateThrowsExceptionIfAttributeSetNameIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The attribute set name is empty. Enter the name and try again.');
+
$entityTypeCode = 'catalog_product';
$entityType = $this->getEntityTypeByCode($entityTypeCode);
$attributeSetName = '';
@@ -180,7 +185,7 @@ public function testCreateThrowsExceptionIfAttributeSetWithGivenNameAlreadyExist
$this->_webApiCall($this->createServiceInfo, $arguments);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetRepositoryTest.php
index 4f917a9c9961a..1552be6c076ea 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetRepositoryTest.php
@@ -41,10 +41,11 @@ public function testGet()
}
/**
- * @expectedException \Exception
*/
public function testGetThrowsExceptionIfRequestedAttributeSetDoesNotExist()
{
+ $this->expectException(\Exception::class);
+
$attributeSetId = 9999;
$serviceInfo = [
@@ -134,10 +135,11 @@ public function testDeleteById()
}
/**
- * @expectedException \Exception
*/
public function testDeleteByIdThrowsExceptionIfRequestedAttributeSetDoesNotExist()
{
+ $this->expectException(\Exception::class);
+
$attributeSetId = 9999;
$serviceInfo = [
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/BasePriceStorageTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/BasePriceStorageTest.php
index ea62034314c13..0d3cd0da02674 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/BasePriceStorageTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/BasePriceStorageTest.php
@@ -26,7 +26,7 @@ class BasePriceStorageTest extends WebapiAbstract
/**
* Set up.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CartItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CartItemRepositoryTest.php
index ad7548b390607..e3680c573750d 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CartItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CartItemRepositoryTest.php
@@ -25,7 +25,7 @@ class CartItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -58,7 +58,7 @@ public function testAddProductToCartWithCustomOptions()
];
$response = $this->_webApiCall($serviceInfo, $this->getRequestData($cartId));
$this->assertTrue($quote->hasProductId($product->getId()));
- $this->assertEquals(1, count($quote->getAllItems()));
+ $this->assertCount(1, $quote->getAllItems());
/** @var \Magento\Quote\Api\Data\CartItemInterface $item */
$item = $quote->getAllItems()[0];
$this->assertEquals(
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeOptionManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeOptionManagementInterfaceTest.php
index c7f87d3054f5d..c7a29df961bd4 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeOptionManagementInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeOptionManagementInterfaceTest.php
@@ -42,7 +42,7 @@ public function testGetItems()
$response = $this->_webApiCall($serviceInfo, ['attributeCode' => $testAttributeCode]);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertEquals($expectedOptions, $response);
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeRepositoryTest.php
index 36491dc23f236..f14fe207bfe6b 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryAttributeRepositoryTest.php
@@ -20,7 +20,7 @@ public function testGet()
$attributeCode = 'test_attribute_code_666';
$attribute = $this->getAttribute($attributeCode);
- $this->assertTrue(is_array($attribute));
+ $this->assertIsArray($attribute);
$this->assertArrayHasKey('attribute_id', $attribute);
$this->assertArrayHasKey('attribute_code', $attribute);
$this->assertEquals($attributeCode, $attribute['attribute_code']);
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryLinkManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryLinkManagementTest.php
index cf209b261fce9..629cc077a63ea 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryLinkManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryLinkManagementTest.php
@@ -39,7 +39,7 @@ public function testInfoNoSuchEntityException()
try {
$this->getAssignedProducts(-1);
} catch (\Exception $e) {
- $this->assertContains('No such entity with %fieldName = %fieldValue', $e->getMessage());
+ $this->assertStringContainsString('No such entity with %fieldName = %fieldValue', $e->getMessage());
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryRepositoryTest.php
index d614f6e913dc5..aba065a956d4f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryRepositoryTest.php
@@ -46,7 +46,7 @@ class CategoryRepositoryTest extends WebapiAbstract
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -89,7 +89,7 @@ public function testInfoNoSuchEntityException()
try {
$this->getInfoCategory(-1);
} catch (\Exception $e) {
- $this->assertContains('No such entity with %fieldName = %fieldValue', $e->getMessage());
+ $this->assertStringContainsString('No such entity with %fieldName = %fieldValue', $e->getMessage());
}
}
@@ -168,16 +168,17 @@ public function testDeleteNoSuchEntityException()
try {
$this->deleteCategory(-1);
} catch (\Exception $e) {
- $this->assertContains('No such entity with %fieldName = %fieldValue', $e->getMessage());
+ $this->assertStringContainsString('No such entity with %fieldName = %fieldValue', $e->getMessage());
}
}
/**
* @dataProvider deleteSystemOrRootDataProvider
- * @expectedException \Exception
*/
public function testDeleteSystemOrRoot()
{
+ $this->expectException(\Exception::class);
+
$this->deleteCategory($this->modelId);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CostStorageTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CostStorageTest.php
index 0316010b6ec1c..fc24c9f2c4651 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CostStorageTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CostStorageTest.php
@@ -10,7 +10,7 @@
use Magento\Framework\Webapi\Exception as HTTPExceptionCodes;
/**
- * CostStorage test.
+ * Catalog Cost Storage API test.
*/
class CostStorageTest extends WebapiAbstract
{
@@ -26,7 +26,7 @@ class CostStorageTest extends WebapiAbstract
/**
* Set up.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -58,7 +58,7 @@ public function testGet()
$product = $productRepository->get(self::SIMPLE_PRODUCT_SKU);
$this->assertNotEmpty($response);
- $this->assertEquals($product->getCost(), $cost);
+ $this->assertEquals($cost, (int)$product->getCost());
}
/**
@@ -97,7 +97,7 @@ public function testUpdate()
/** @var \Magento\Catalog\Api\Data\ProductInterface $product */
$product = $productRepository->get(self::SIMPLE_PRODUCT_SKU);
$this->assertEmpty($response);
- $this->assertEquals($product->getCost(), $newCost);
+ $this->assertEquals($newCost, (int)$product->getCost());
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/OrderItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/OrderItemRepositoryTest.php
index 755fef21df039..561da3e32900d 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/OrderItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/OrderItemRepositoryTest.php
@@ -21,7 +21,7 @@ class OrderItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -50,7 +50,7 @@ public function testGet()
$response = $this->_webApiCall($serviceInfo, ['id' => $orderItem->getId()]);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertOrderItem($orderItem, $response);
}
@@ -92,10 +92,10 @@ public function testGetList()
$response = $this->_webApiCall($serviceInfo, $requestData);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertArrayHasKey('items', $response);
$this->assertCount(1, $response['items']);
- $this->assertTrue(is_array($response['items'][0]));
+ $this->assertIsArray($response['items'][0]);
$this->assertOrderItem(current($order->getItems()), $response['items'][0]);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeGroupRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeGroupRepositoryTest.php
index a9d710d6c5662..7a1d6ab5b2430 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeGroupRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeGroupRepositoryTest.php
@@ -48,10 +48,11 @@ public function testDeleteGroup()
}
/**
- * @expectedException \Exception
*/
public function testCreateGroupWithAttributeSetThatDoesNotExist()
{
+ $this->expectException(\Exception::class);
+
$attributeSetId = -1;
$this->createGroup($attributeSetId);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeManagementTest.php
index 810e533f1f2f8..c5bb2556571f1 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeManagementTest.php
@@ -63,7 +63,7 @@ public function testAssignAttributeWrongAttributeSet()
$this->_webApiCall($this->getAssignServiceInfo(), $payload);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -86,7 +86,7 @@ public function testAssignAttributeWrongAttributeGroup()
$this->_webApiCall($this->getAssignServiceInfo(), $payload);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -110,7 +110,7 @@ public function testAssignAttributeWrongAttribute()
$this->_webApiCall($this->getAssignServiceInfo(), $payload);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php
index a192936aeaccf..ba12a02cb5b1f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php
@@ -56,7 +56,7 @@ class ProductAttributeMediaGalleryManagementInterfaceTest extends WebapiAbstract
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
@@ -396,11 +396,12 @@ public function testDelete()
* Test create() method if provided content is not base64 encoded
*
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
- * @expectedException \Exception
- * @expectedExceptionMessage The image content must be valid base64 encoded data.
*/
public function testCreateThrowsExceptionIfProvidedContentIsNotBase64Encoded()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The image content must be valid base64 encoded data.');
+
$encodedContent = 'not_a_base64_encoded_content';
$requestData = [
'id' => null,
@@ -423,11 +424,12 @@ public function testCreateThrowsExceptionIfProvidedContentIsNotBase64Encoded()
* Test create() method if provided content is not an image
*
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
- * @expectedException \Exception
- * @expectedExceptionMessage The image content must be valid base64 encoded data.
*/
public function testCreateThrowsExceptionIfProvidedContentIsNotAnImage()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The image content must be valid base64 encoded data.');
+
$encodedContent = base64_encode('not_an_image');
$requestData = [
'id' => null,
@@ -450,11 +452,12 @@ public function testCreateThrowsExceptionIfProvidedContentIsNotAnImage()
* Test create() method if provided image has wrong MIME type
*
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
- * @expectedException \Exception
- * @expectedExceptionMessage The image MIME type is not valid or not supported.
*/
public function testCreateThrowsExceptionIfProvidedImageHasWrongMimeType()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The image MIME type is not valid or not supported.');
+
$encodedContent = base64_encode(file_get_contents($this->testImagePath));
$requestData = [
'id' => null,
@@ -476,11 +479,12 @@ public function testCreateThrowsExceptionIfProvidedImageHasWrongMimeType()
/**
* Test create method if target product does not exist
*
- * @expectedException \Exception
- * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
*/
public function testCreateThrowsExceptionIfTargetProductDoesNotExist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The product that was requested doesn\'t exist. Verify the product and try again.');
+
$this->createServiceInfo['rest']['resourcePath'] = '/V1/products/wrong_product_sku/media';
$requestData = [
@@ -504,11 +508,12 @@ public function testCreateThrowsExceptionIfTargetProductDoesNotExist()
* Test create() method if provided image name contains forbidden characters
*
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
- * @expectedException \Exception
- * @expectedExceptionMessage Provided image name contains forbidden characters.
*/
public function testCreateThrowsExceptionIfProvidedImageNameContainsForbiddenCharacters()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Provided image name contains forbidden characters.');
+
$requestData = [
'id' => null,
'media_type' => 'image',
@@ -529,11 +534,12 @@ public function testCreateThrowsExceptionIfProvidedImageNameContainsForbiddenCha
/**
* Test update() method if target product does not exist
*
- * @expectedException \Exception
- * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
*/
public function testUpdateThrowsExceptionIfTargetProductDoesNotExist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The product that was requested doesn\'t exist. Verify the product and try again.');
+
$this->updateServiceInfo['rest']['resourcePath'] = '/V1/products/wrong_product_sku/media'
. '/' . 'wrong-sku';
$requestData = [
@@ -555,11 +561,12 @@ public function testUpdateThrowsExceptionIfTargetProductDoesNotExist()
* Test update() method if there is no image with given id
*
* @magentoApiDataFixture Magento/Catalog/_files/product_with_image.php
- * @expectedException \Exception
- * @expectedExceptionMessage No image with the provided ID was found. Verify the ID and try again.
*/
public function testUpdateThrowsExceptionIfThereIsNoImageWithGivenId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('No image with the provided ID was found. Verify the ID and try again.');
+
$requestData = [
'sku' => 'simple',
'entry' => [
@@ -581,11 +588,12 @@ public function testUpdateThrowsExceptionIfThereIsNoImageWithGivenId()
/**
* Test delete() method if target product does not exist
*
- * @expectedException \Exception
- * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
*/
public function testDeleteThrowsExceptionIfTargetProductDoesNotExist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The product that was requested doesn\'t exist. Verify the product and try again.');
+
$this->deleteServiceInfo['rest']['resourcePath'] = '/V1/products/wrong_product_sku/media/9999';
$requestData = [
'sku' => 'wrong_product_sku',
@@ -599,11 +607,12 @@ public function testDeleteThrowsExceptionIfTargetProductDoesNotExist()
* Test delete() method if there is no image with given id
*
* @magentoApiDataFixture Magento/Catalog/_files/product_with_image.php
- * @expectedException \Exception
- * @expectedExceptionMessage No image with the provided ID was found. Verify the ID and try again.
*/
public function testDeleteThrowsExceptionIfThereIsNoImageWithGivenId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('No image with the provided ID was found. Verify the ID and try again.');
+
$this->deleteServiceInfo['rest']['resourcePath'] = '/V1/products/simple/media/9999';
$requestData = [
'sku' => 'simple',
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeOptionManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeOptionManagementInterfaceTest.php
index 1d37ea9a2fc6d..64f51b93cde50 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeOptionManagementInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeOptionManagementInterfaceTest.php
@@ -43,7 +43,7 @@ public function testGetItems()
$response = $this->_webApiCall($serviceInfo, ['attributeCode' => $testAttributeCode]);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertEquals($expectedOptions, $response);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeRepositoryTest.php
index 42aa92652a5f1..d03152cc41e04 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeRepositoryTest.php
@@ -31,7 +31,7 @@ public function testGet()
$attributeCode = 'test_attribute_code_333';
$attribute = $this->getAttribute($attributeCode);
- $this->assertTrue(is_array($attribute));
+ $this->assertIsArray($attribute);
$this->assertArrayHasKey('attribute_id', $attribute);
$this->assertArrayHasKey('attribute_code', $attribute);
$this->assertEquals($attributeCode, $attribute['attribute_code']);
@@ -200,7 +200,7 @@ public function testUpdate()
$result = $this->updateAttribute($attributeCode, $attributeData);
$this->assertEquals($attribute['attribute_id'], $result['attribute_id']);
- $this->assertEquals(true, $result['is_used_in_grid']);
+ $this->assertTrue($result['is_used_in_grid']);
$this->assertEquals($attributeCode, $result['attribute_code']);
$this->assertEquals('default_label_new', $result['default_frontend_label']);
$this->assertEquals('front_lbl_store1_new', $result['frontend_labels'][0]['label']);
@@ -236,7 +236,7 @@ public function testUpdateWithNoDefaultLabelAndAdminStorelabel()
$result = $this->updateAttribute($attributeCode, $attributeData);
$this->assertEquals($attribute['attribute_id'], $result['attribute_id']);
- $this->assertEquals(true, $result['is_used_in_grid']);
+ $this->assertTrue($result['is_used_in_grid']);
$this->assertEquals($attributeCode, $result['attribute_code']);
$this->assertEquals('front_lbl_store0_new', $result['default_frontend_label']);
$this->assertEquals('front_lbl_store1_new', $result['frontend_labels'][0]['label']);
@@ -268,7 +268,7 @@ public function testUpdateWithNoDefaultLabelAndNoAdminStoreLabel()
$result = $this->updateAttribute($attributeCode, $attributeData);
$this->assertEquals($attribute['attribute_id'], $result['attribute_id']);
- $this->assertEquals(true, $result['is_used_in_grid']);
+ $this->assertTrue($result['is_used_in_grid']);
$this->assertEquals($attributeCode, $result['attribute_code']);
$this->assertEquals('default_label', $result['default_frontend_label']);
$this->assertEquals('front_lbl_store1_new', $result['frontend_labels'][0]['label']);
@@ -309,7 +309,7 @@ public function testUpdateWithNewOption()
];
$output = $this->updateAttribute($attributeCode, $attributeData);
- $this->assertEquals(4, count($output['options']));
+ $this->assertCount(4, $output['options']);
}
/**
@@ -326,12 +326,13 @@ public function testDeleteById()
* Trying to delete system attribute.
*
* @magentoApiDataFixture Magento/Catalog/_files/product_system_attribute.php
- * @expectedException \Exception
- * @expectedExceptionMessage The system attribute can't be deleted.
* @return void
*/
public function testDeleteSystemAttributeById(): void
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The system attribute can\'t be deleted.');
+
$attributeCode = 'test_attribute_code_333';
$this->deleteAttribute($attributeCode);
}
@@ -361,7 +362,7 @@ public function testDeleteNoSuchEntityException()
$this->_webApiCall($serviceInfo, ['attributeCode' => $attributeCode]);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -523,7 +524,7 @@ protected function updateAttribute($attributeCode, $attributeData)
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
foreach ($this->createdAttributes as $attributeCode) {
$this->deleteAttribute($attributeCode);
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomAttributeWrongTypeTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomAttributeWrongTypeTest.php
index 19b0757439077..6b667a1a512b6 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomAttributeWrongTypeTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomAttributeWrongTypeTest.php
@@ -18,7 +18,7 @@ class ProductCustomAttributeWrongTypeTest extends WebapiAbstract
/**
* Execute per test cleanup
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->deleteProductBySku(self::SIMPLE_PRODUCT_SKU);
parent::tearDown();
@@ -26,10 +26,11 @@ public function tearDown()
/**
* @magentoApiDataFixture Magento/Catalog/_files/products_new.php
- * @expectedException \Exception
*/
public function testCustomAttributeWrongType()
{
+ $this->expectException(\Exception::class);
+
$serviceInfo = [
'rest' => [
'resourcePath' => self::RESOURCE_PATH . 'simple',
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php
index f3be684f93a4d..e431d3f912288 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php
@@ -25,7 +25,7 @@ class ProductCustomOptionRepositoryTest extends WebapiAbstract
*/
protected $productFactory;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->productFactory = $this->objectManager->get(\Magento\Catalog\Model\ProductFactory::class);
@@ -61,7 +61,7 @@ public function testRemove()
/** @var \Magento\Catalog\Model\Product $product */
$product = $productRepository->get($sku, false, null, true);
$this->assertNull($product->getOptionById($optionId));
- $this->assertEquals(9, count($product->getOptions()));
+ $this->assertCount(9, $product->getOptions());
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionTypeListTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionTypeListTest.php
index 9084c28e3952b..ecb7a98546640 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionTypeListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionTypeListTest.php
@@ -38,6 +38,6 @@ public function testGetTypes()
'group' => __('Select'),
];
$this->assertGreaterThanOrEqual(10, count($types));
- $this->assertContains($excepted, $types);
+ $this->assertContainsEquals($excepted, $types);
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkManagementInterfaceTest.php
index 1ac61bc860759..6c3b4f00a1b94 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkManagementInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkManagementInterfaceTest.php
@@ -23,7 +23,7 @@ class ProductLinkManagementInterfaceTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkRepositoryInterfaceTest.php
index 167264c049ab5..94c2b74e8ea96 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkRepositoryInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkRepositoryInterfaceTest.php
@@ -20,7 +20,7 @@ class ProductLinkRepositoryInterfaceTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkTypeListTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkTypeListTest.php
index eb23d32aa1f03..193187b790ad3 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkTypeListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductLinkTypeListTest.php
@@ -29,7 +29,7 @@ public function testGetItems()
];
$actual = $this->_webApiCall($serviceInfo);
$expectedItems = ['name' => 'related', 'code' => Link::LINK_TYPE_RELATED];
- $this->assertContains($expectedItems, $actual);
+ $this->assertContainsEquals($expectedItems, $actual);
}
public function testGetItemAttributes()
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php
index 2512de3537f28..1fcfe79f39478 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php
@@ -81,7 +81,7 @@ class ProductRepositoryInterfaceTest extends WebapiAbstract
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -96,7 +96,7 @@ protected function setUp()
/**
* @inheritDoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
parent::tearDown();
@@ -170,7 +170,7 @@ public function testGetNoSuchEntityException()
$this->_webApiCall($serviceInfo, ['sku' => $invalidSku]);
$this->fail("Expected throwing exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -522,7 +522,7 @@ public function testProductLinks()
$this->assertArrayHasKey('product_links', $response);
$links = $response['product_links'];
- $this->assertEquals(1, count($links));
+ $this->assertCount(1, $links);
$this->assertEquals($productLinkData, $links[0]);
// update link information
@@ -549,7 +549,7 @@ public function testProductLinks()
$this->assertArrayHasKey('product_links', $response);
$links = $response['product_links'];
- $this->assertEquals(1, count($links));
+ $this->assertCount(1, $links);
$this->assertEquals($productLinkData, $links[0]);
// Remove link
@@ -630,9 +630,9 @@ public function testProductOptions()
$this->assertArrayHasKey('options', $response);
$options = $response['options'];
- $this->assertEquals(2, count($options));
- $this->assertEquals(1, count($options[0]['values']));
- $this->assertEquals(1, count($options[1]['values']));
+ $this->assertCount(2, $options);
+ $this->assertCount(1, $options[0]['values']);
+ $this->assertCount(1, $options[1]['values']);
//update the product options, adding a value to option 1, delete an option and create a new option
$options[0]['values'][] = [
@@ -660,9 +660,9 @@ public function testProductOptions()
$response = $this->updateProduct($response);
$this->assertArrayHasKey('options', $response);
$options = $response['options'];
- $this->assertEquals(2, count($options));
- $this->assertEquals(2, count($options[0]['values']));
- $this->assertEquals(1, count($options[1]['values']));
+ $this->assertCount(2, $options);
+ $this->assertCount(2, $options[0]['values']);
+ $this->assertCount(1, $options[1]['values']);
//update product without setting options field, option should not be changed
unset($response['options']);
@@ -670,7 +670,7 @@ public function testProductOptions()
$response = $this->getProduct($productData[ProductInterface::SKU]);
$this->assertArrayHasKey('options', $response);
$options = $response['options'];
- $this->assertEquals(2, count($options));
+ $this->assertCount(2, $options);
//update product with empty options, options should be removed
$response['options'] = [];
@@ -696,7 +696,7 @@ public function testProductWithMediaGallery()
$response = $this->saveProduct($productData);
$this->assertArrayHasKey('media_gallery_entries', $response);
$mediaGalleryEntries = $response['media_gallery_entries'];
- $this->assertEquals(2, count($mediaGalleryEntries));
+ $this->assertCount(2, $mediaGalleryEntries);
$id = $mediaGalleryEntries[0]['id'];
foreach ($mediaGalleryEntries as &$entry) {
unset($entry['id']);
@@ -734,7 +734,7 @@ public function testProductWithMediaGallery()
];
$response = $this->updateProduct($response);
$mediaGalleryEntries = $response['media_gallery_entries'];
- $this->assertEquals(1, count($mediaGalleryEntries));
+ $this->assertCount(1, $mediaGalleryEntries);
unset($mediaGalleryEntries[0]['id']);
$expectedValue = [
[
@@ -751,13 +751,13 @@ public function testProductWithMediaGallery()
unset($response['media_gallery_entries']);
$response = $this->updateProduct($response);
$mediaGalleryEntries = $response['media_gallery_entries'];
- $this->assertEquals(1, count($mediaGalleryEntries));
+ $this->assertCount(1, $mediaGalleryEntries);
unset($mediaGalleryEntries[0]['id']);
$this->assertEquals($expectedValue, $mediaGalleryEntries);
//pass empty array, delete all existing media gallery entries
$response['media_gallery_entries'] = [];
$response = $this->updateProduct($response);
- $this->assertEquals(true, empty($response['media_gallery_entries']));
+ $this->assertEmpty($response['media_gallery_entries']);
$this->deleteProduct($productData[ProductInterface::SKU]);
}
@@ -1239,7 +1239,7 @@ public function testGetListWithMultipleFilterGroupsAndSortingAndPagination()
$searchResult = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(3, $searchResult['total_count']);
- $this->assertEquals(1, count($searchResult['items']));
+ $this->assertCount(1, $searchResult['items']);
$this->assertEquals('search_product_4', $searchResult['items'][0][ProductInterface::SKU]);
$this->assertNotNull(
$searchResult['items'][0][ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]['website_ids']
@@ -1646,8 +1646,8 @@ public function testSpecialPrice()
$missingAttributes = ['news_from_date', 'custom_design_from'];
$expectedAttribute = ['special_price', 'special_from_date'];
$attributeCodes = array_column($customAttributes, 'attribute_code');
- $this->assertEquals(0, count(array_intersect($attributeCodes, $missingAttributes)));
- $this->assertEquals(2, count(array_intersect($attributeCodes, $expectedAttribute)));
+ $this->assertCount(0, array_intersect($attributeCodes, $missingAttributes));
+ $this->assertCount(2, array_intersect($attributeCodes, $expectedAttribute));
}
/**
@@ -1679,7 +1679,7 @@ public function testResetSpecialPrice()
$this->saveProduct($productData);
$response = $this->getProduct($productData[ProductInterface::SKU]);
$customAttributes = array_column($response['custom_attributes'], 'value', 'attribute_code');
- $this->assertFalse(array_key_exists(self::KEY_SPECIAL_PRICE, $customAttributes));
+ $this->assertArrayNotHasKey(self::KEY_SPECIAL_PRICE, $customAttributes);
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryMultiStoreTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryMultiStoreTest.php
index 06e0edb8f8705..4392c27dd74bb 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryMultiStoreTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryMultiStoreTest.php
@@ -86,7 +86,7 @@ public function testGetMultiStore()
/**
* Remove test store
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
/** @var \Magento\Framework\Registry $registry */
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductSwatchAttributeOptionManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductSwatchAttributeOptionManagementInterfaceTest.php
index 237574dd6e22a..663222605b6ef 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductSwatchAttributeOptionManagementInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductSwatchAttributeOptionManagementInterfaceTest.php
@@ -46,7 +46,7 @@ public function testAdd($optionData)
$updatedData = $this->getAttributeOptions($testAttributeCode);
$lastOption = array_pop($updatedData);
foreach ($updatedData as $option) {
- $this->assertNotContains('id', $option['value']);
+ $this->assertStringNotContainsString('id', $option['value']);
}
$this->assertEquals(
$optionData[AttributeOptionInterface::STORE_LABELS][0][AttributeOptionLabelInterface::LABEL],
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/SpecialPriceStorageTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/SpecialPriceStorageTest.php
index e3d4000163e5d..a0bad2c69ee1f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/SpecialPriceStorageTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/SpecialPriceStorageTest.php
@@ -25,7 +25,7 @@ class SpecialPriceStorageTest extends WebapiAbstract
/**
* Set up.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/TierPriceStorageTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/TierPriceStorageTest.php
index 358a3fcb3de9e..018d31910553c 100644
--- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/TierPriceStorageTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/TierPriceStorageTest.php
@@ -24,7 +24,7 @@ class TierPriceStorageTest extends WebapiAbstract
/**
* Set up.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -238,7 +238,7 @@ public function testDelete()
$tierPrices = $productRepository->get(self::SIMPLE_PRODUCT_SKU)->getTierPrices();
$tierPrice = $tierPrices[0];
$this->assertEmpty($response);
- $this->assertEquals(1, count($tierPrices));
+ $this->assertCount(1, $tierPrices);
$this->assertEquals($pricesToStore, $tierPrice);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/CatalogInventory/Api/ProductRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/CatalogInventory/Api/ProductRepositoryInterfaceTest.php
index f1d6949408f5b..e6ff7b0aea1fe 100644
--- a/dev/tests/api-functional/testsuite/Magento/CatalogInventory/Api/ProductRepositoryInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/CatalogInventory/Api/ProductRepositoryInterfaceTest.php
@@ -172,7 +172,7 @@ public function testUpdatingQuantity()
$stockItemData = $response[self::KEY_EXTENSION_ATTRIBUTES][self::KEY_STOCK_ITEM];
$this->assertEquals($qty, $stockItemData[self::KEY_QTY]);
- $this->assertEquals(false, $stockItemData[self::KEY_IS_IN_STOCK]);
+ $this->assertFalse($stockItemData[self::KEY_IS_IN_STOCK]);
// update a created product with catalog inventory
$qty = 1;
diff --git a/dev/tests/api-functional/testsuite/Magento/CatalogInventory/Api/StockItemTest.php b/dev/tests/api-functional/testsuite/Magento/CatalogInventory/Api/StockItemTest.php
index 15e42b672c2ae..2669470690317 100644
--- a/dev/tests/api-functional/testsuite/Magento/CatalogInventory/Api/StockItemTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/CatalogInventory/Api/StockItemTest.php
@@ -40,7 +40,7 @@ class StockItemTest extends WebapiAbstract
/**
* Execute per test initialization
*/
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/CheckoutAgreements/Api/CheckoutAgreementsListTest.php b/dev/tests/api-functional/testsuite/Magento/CheckoutAgreements/Api/CheckoutAgreementsListTest.php
index e2afc9ddb0e84..135415b2fac14 100644
--- a/dev/tests/api-functional/testsuite/Magento/CheckoutAgreements/Api/CheckoutAgreementsListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/CheckoutAgreements/Api/CheckoutAgreementsListTest.php
@@ -26,7 +26,7 @@ public function testGetList()
// Checkout agreements are disabled by default
$agreements = $this->_webApiCall($this->getServiceInfo($requestData), $requestData);
- $this->assertEquals(2, count($agreements));
+ $this->assertCount(2, $agreements);
}
/**
@@ -47,7 +47,7 @@ public function testGetActiveAgreement()
$agreements = $this->_webApiCall($this->getServiceInfo($requestData), $requestData);
- $this->assertEquals(1, count($agreements));
+ $this->assertCount(1, $agreements);
$this->assertEquals(1, $agreements[0]['is_active']);
$this->assertEquals('Checkout Agreement (active)', $agreements[0]['name']);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryTest.php
index 03d1f522ecb29..3893c5d196b60 100644
--- a/dev/tests/api-functional/testsuite/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryTest.php
@@ -14,7 +14,7 @@ class CheckoutAgreementsRepositoryTest extends WebapiAbstract
*/
private $listServiceInfo;
- protected function setUp()
+ protected function setUp(): void
{
$this->listServiceInfo = [
'soap' => [
diff --git a/dev/tests/api-functional/testsuite/Magento/Cms/Api/BlockRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Cms/Api/BlockRepositoryTest.php
index 15ccd5e2586d8..4f22c98aedf95 100644
--- a/dev/tests/api-functional/testsuite/Magento/Cms/Api/BlockRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Cms/Api/BlockRepositoryTest.php
@@ -50,7 +50,7 @@ class BlockRepositoryTest extends WebapiAbstract
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$this->blockFactory = Bootstrap::getObjectManager()->create(\Magento\Cms\Api\Data\BlockInterfaceFactory::class);
$this->blockRepository = Bootstrap::getObjectManager()
@@ -63,7 +63,7 @@ public function setUp()
/**
* Clear temporary data
*/
- public function tearDown()
+ protected function tearDown(): void
{
if ($this->currentBlock) {
$this->blockRepository->delete($this->currentBlock);
@@ -185,10 +185,11 @@ public function testUpdate()
/**
* Test delete \Magento\Cms\Api\Data\BlockInterface
- * @expectedException \Magento\Framework\Exception\NoSuchEntityException
*/
public function testDelete()
{
+ $this->expectException(\Magento\Framework\Exception\NoSuchEntityException::class);
+
$blockTitle = 'Block title';
$blockIdentifier = 'block-title';
/** @var \Magento\Cms\Api\Data\BlockInterface $blockDataObject */
@@ -276,7 +277,7 @@ public function testSearch()
$searchResult = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(2, $searchResult['total_count']);
- $this->assertEquals(1, count($searchResult['items']));
+ $this->assertCount(1, $searchResult['items']);
$this->assertEquals(
$searchResult['items'][0][BlockInterface::IDENTIFIER],
$cmsBlocks['third']->getIdentifier()
diff --git a/dev/tests/api-functional/testsuite/Magento/Cms/Api/PageRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Cms/Api/PageRepositoryTest.php
index bff2ba3ce7aac..757530c4da693 100644
--- a/dev/tests/api-functional/testsuite/Magento/Cms/Api/PageRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Cms/Api/PageRepositoryTest.php
@@ -86,7 +86,7 @@ class PageRepositoryTest extends WebapiAbstract
/**
* @inheritdoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->pageFactory = Bootstrap::getObjectManager()->create(PageInterfaceFactory::class);
$this->pageRepository = Bootstrap::getObjectManager()->create(PageRepositoryInterface::class);
@@ -285,10 +285,11 @@ public function testUpdateOneField(): void
/**
* Test delete \Magento\Cms\Api\Data\PageInterface
- * @expectedException \Magento\Framework\Exception\NoSuchEntityException
*/
public function testDelete()
{
+ $this->expectException(\Magento\Framework\Exception\NoSuchEntityException::class);
+
$pageTitle = self::PAGE_TITLE;
$pageIdentifier = self::PAGE_IDENTIFIER_PREFIX . uniqid();
/** @var PageInterface $pageDataObject */
@@ -378,7 +379,7 @@ public function testSearch()
$searchResult = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(2, $searchResult['total_count']);
- $this->assertEquals(1, count($searchResult['items']));
+ $this->assertCount(1, $searchResult['items']);
$this->assertEquals(
$searchResult['items'][0][PageInterface::IDENTIFIER],
$cmsPages['third']->getIdentifier()
diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/CartItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/CartItemRepositoryTest.php
index c9cad5d597e65..eb8da6e02ad07 100644
--- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/CartItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/CartItemRepositoryTest.php
@@ -20,7 +20,7 @@ class CartItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -71,11 +71,12 @@ public function testAddProduct()
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
* @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php
- * @expectedException \Exception
- * @expectedExceptionMessage You need to choose options for your item.
*/
public function testAddProductWithIncorrectOptions()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('You need to choose options for your item.');
+
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
$quote->load('test_order_1', 'reserved_order_id');
@@ -105,11 +106,12 @@ public function testAddProductWithIncorrectOptions()
/**
* @magentoApiDataFixture Magento/ConfigurableProduct/_files/quote_with_configurable_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage The %1 Cart doesn't contain the %2 item.
*/
public function testUpdateIncorrectItem()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The %1 Cart doesn\'t contain the %2 item.');
+
$qty = 1;
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php
index 53c1bf08bb796..e2105166a4634 100644
--- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/LinkManagementTest.php
@@ -35,7 +35,7 @@ class LinkManagementTest extends WebapiAbstract
/**
* Execute per test initialization
*/
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->attributeRepository = $this->objectManager->get(\Magento\Eav\Model\AttributeRepository::class);
@@ -58,10 +58,10 @@ public function testGetChildren()
$this->assertArrayHasKey('updated_at', $product);
$this->assertArrayHasKey('name', $product);
- $this->assertContains('Configurable Option', $product['name']);
+ $this->assertStringContainsString('Configurable Option', $product['name']);
$this->assertArrayHasKey('sku', $product);
- $this->assertContains('simple_', $product['sku']);
+ $this->assertStringContainsString('simple_', $product['sku']);
$this->assertArrayHasKey('status', $product);
$this->assertEquals('1', $product['status']);
diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php
index 2aabf376e8943..e2ed80edd0415 100644
--- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php
@@ -27,14 +27,14 @@ public function testGet()
$productSku = 'configurable';
$options = $this->getList($productSku);
- $this->assertTrue(is_array($options));
+ $this->assertIsArray($options);
$this->assertNotEmpty($options);
foreach ($options as $option) {
/** @var array $result */
$result = $this->get($productSku, $option['id']);
- $this->assertTrue(is_array($result));
+ $this->assertIsArray($result);
$this->assertNotEmpty($result);
$this->assertArrayHasKey('id', $result);
@@ -47,7 +47,7 @@ public function testGet()
$this->assertEquals($option['label'], $result['label']);
$this->assertArrayHasKey('values', $result);
- $this->assertTrue(is_array($result['values']));
+ $this->assertIsArray($result['values']);
$this->assertEquals($option['values'], $result['values']);
}
}
@@ -63,26 +63,26 @@ public function testGetList()
$result = $this->getList($productSku);
$this->assertNotEmpty($result);
- $this->assertTrue(is_array($result));
+ $this->assertIsArray($result);
$this->assertArrayHasKey(0, $result);
$option = $result[0];
$this->assertNotEmpty($option);
- $this->assertTrue(is_array($option));
+ $this->assertIsArray($option);
$this->assertArrayHasKey('id', $option);
$this->assertArrayHasKey('label', $option);
$this->assertEquals($option['label'], 'Test Configurable');
$this->assertArrayHasKey('values', $option);
- $this->assertTrue(is_array($option));
+ $this->assertIsArray($option);
$this->assertNotEmpty($option);
$this->assertCount(2, $option['values']);
foreach ($option['values'] as $value) {
- $this->assertTrue(is_array($value));
+ $this->assertIsArray($value);
$this->assertNotEmpty($value);
$this->assertArrayHasKey('value_index', $value);
@@ -90,11 +90,14 @@ public function testGetList()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
*/
public function testGetUndefinedProduct()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'The product that was requested doesn\'t exist. Verify the product and try again.'
+ );
+
$productSku = 'product_not_exist';
$this->getList($productSku);
}
@@ -110,7 +113,7 @@ public function testGetUndefinedOption()
try {
$this->get($productSku, $attributeId);
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
'SoapFault does not contain expected message.'
diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OrderItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OrderItemRepositoryTest.php
index 89e0441100cfd..4014674cd4532 100644
--- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OrderItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OrderItemRepositoryTest.php
@@ -21,7 +21,7 @@ class OrderItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -50,7 +50,7 @@ public function testGet()
$response = $this->_webApiCall($serviceInfo, ['id' => $orderItem->getId()]);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertOrderItem($orderItem, $response);
}
@@ -92,10 +92,10 @@ public function testGetList()
$response = $this->_webApiCall($serviceInfo, $requestData);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertArrayHasKey('items', $response);
$this->assertCount(1, $response['items']);
- $this->assertTrue(is_array($response['items'][0]));
+ $this->assertIsArray($response['items'][0]);
$this->assertOrderItem(current($order->getItems()), $response['items'][0]);
}
@@ -114,8 +114,8 @@ protected function assertOrderItem(\Magento\Sales\Model\Order\Item $orderItem, a
$actualOptions = $response['product_option']['extension_attributes']['configurable_item_options'];
- $this->assertTrue(is_array($actualOptions));
- $this->assertTrue(is_array($actualOptions[0]));
+ $this->assertIsArray($actualOptions);
+ $this->assertIsArray($actualOptions[0]);
$this->assertArrayHasKey('option_id', $actualOptions[0]);
$this->assertArrayHasKey('option_value', $actualOptions[0]);
diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/ProductRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/ProductRepositoryTest.php
index c8ecab9ce54d8..4c024008e6853 100644
--- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/ProductRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/ProductRepositoryTest.php
@@ -43,7 +43,7 @@ class ProductRepositoryTest extends WebapiAbstract
/**
* @inheritdoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->eavConfig = $this->objectManager->get(Config::class);
@@ -52,7 +52,7 @@ public function setUp()
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->deleteProductBySku(self::CONFIGURABLE_PRODUCT_SKU);
parent::tearDown();
@@ -89,7 +89,7 @@ protected function createConfigurableProduct()
$this->assertNotNull($this->configurableAttribute);
$options = $this->getConfigurableAttributeOptions();
- $this->assertEquals(2, count($options));
+ $this->assertCount(2, $options);
$configurableProductOptions = [
[
@@ -145,21 +145,21 @@ public function testCreateConfigurableProduct()
);
$resultConfigurableProductOptions
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_options"];
- $this->assertEquals(1, count($resultConfigurableProductOptions));
+ $this->assertCount(1, $resultConfigurableProductOptions);
$this->assertTrue(isset($resultConfigurableProductOptions[0]['label']));
$this->assertTrue(isset($resultConfigurableProductOptions[0]['id']));
$this->assertEquals($label, $resultConfigurableProductOptions[0]['label']);
$this->assertTrue(
isset($resultConfigurableProductOptions[0]['values'])
);
- $this->assertEquals(2, count($resultConfigurableProductOptions[0]['values']));
+ $this->assertCount(2, $resultConfigurableProductOptions[0]['values']);
$this->assertTrue(
isset($response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_links"])
);
$resultConfigurableProductLinks
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_links"];
- $this->assertEquals(2, count($resultConfigurableProductLinks));
+ $this->assertCount(2, $resultConfigurableProductLinks);
$this->assertEquals([$productId1, $productId2], $resultConfigurableProductLinks);
}
@@ -181,14 +181,14 @@ public function testDeleteConfigurableProductOption()
);
$resultConfigurableProductOptions
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_options"];
- $this->assertEquals(0, count($resultConfigurableProductOptions));
+ $this->assertCount(0, $resultConfigurableProductOptions);
$this->assertTrue(
isset($response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_links"])
);
$resultConfigurableProductLinks
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_links"];
- $this->assertEquals(0, count($resultConfigurableProductLinks));
+ $this->assertCount(0, $resultConfigurableProductLinks);
$this->assertEquals([], $resultConfigurableProductLinks);
}
@@ -228,7 +228,7 @@ public function testUpdateConfigurableProductOption()
);
$resultConfigurableProductOptions
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_options"];
- $this->assertEquals(1, count($resultConfigurableProductOptions));
+ $this->assertCount(1, $resultConfigurableProductOptions);
unset($updatedOption['id']);
unset($resultConfigurableProductOptions[0]['id']);
@@ -255,16 +255,16 @@ public function testUpdateConfigurableProductLinks()
);
$resultConfigurableProductOptions
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_options"];
- $this->assertEquals(1, count($resultConfigurableProductOptions));
+ $this->assertCount(1, $resultConfigurableProductOptions);
//Since one product is removed, the available values for the option is reduced
- $this->assertEquals(1, count($resultConfigurableProductOptions[0]['values']));
+ $this->assertCount(1, $resultConfigurableProductOptions[0]['values']);
$this->assertTrue(
isset($response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_links"])
);
$resultConfigurableProductLinks
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["configurable_product_links"];
- $this->assertEquals(1, count($resultConfigurableProductLinks));
+ $this->assertCount(1, $resultConfigurableProductLinks);
$this->assertEquals([$productId1], $resultConfigurableProductLinks);
//adding back the product links, the option value should be restored
@@ -304,7 +304,7 @@ public function testUpdateConfigurableProductLinksWithNonExistingProduct()
$this->saveProduct($response);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -347,7 +347,7 @@ public function testUpdateConfigurableProductLinksWithDuplicateAttributes()
$this->saveProduct($response);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -380,7 +380,7 @@ public function testUpdateConfigurableProductLinksWithWithoutVariationAttributes
$this->saveProduct($response);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementCustomAttributesTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementCustomAttributesTest.php
index 70a0d2e75b80e..bb236f5577d50 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementCustomAttributesTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementCustomAttributesTest.php
@@ -65,7 +65,7 @@ class AccountManagementCustomAttributesTest extends WebapiAbstract
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$this->accountManagement = Bootstrap::getObjectManager()->get(
\Magento\Customer\Api\AccountManagementInterface::class
@@ -82,7 +82,7 @@ public function setUp()
$this->fileSystem = Bootstrap::getObjectManager()->get(\Magento\Framework\Filesystem::class);
}
- public function tearDown()
+ protected function tearDown(): void
{
if (!empty($this->currentCustomerId)) {
foreach ($this->currentCustomerId as $customerId) {
@@ -171,7 +171,7 @@ protected function verifyImageAttribute($customAttributeArray, $expectedFileName
$imageAttributeFound = false;
foreach ($customAttributeArray as $customAttribute) {
if ($customAttribute[AttributeValue::ATTRIBUTE_CODE] == 'customer_image') {
- $this->assertContains($expectedFileName, $customAttribute[AttributeValue::VALUE]);
+ $this->assertStringContainsString($expectedFileName, $customAttribute[AttributeValue::VALUE]);
$mediaDirectory = $this->fileSystem->getDirectoryWrite(DirectoryList::MEDIA);
$customerMediaPath = $mediaDirectory->getAbsolutePath(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER);
$imageAttributeFound = file_exists($customerMediaPath . $customAttribute[AttributeValue::VALUE]);
@@ -211,7 +211,7 @@ public function testCreateCustomerWithInvalidImageAttribute()
try {
$this->createCustomerWithImageAttribute($imageData);
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception message does not match"
@@ -271,6 +271,6 @@ public function testUpdateCustomerWithImageAttribute()
$customerMediaPath = $mediaDirectory->getAbsolutePath(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER);
$previousImagePath =
$previousCustomerData[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES][0][AttributeValue::VALUE];
- $this->assertFalse(file_exists($customerMediaPath . $previousImagePath));
+ $this->assertFileDoesNotExist($customerMediaPath . $previousImagePath);
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementMeTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementMeTest.php
index 88bb3a8d59afd..6a415d7a50c78 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementMeTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementMeTest.php
@@ -71,7 +71,7 @@ class AccountManagementMeTest extends \Magento\TestFramework\TestCase\WebapiAbst
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$this->customerRegistry = Bootstrap::getObjectManager()->get(
\Magento\Customer\Model\CustomerRegistry::class
@@ -100,7 +100,7 @@ public function setUp()
/**
* Ensure that fixture customer and his addresses are deleted.
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->customerRepository = null;
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementTest.php
index a93bbcbdf04b2..63f6814897863 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementTest.php
@@ -84,7 +84,7 @@ class AccountManagementTest extends WebapiAbstract
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$this->accountManagement = Bootstrap::getObjectManager()->get(
\Magento\Customer\Api\AccountManagementInterface::class
@@ -125,7 +125,7 @@ public function setUp()
}
}
- public function tearDown()
+ protected function tearDown(): void
{
if (!empty($this->currentCustomerId)) {
foreach ($this->currentCustomerId as $customerId) {
@@ -372,7 +372,7 @@ public function testValidateResetPasswordLinkTokenInvalidToken()
}
$this->fail("Expected exception to be thrown.");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception message does not match"
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressMetadataTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressMetadataTest.php
index fbf131bf4deca..e16917f7e454a 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressMetadataTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressMetadataTest.php
@@ -14,7 +14,7 @@
use Magento\TestFramework\TestCase\WebapiAbstract;
/**
- * Class AddressMetadataTest
+ * Customer Address Metadata API test
*/
class AddressMetadataTest extends WebapiAbstract
{
@@ -35,7 +35,7 @@ class AddressMetadataTest extends WebapiAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -217,7 +217,7 @@ public function testGetAllAttributesMetadata()
$postcode = $this->getAttributeMetadataDataProvider()[Address::POSTCODE][2];
$validationResult = $this->checkMultipleAttributesValidationRules($postcode, $attributeMetadata);
list($postcode, $attributeMetadata) = $validationResult;
- $this->assertContains($postcode, $attributeMetadata);
+ $this->assertContainsEquals($postcode, $attributeMetadata);
}
/**
@@ -375,7 +375,7 @@ public function checkMultipleAttributesValidationRules($expectedResult, $actualR
/**
* Remove test attribute
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
/** @var \Magento\Customer\Model\Attribute $attribute */
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressRepositoryTest.php
index 7a57d82be127f..941d6c0450e2f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressRepositoryTest.php
@@ -19,7 +19,7 @@ class AddressRepositoryTest extends \Magento\TestFramework\TestCase\WebapiAbstra
/** @var \Magento\Customer\Api\CustomerRepositoryInterface */
protected $customerRepository;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->customerRepository = $objectManager->get(
@@ -34,7 +34,7 @@ protected function setUp()
/**
* Ensure that fixture customer and his addresses are deleted.
*/
- protected function tearDown()
+ protected function tearDown(): void
{
/** @var \Magento\Framework\Registry $registry */
$registry = Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerGroupConfigTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerGroupConfigTest.php
index ef790f5696be9..8a37b33d26403 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerGroupConfigTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerGroupConfigTest.php
@@ -65,18 +65,18 @@ public function testSetDefaultGroupNonExistingGroup()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
);
} catch (\Exception $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
);
- $this->assertContains((string)$customerGroupId, $e->getMessage());
+ $this->assertStringContainsString((string)$customerGroupId, $e->getMessage());
}
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerMetadataTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerMetadataTest.php
index 3b1d431342988..448cdf37478b5 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerMetadataTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerMetadataTest.php
@@ -12,7 +12,7 @@
use Magento\TestFramework\Helper\Bootstrap;
/**
- * Class CustomerMetadataTest
+ * Customer Metadata API test
*/
class CustomerMetadataTest extends WebapiAbstract
{
@@ -28,7 +28,7 @@ class CustomerMetadataTest extends WebapiAbstract
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$this->customerMetadata = Bootstrap::getObjectManager()->create(CustomerMetadataInterface::class);
}
@@ -187,12 +187,12 @@ public function testGetAllAttributesMetadata()
$firstName = $this->getAttributeMetadataDataProvider()[Customer::FIRSTNAME][1];
$validationResult = $this->checkMultipleAttributesValidationRules($firstName, $attributeMetadata);
list($firstName, $attributeMetadata) = $validationResult;
- $this->assertContains($firstName, $attributeMetadata);
+ $this->assertContainsEquals($firstName, $attributeMetadata);
$websiteId = $this->getAttributeMetadataDataProvider()[Customer::WEBSITE_ID][1];
$validationResult = $this->checkMultipleAttributesValidationRules($websiteId, $attributeMetadata);
list($websiteId, $attributeMetadata) = $validationResult;
- $this->assertContains($websiteId, $attributeMetadata);
+ $this->assertContainsEquals($websiteId, $attributeMetadata);
}
/**
@@ -274,6 +274,7 @@ public function getAttributesDataProvider()
];
}
+ // phpcs:disable Generic.Metrics.NestingLevel
/**
* Checks that expected and actual attribute metadata validation rules are equal
* and removes the validation rules entry from expected and actual attribute metadata
@@ -317,6 +318,7 @@ public function checkValidationRules($expectedResult, $actualResult)
}
return [$expectedResult, $actualResult];
}
+ // phpcs:enable
/**
* Check specific attribute validation rules in set of multiple attributes
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php
index 8ee23a1efea44..a00af2d6eb076 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php
@@ -92,7 +92,7 @@ class CustomerRepositoryTest extends WebapiAbstract
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$this->customerRegistry = Bootstrap::getObjectManager()->get(
\Magento\Customer\Model\CustomerRegistry::class
@@ -124,7 +124,7 @@ public function setUp()
);
}
- public function tearDown()
+ protected function tearDown(): void
{
if (!empty($this->currentCustomerId)) {
foreach ($this->currentCustomerId as $customerId) {
@@ -151,10 +151,11 @@ public function tearDown()
/**
* Validate update by invalid customer.
*
- * @expectedException \Exception
*/
public function testInvalidCustomerUpdate()
{
+ $this->expectException(\Exception::class);
+
//Create first customer and retrieve customer token.
$firstCustomerData = $this->_createCustomer();
@@ -252,7 +253,7 @@ public function testDeleteCustomerInvalidCustomerId()
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -341,7 +342,7 @@ public function testUpdateCustomerNoWebsiteId()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception.");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -392,7 +393,7 @@ public function testUpdateCustomerException()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception.");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -850,7 +851,8 @@ public function testRevokeAllAccessTokensForCustomer()
$customerLoadedData = $this->_webApiCall($serviceInfo, ['customerId' => $customerData[Customer::ID]]);
self::assertGreaterThanOrEqual($customerData[Customer::UPDATED_AT], $customerLoadedData[Customer::UPDATED_AT]);
unset($customerData[Customer::UPDATED_AT]);
- self::assertArraySubset($customerData, $customerLoadedData);
+ unset($customerLoadedData[Customer::UPDATED_AT], $customerLoadedData[Customer::CONFIRMATION]);
+ self::assertEquals($customerData, $customerLoadedData);
$revokeToken = $customerTokenService->revokeCustomerAccessToken($customerData[Customer::ID]);
self::assertTrue($revokeToken);
@@ -867,7 +869,7 @@ public function testRevokeAllAccessTokensForCustomer()
try {
$this->_webApiCall($serviceInfo, ['customerId' => $customerData[Customer::ID]]);
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
'SoapFault does not contain expected message.'
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupManagementTest.php
index 88996b27ab49d..74b5ccde8ca2f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupManagementTest.php
@@ -13,7 +13,7 @@
use Magento\TestFramework\TestCase\WebapiAbstract;
/**
- * Class GroupManagementTest
+ * Customer Group Management API test
*/
class GroupManagementTest extends WebapiAbstract
{
@@ -34,7 +34,7 @@ class GroupManagementTest extends WebapiAbstract
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->groupRegistry = $objectManager->get(\Magento\Customer\Model\GroupRegistry::class);
@@ -123,18 +123,18 @@ public function testGetDefaultGroupNonExistentStore()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
);
} catch (\Exception $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
);
- $this->assertContains((string)$nonExistentStoreId, $e->getMessage());
+ $this->assertStringContainsString((string)$nonExistentStoreId, $e->getMessage());
}
}
@@ -212,18 +212,18 @@ public function testIsReadonlyNoSuchGroup()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception.");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
);
} catch (\Exception $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
);
- $this->assertContains((string)$groupId, $e->getMessage());
+ $this->assertStringContainsString((string)$groupId, $e->getMessage());
}
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php
index 920f1f2c428a5..85ff80003f6ea 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/GroupRepositoryTest.php
@@ -19,7 +19,7 @@
use Magento\TestFramework\TestCase\WebapiAbstract;
/**
- * Class GroupRepositoryTest
+ * Customer Group Repository API test
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
@@ -40,14 +40,14 @@ class GroupRepositoryTest extends WebapiAbstract
private $groupRepository;
/**
- * @var \Magento\Customer\Api\Data\groupInterfaceFactory
+ * @var \Magento\Customer\Api\Data\GroupInterfaceFactory
*/
private $customerGroupFactory;
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->groupRegistry = $objectManager->get(\Magento\Customer\Model\GroupRegistry::class);
@@ -262,7 +262,7 @@ public function testCreateGroupNoCodeExpectExceptionRest()
$this->fail("Expected exception");
} catch (\Exception $e) {
// @codingStandardsIgnoreStart
- $this->assertContains(
+ $this->assertStringContainsString(
'\"%fieldName\" is required. Enter and try again.","parameters":{"fieldName":"code"}',
$e->getMessage(),
"Exception does not contain expected message."
@@ -299,7 +299,7 @@ public function testCreateGroupInvalidTaxClassIdRest()
$this->fail("Expected exception");
} catch (\Exception $e) {
// @codingStandardsIgnoreStart
- $this->assertContains(
+ $this->assertStringContainsString(
'{"message":"Invalid value of \"%value\" provided for the %fieldName field.","parameters":{"fieldName":"taxClassId","value":9999}',
$e->getMessage(),
"Exception does not contain expected message."
@@ -332,7 +332,7 @@ public function testCreateGroupWithIdRest()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail('Expected exception');
} catch (\Exception $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
'{"message":"No such entity with %fieldName = %fieldValue","parameters":{"fieldName":"id","fieldValue":88}',
$e->getMessage(),
"Exception does not contain expected message."
@@ -366,7 +366,7 @@ public function testCreateGroupWithIdSoap()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
'No such entity with %fieldName = %fieldValue',
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -440,7 +440,7 @@ public function testUpdateGroupNotExistingGroupRest()
} catch (\Exception $e) {
$expectedMessage = '{"message":"No such entity with %fieldName = %fieldValue",'
. '"parameters":{"fieldName":"id","fieldValue":9999}';
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
@@ -518,7 +518,7 @@ public function testCreateGroupDuplicateGroupSoap()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
@@ -589,7 +589,7 @@ public function testCreateGroupNoCodeExpectExceptionSoap()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
'"%fieldName" is required. Enter and try again.',
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -627,7 +627,7 @@ public function testCreateGroupInvalidTaxClassIdSoap()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
@@ -700,7 +700,7 @@ public function testUpdateGroupNotExistingGroupSoap()
} catch (\Exception $e) {
$expectedMessage = 'No such entity with %fieldName = %fieldValue';
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
@@ -774,7 +774,11 @@ public function testDeleteGroupNotExists()
try {
$this->_webApiCall($serviceInfo, $requestData);
} catch (\SoapFault $e) {
- $this->assertContains($expectedMessage, $e->getMessage(), "SoapFault does not contain expected message.");
+ $this->assertStringContainsString(
+ $expectedMessage,
+ $e->getMessage(),
+ "SoapFault does not contain expected message."
+ );
} catch (\Exception $e) {
$errorObj = $this->processRestExceptionResult($e);
$this->assertEquals($expectedMessage, $errorObj['message']);
@@ -809,13 +813,13 @@ public function testDeleteGroupCannotDelete()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
);
} catch (\Exception $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
diff --git a/dev/tests/api-functional/testsuite/Magento/Directory/Api/CountryInformationAcquirerTest.php b/dev/tests/api-functional/testsuite/Magento/Directory/Api/CountryInformationAcquirerTest.php
index 9a6228de88277..89bd0d79db1cc 100644
--- a/dev/tests/api-functional/testsuite/Magento/Directory/Api/CountryInformationAcquirerTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Directory/Api/CountryInformationAcquirerTest.php
@@ -118,7 +118,7 @@ protected function getCountryInfo($storeCode = 'default')
/**
* Remove test store
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
/** @var \Magento\Framework\Registry $registry */
diff --git a/dev/tests/api-functional/testsuite/Magento/Directory/Api/CurrencyInformationAcquirerTest.php b/dev/tests/api-functional/testsuite/Magento/Directory/Api/CurrencyInformationAcquirerTest.php
index 3a23d8a18b397..67f80bca297bb 100644
--- a/dev/tests/api-functional/testsuite/Magento/Directory/Api/CurrencyInformationAcquirerTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Directory/Api/CurrencyInformationAcquirerTest.php
@@ -99,7 +99,7 @@ protected function getCurrencyInfo($storeCode = 'default')
/**
* Remove test store
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
/** @var \Magento\Framework\Registry $registry */
diff --git a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/CartItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/CartItemRepositoryTest.php
index 0de44dd3767e4..8af1d2a02d4e6 100644
--- a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/CartItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/CartItemRepositoryTest.php
@@ -17,7 +17,7 @@ class CartItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -72,7 +72,7 @@ public function testAddItem()
1,
$response['product_option']['extension_attributes']['downloadable_option']['downloadable_links']
);
- $this->assertContains(
+ $this->assertContainsEquals(
$linkId,
$response['product_option']['extension_attributes']['downloadable_option']['downloadable_links']
);
@@ -81,10 +81,11 @@ public function testAddItem()
/**
* @magentoApiDataFixture Magento/Quote/_files/empty_quote.php
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
*/
public function testAddItemWithInvalidLinkId()
{
+ $this->expectException(\Exception::class);
+
/** @var \Magento\Catalog\Model\Product $product */
$product = $this->objectManager->create(\Magento\Catalog\Model\Product::class)->load(1);
/** @var \Magento\Quote\Model\Quote $quote */
@@ -174,7 +175,7 @@ public function testUpdateItem()
1,
$response['product_option']['extension_attributes']['downloadable_option']['downloadable_links']
);
- $this->assertContains(
+ $this->assertContainsEquals(
$linkId,
$response['product_option']['extension_attributes']['downloadable_option']['downloadable_links']
);
@@ -182,10 +183,11 @@ public function testUpdateItem()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/quote_with_downloadable_product.php
- * @expectedException \Exception
*/
public function testUpdateItemWithInvalidLinkId()
{
+ $this->expectException(\Exception::class);
+
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
$quote->load('reserved_order_id_1', 'reserved_order_id');
@@ -319,7 +321,7 @@ public function testUpdateItemQty()
1,
$response['product_option']['extension_attributes']['downloadable_option']['downloadable_links']
);
- $this->assertContains(
+ $this->assertContainsEquals(
$linkId,
$response['product_option']['extension_attributes']['downloadable_option']['downloadable_links']
);
diff --git a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/LinkRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/LinkRepositoryTest.php
index 3a24aab30cb65..add799c032b19 100644
--- a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/LinkRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/LinkRepositoryTest.php
@@ -37,7 +37,7 @@ class LinkRepositoryTest extends WebapiAbstract
*/
protected $testImagePath;
- protected function setUp()
+ protected function setUp(): void
{
$this->createServiceInfo = [
'rest' => [
@@ -245,11 +245,12 @@ public function testCreateSavesProvidedUrls()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage The link type is invalid. Verify and try again.
*/
public function testCreateThrowsExceptionIfLinkTypeIsNotSpecified()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The link type is invalid. Verify and try again.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -270,11 +271,12 @@ public function testCreateThrowsExceptionIfLinkTypeIsNotSpecified()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Provided content must be valid base64 encoded data.
*/
public function testCreateThrowsExceptionIfLinkFileContentIsNotAValidBase64EncodedString()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Provided content must be valid base64 encoded data.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -301,12 +303,13 @@ public function testCreateThrowsExceptionIfLinkFileContentIsNotAValidBase64Encod
* Check that error appears when link file not existing in filesystem.
*
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Link file not found. Please try again.
* @return void
*/
public function testCreateLinkWithMissingLinkFileThrowsException(): void
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Link file not found. Please try again.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -330,12 +333,13 @@ public function testCreateLinkWithMissingLinkFileThrowsException(): void
* Check that error appears when link sample file not existing in filesystem.
*
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Link sample file not found. Please try again.
* @return void
*/
public function testCreateLinkWithMissingSampleFileThrowsException(): void
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Link sample file not found. Please try again.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -357,11 +361,12 @@ public function testCreateLinkWithMissingSampleFileThrowsException(): void
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Provided content must be valid base64 encoded data.
*/
public function testCreateThrowsExceptionIfSampleFileContentIsNotAValidBase64EncodedString()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Provided content must be valid base64 encoded data.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -386,11 +391,12 @@ public function testCreateThrowsExceptionIfSampleFileContentIsNotAValidBase64Enc
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Provided file name contains forbidden characters.
*/
public function testCreateThrowsExceptionIfLinkFileNameContainsForbiddenCharacters()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Provided file name contains forbidden characters.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -416,11 +422,12 @@ public function testCreateThrowsExceptionIfLinkFileNameContainsForbiddenCharacte
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Provided file name contains forbidden characters.
*/
public function testCreateThrowsExceptionIfSampleFileNameContainsForbiddenCharacters()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Provided file name contains forbidden characters.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -446,11 +453,12 @@ public function testCreateThrowsExceptionIfSampleFileNameContainsForbiddenCharac
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Link URL must have valid format.
*/
public function testCreateThrowsExceptionIfLinkUrlHasWrongFormat()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Link URL must have valid format.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -472,11 +480,12 @@ public function testCreateThrowsExceptionIfLinkUrlHasWrongFormat()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Link URL's domain is not in list of downloadable_domains in env.php.
*/
public function testCreateThrowsExceptionIfLinkUrlUsesDomainNotInWhitelist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Link URL\'s domain is not in list of downloadable_domains in env.php.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -498,11 +507,12 @@ public function testCreateThrowsExceptionIfLinkUrlUsesDomainNotInWhitelist()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Sample URL's domain is not in list of downloadable_domains in env.php.
*/
public function testCreateThrowsExceptionIfSampleUrlUsesDomainNotInWhitelist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Sample URL\'s domain is not in list of downloadable_domains in env.php.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -524,11 +534,12 @@ public function testCreateThrowsExceptionIfSampleUrlUsesDomainNotInWhitelist()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Sample URL must have valid format.
*/
public function testCreateThrowsExceptionIfSampleUrlHasWrongFormat()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Sample URL must have valid format.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -550,12 +561,13 @@ public function testCreateThrowsExceptionIfSampleUrlHasWrongFormat()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Link price must have numeric positive value.
* @dataProvider getInvalidLinkPrice
*/
public function testCreateThrowsExceptionIfLinkPriceIsInvalid($linkPrice)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Link price must have numeric positive value.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -587,12 +599,13 @@ public function getInvalidLinkPrice()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Sort order must be a positive integer.
* @dataProvider getInvalidSortOrder
*/
public function testCreateThrowsExceptionIfSortOrderIsInvalid($sortOrder)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Sort order must be a positive integer.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -623,12 +636,13 @@ public function getInvalidSortOrder()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Number of downloads must be a positive integer.
* @dataProvider getInvalidNumberOfDownloads
*/
public function testCreateThrowsExceptionIfNumberOfDownloadsIsInvalid($numberOfDownloads)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Number of downloads must be a positive integer.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -657,57 +671,6 @@ public function getInvalidNumberOfDownloads()
];
}
- /**
- * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
- * @expectedException \Exception
- * @expectedExceptionMessage The product needs to be the downloadable type. Verify the product and try again.
- */
- public function testCreateThrowsExceptionIfTargetProductTypeIsNotDownloadable()
- {
- $this->createServiceInfo['rest']['resourcePath'] = '/V1/products/simple/downloadable-links';
- $requestData = [
- 'isGlobalScopeContent' => false,
- 'sku' => 'simple',
- 'link' => [
- 'title' => 'Link Title',
- 'sort_order' => 50,
- 'price' => 200,
- 'is_shareable' => 0,
- 'number_of_downloads' => 10,
- 'sample_type' => 'url',
- 'sample_url' => 'http://example.com/',
- 'link_type' => 'url',
- 'link_url' => 'http://example.com/',
- ],
- ];
- $this->_webApiCall($this->createServiceInfo, $requestData);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
- */
- public function testCreateThrowsExceptionIfTargetProductDoesNotExist()
- {
- $this->createServiceInfo['rest']['resourcePath'] = '/V1/products/wrong-sku/downloadable-links';
- $requestData = [
- 'isGlobalScopeContent' => false,
- 'sku' => 'wrong-sku',
- 'link' => [
- 'title' => 'Link Title',
- 'sort_order' => 15,
- 'price' => 200,
- 'is_shareable' => 1,
- 'number_of_downloads' => 100,
- 'sample_type' => 'url',
- 'sample_url' => 'http://example.com/',
- 'link_type' => 'url',
- 'link_url' => 'http://example.com/',
- ],
- ];
- $this->_webApiCall($this->createServiceInfo, $requestData);
- }
-
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
*/
@@ -783,11 +746,14 @@ public function testUpdateSavesDataInGlobalScopeAndDoesNotAffectValuesStoredInSt
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
*/
public function testUpdateThrowsExceptionIfTargetProductDoesNotExist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'The product that was requested doesn\'t exist. Verify the product and try again.'
+ );
+
$this->updateServiceInfo['rest']['resourcePath'] = '/V1/products/wrong-sku/downloadable-links/1';
$requestData = [
'isGlobalScopeContent' => true,
@@ -808,11 +774,14 @@ public function testUpdateThrowsExceptionIfTargetProductDoesNotExist()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage No downloadable link with the provided ID was found. Verify the ID and try again.
*/
public function testUpdateThrowsExceptionIfThereIsNoDownloadableLinkWithGivenId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'No downloadable link with the provided ID was found. Verify the ID and try again.'
+ );
+
$linkId = 9999;
$this->updateServiceInfo['rest']['resourcePath']
= "/V1/products/downloadable-product/downloadable-links/{$linkId}";
@@ -836,12 +805,13 @@ public function testUpdateThrowsExceptionIfThereIsNoDownloadableLinkWithGivenId(
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Link price must have numeric positive value.
* @dataProvider getInvalidLinkPrice
*/
public function testUpdateThrowsExceptionIfLinkPriceIsInvalid($linkPrice)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Link price must have numeric positive value.');
+
$linkId = $this->getTargetLink($this->getTargetProduct())->getId();
$this->updateServiceInfo['rest']['resourcePath']
= "/V1/products/downloadable-product/downloadable-links/{$linkId}";
@@ -865,12 +835,13 @@ public function testUpdateThrowsExceptionIfLinkPriceIsInvalid($linkPrice)
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Sort order must be a positive integer.
* @dataProvider getInvalidSortOrder
*/
public function testUpdateThrowsExceptionIfSortOrderIsInvalid($sortOrder)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Sort order must be a positive integer.');
+
$linkId = $this->getTargetLink($this->getTargetProduct())->getId();
$this->updateServiceInfo['rest']['resourcePath']
= "/V1/products/downloadable-product/downloadable-links/{$linkId}";
@@ -893,12 +864,13 @@ public function testUpdateThrowsExceptionIfSortOrderIsInvalid($sortOrder)
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Number of downloads must be a positive integer.
* @dataProvider getInvalidNumberOfDownloads
*/
public function testUpdateThrowsExceptionIfNumberOfDownloadsIsInvalid($numberOfDownloads)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Number of downloads must be a positive integer.');
+
$linkId = $this->getTargetLink($this->getTargetProduct())->getId();
$this->updateServiceInfo['rest']['resourcePath']
= "/V1/products/downloadable-product/downloadable-links/{$linkId}";
@@ -936,11 +908,69 @@ public function testDelete()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage No downloadable link with the provided ID was found. Verify the ID and try again.
+ * @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable_with_files.php
+ * @dataProvider getListForAbsentProductProvider
+ */
+ public function testGetList($urlTail, $method, $expectations)
+ {
+ $sku = 'downloadable-product';
+
+ $serviceInfo = [
+ 'rest' => [
+ 'resourcePath' => '/V1/products/' . $sku . $urlTail,
+ 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET,
+ ],
+ 'soap' => [
+ 'service' => 'downloadableLinkRepositoryV1',
+ 'serviceVersion' => 'V1',
+ 'operation' => 'downloadableLinkRepositoryV1' . $method,
+ ],
+ ];
+
+ $requestData = ['sku' => $sku];
+
+ $list = $this->_webApiCall($serviceInfo, $requestData);
+
+ $this->assertCount(1, $list);
+
+ $link = reset($list);
+ foreach ($expectations['fields'] as $index => $value) {
+ $this->assertEquals($value, $link[$index]);
+ }
+ $this->assertStringContainsString('jellyfish_1_3.jpg', $link['sample_file']);
+ }
+
+ public function getListForAbsentProductProvider()
+ {
+ $linkExpectation = [
+ 'fields' => [
+ 'is_shareable' => 2,
+ 'price' => 15,
+ 'number_of_downloads' => 15,
+ 'sample_type' => 'file',
+ 'link_file' => '/j/e/jellyfish_2_4.jpg',
+ 'link_type' => 'file'
+ ]
+ ];
+
+ return [
+ 'links' => [
+ '/downloadable-links',
+ 'GetList',
+ $linkExpectation,
+ ],
+ ];
+ }
+
+ /**
*/
public function testDeleteThrowsExceptionIfThereIsNoDownloadableLinkWithGivenId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'No downloadable link with the provided ID was found. Verify the ID and try again.'
+ );
+
$linkId = 9999;
$this->deleteServiceInfo['rest']['resourcePath'] = "/V1/products/downloadable-links/{$linkId}";
$requestData = [
@@ -977,7 +1007,7 @@ public function testGetListForAbsentProduct($urlTail, $method)
} catch (\SoapFault $e) {
$this->assertEquals($expectedMessage, $e->getMessage());
} catch (\Exception $e) {
- $this->assertContains($expectedMessage, $e->getMessage());
+ $this->assertStringContainsString($expectedMessage, $e->getMessage());
}
}
@@ -1008,57 +1038,59 @@ public function testGetListForSimpleProduct($urlTail, $method)
}
/**
- * @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable_with_files.php
- * @dataProvider getListForAbsentProductProvider
+ * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
*/
- public function testGetList($urlTail, $method, $expectations)
+ public function testCreateThrowsExceptionIfTargetProductTypeIsNotDownloadable()
{
- $sku = 'downloadable-product';
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'The product needs to be the downloadable type. Verify the product and try again.'
+ );
- $serviceInfo = [
- 'rest' => [
- 'resourcePath' => '/V1/products/' . $sku . $urlTail,
- 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET,
- ],
- 'soap' => [
- 'service' => 'downloadableLinkRepositoryV1',
- 'serviceVersion' => 'V1',
- 'operation' => 'downloadableLinkRepositoryV1' . $method,
+ $this->createServiceInfo['rest']['resourcePath'] = '/V1/products/simple/downloadable-links';
+ $requestData = [
+ 'isGlobalScopeContent' => false,
+ 'sku' => 'simple',
+ 'link' => [
+ 'title' => 'Link Title',
+ 'sort_order' => 50,
+ 'price' => 200,
+ 'is_shareable' => 0,
+ 'number_of_downloads' => 10,
+ 'sample_type' => 'url',
+ 'sample_url' => 'http://example.com/',
+ 'link_type' => 'url',
+ 'link_url' => 'http://example.com/',
],
];
-
- $requestData = ['sku' => $sku];
-
- $list = $this->_webApiCall($serviceInfo, $requestData);
-
- $this->assertEquals(1, count($list));
-
- $link = reset($list);
- foreach ($expectations['fields'] as $index => $value) {
- $this->assertEquals($value, $link[$index]);
- }
- $this->assertContains('jellyfish_1_3.jpg', $link['sample_file']);
+ $this->_webApiCall($this->createServiceInfo, $requestData);
}
- public function getListForAbsentProductProvider()
+ /**
+ */
+ public function testCreateThrowsExceptionIfTargetProductDoesNotExist()
{
- $linkExpectation = [
- 'fields' => [
- 'is_shareable' => 2,
- 'price' => 15,
- 'number_of_downloads' => 15,
- 'sample_type' => 'file',
- 'link_file' => '/j/e/jellyfish_2_4.jpg',
- 'link_type' => 'file'
- ]
- ];
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'The product that was requested doesn\'t exist. Verify the product and try again.'
+ );
- return [
- 'links' => [
- '/downloadable-links',
- 'GetList',
- $linkExpectation,
+ $this->createServiceInfo['rest']['resourcePath'] = '/V1/products/wrong-sku/downloadable-links';
+ $requestData = [
+ 'isGlobalScopeContent' => false,
+ 'sku' => 'wrong-sku',
+ 'link' => [
+ 'title' => 'Link Title',
+ 'sort_order' => 15,
+ 'price' => 200,
+ 'is_shareable' => 1,
+ 'number_of_downloads' => 100,
+ 'sample_type' => 'url',
+ 'sample_url' => 'http://example.com/',
+ 'link_type' => 'url',
+ 'link_url' => 'http://example.com/',
],
];
+ $this->_webApiCall($this->createServiceInfo, $requestData);
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/OrderItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/OrderItemRepositoryTest.php
index 414ccde47a802..0882d0fb1d85e 100644
--- a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/OrderItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/OrderItemRepositoryTest.php
@@ -21,7 +21,7 @@ class OrderItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -50,7 +50,7 @@ public function testGet()
$response = $this->_webApiCall($serviceInfo, ['id' => $orderItem->getId()]);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertOrderItem($orderItem, $response);
}
@@ -92,10 +92,10 @@ public function testGetList()
$response = $this->_webApiCall($serviceInfo, $requestData);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertArrayHasKey('items', $response);
$this->assertCount(1, $response['items']);
- $this->assertTrue(is_array($response['items'][0]));
+ $this->assertIsArray($response['items'][0]);
$this->assertOrderItem(current($order->getItems()), $response['items'][0]);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/ProductRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/ProductRepositoryTest.php
index c2393d0a5ad2d..1361f10427fab 100644
--- a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/ProductRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/ProductRepositoryTest.php
@@ -25,7 +25,7 @@ class ProductRepositoryTest extends WebapiAbstract
*/
protected $testImagePath;
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->testImagePath = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'test_image.jpg';
@@ -40,7 +40,7 @@ protected function setUp()
/**
* Execute per test cleanup
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->deleteProductBySku(self::PRODUCT_SKU);
parent::tearDown();
@@ -193,7 +193,7 @@ public function testCreateDownloadableProduct()
);
$resultLinks
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_links"];
- $this->assertEquals(2, count($resultLinks));
+ $this->assertCount(2, $resultLinks);
$this->assertTrue(isset($resultLinks[0]['id']));
$this->assertTrue(isset($resultLinks[0]['link_file']));
$this->assertTrue(isset($resultLinks[0]['sample_file']));
@@ -207,7 +207,7 @@ public function testCreateDownloadableProduct()
$this->assertEquals($expectedLinkData, $resultLinks);
$resultSamples = $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_samples"];
- $this->assertEquals(2, count($resultSamples));
+ $this->assertCount(2, $resultSamples);
$this->assertTrue(isset($resultSamples[0]['id']));
unset($resultSamples[0]['id']);
$this->assertTrue(isset($resultSamples[1]['id']));
@@ -259,7 +259,7 @@ public function testUpdateDownloadableProductLinks()
$resultLinks
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_links"];
- $this->assertEquals(3, count($resultLinks));
+ $this->assertCount(3, $resultLinks);
$this->assertTrue(isset($resultLinks[0]['id']));
$this->assertEquals($link1Id, $resultLinks[0]['id']);
$this->assertTrue(isset($resultLinks[0]['link_file']));
@@ -293,7 +293,7 @@ public function testUpdateDownloadableProductLinks()
$this->assertEquals($expectedLinkData, $resultLinks);
$resultSamples = $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_samples"];
- $this->assertEquals(2, count($resultSamples));
+ $this->assertCount(2, $resultSamples);
}
/**
@@ -365,7 +365,7 @@ public function testUpdateDownloadableProductLinksWithNewFile()
$resultLinks
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_links"];
- $this->assertEquals(2, count($resultLinks));
+ $this->assertCount(2, $resultLinks);
$this->assertTrue(isset($resultLinks[0]['id']));
$this->assertEquals($link1Id, $resultLinks[0]['id']);
$this->assertTrue(isset($resultLinks[0]['link_file']));
@@ -410,7 +410,7 @@ public function testUpdateDownloadableProductLinksWithNewFile()
$this->assertEquals($expectedLinkData, $resultLinks);
$resultSamples = $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_samples"];
- $this->assertEquals(2, count($resultSamples));
+ $this->assertCount(2, $resultSamples);
}
public function testUpdateDownloadableProductSamples()
@@ -444,10 +444,10 @@ public function testUpdateDownloadableProductSamples()
$resultLinks
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_links"];
- $this->assertEquals(2, count($resultLinks));
+ $this->assertCount(2, $resultLinks);
$resultSamples = $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_samples"];
- $this->assertEquals(3, count($resultSamples));
+ $this->assertCount(3, $resultSamples);
$this->assertTrue(isset($resultSamples[0]['id']));
$this->assertEquals($sample1Id, $resultSamples[0]['id']);
unset($resultSamples[0]['id']);
@@ -517,22 +517,22 @@ public function testUpdateDownloadableProductSamplesWithNewFile()
$resultLinks
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_links"];
- $this->assertEquals(2, count($resultLinks));
+ $this->assertCount(2, $resultLinks);
$resultSamples = $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_samples"];
- $this->assertEquals(2, count($resultSamples));
+ $this->assertCount(2, $resultSamples);
$this->assertTrue(isset($resultSamples[0]['id']));
$this->assertEquals($sample1Id, $resultSamples[0]['id']);
unset($resultSamples[0]['id']);
$this->assertTrue(isset($resultSamples[0]['sample_file']));
- $this->assertContains('sample1', $resultSamples[0]['sample_file']);
+ $this->assertStringContainsString('sample1', $resultSamples[0]['sample_file']);
$this->assertStringEndsWith('.jpg', $resultSamples[0]['sample_file']);
unset($resultSamples[0]['sample_file']);
$this->assertTrue(isset($resultSamples[1]['id']));
$this->assertEquals($sample2Id, $resultSamples[1]['id']);
unset($resultSamples[1]['id']);
$this->assertTrue(isset($resultSamples[1]['sample_file']));
- $this->assertContains('sample2', $resultSamples[1]['sample_file']);
+ $this->assertStringContainsString('sample2', $resultSamples[1]['sample_file']);
$this->assertStringEndsWith('.jpg', $resultSamples[1]['sample_file']);
unset($resultSamples[1]['sample_file']);
diff --git a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/SampleRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/SampleRepositoryTest.php
index a97e4c5d9e119..6370d1d7d905c 100644
--- a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/SampleRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/SampleRepositoryTest.php
@@ -36,7 +36,7 @@ class SampleRepositoryTest extends WebapiAbstract
*/
protected $deleteServiceInfo;
- protected function setUp()
+ protected function setUp(): void
{
$this->createServiceInfo = [
'rest' => [
@@ -209,11 +209,12 @@ public function testCreateSavesProvidedUrls()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage The sample type is invalid. Verify the sample type and try again.
*/
public function testCreateThrowsExceptionIfSampleTypeIsInvalid()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The sample type is invalid. Verify the sample type and try again.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -231,12 +232,13 @@ public function testCreateThrowsExceptionIfSampleTypeIsInvalid()
* Check that error appears when sample file not existing in filesystem.
*
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Sample file not found. Please try again.
* @return void
*/
public function testCreateSampleWithMissingFileThrowsException(): void
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Sample file not found. Please try again.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -253,11 +255,12 @@ public function testCreateSampleWithMissingFileThrowsException(): void
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Provided content must be valid base64 encoded data.
*/
public function testCreateThrowsExceptionIfSampleFileContentIsNotAValidBase64EncodedString()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Provided content must be valid base64 encoded data.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -277,11 +280,12 @@ public function testCreateThrowsExceptionIfSampleFileContentIsNotAValidBase64Enc
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Provided file name contains forbidden characters.
*/
public function testCreateThrowsExceptionIfSampleFileNameContainsForbiddenCharacters()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Provided file name contains forbidden characters.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -302,11 +306,12 @@ public function testCreateThrowsExceptionIfSampleFileNameContainsForbiddenCharac
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Sample URL must have valid format.
*/
public function testCreateThrowsExceptionIfSampleUrlHasWrongFormat()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Sample URL must have valid format.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -323,12 +328,13 @@ public function testCreateThrowsExceptionIfSampleUrlHasWrongFormat()
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
- * @expectedException \Exception
- * @expectedExceptionMessage Sort order must be a positive integer.
* @dataProvider getInvalidSortOrder
*/
public function testCreateThrowsExceptionIfSortOrderIsInvalid($sortOrder)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Sort order must be a positive integer.');
+
$requestData = [
'isGlobalScopeContent' => false,
'sku' => 'downloadable-product',
@@ -352,47 +358,6 @@ public function getInvalidSortOrder()
];
}
- /**
- * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
- * @expectedException \Exception
- * @expectedExceptionMessage The product needs to be the downloadable type. Verify the product and try again.
- */
- public function testCreateThrowsExceptionIfTargetProductTypeIsNotDownloadable()
- {
- $this->createServiceInfo['rest']['resourcePath'] = '/V1/products/simple/downloadable-links/samples';
- $requestData = [
- 'isGlobalScopeContent' => false,
- 'sku' => 'simple',
- 'sample' => [
- 'title' => 'Sample Title',
- 'sort_order' => 50,
- 'sample_type' => 'url',
- 'sample_url' => 'http://example.com/',
- ],
- ];
- $this->_webApiCall($this->createServiceInfo, $requestData);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
- */
- public function testCreateThrowsExceptionIfTargetProductDoesNotExist()
- {
- $this->createServiceInfo['rest']['resourcePath'] = '/V1/products/wrong-sku/downloadable-links/samples';
- $requestData = [
- 'isGlobalScopeContent' => false,
- 'sku' => 'wrong-sku',
- 'sample' => [
- 'title' => 'Title',
- 'sort_order' => 15,
- 'sample_type' => 'url',
- 'sample_url' => 'http://example.com/',
- ],
- ];
- $this->_webApiCall($this->createServiceInfo, $requestData);
- }
-
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable_with_files.php
*/
@@ -452,33 +417,16 @@ public function testUpdateSavesDataInGlobalScopeAndDoesNotAffectValuesStoredInSt
$this->assertEquals($requestData['sample']['sort_order'], $sample->getSortOrder());
}
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
- */
- public function testUpdateThrowsExceptionIfTargetProductDoesNotExist()
- {
- $this->updateServiceInfo['rest']['resourcePath'] = '/V1/products/wrong-sku/downloadable-links/samples/1';
- $requestData = [
- 'isGlobalScopeContent' => true,
- 'sku' => 'wrong-sku',
- 'sample' => [
- 'id' => 1,
- 'title' => 'Updated Title',
- 'sort_order' => 2,
- 'sample_type' => 'url',
- ],
- ];
- $this->_webApiCall($this->updateServiceInfo, $requestData);
- }
-
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable_with_files.php
- * @expectedException \Exception
- * @expectedExceptionMessage No downloadable sample with the provided ID was found. Verify the ID and try again.
*/
public function testUpdateThrowsExceptionIfThereIsNoDownloadableSampleWithGivenId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'No downloadable sample with the provided ID was found. Verify the ID and try again.'
+ );
+
$sampleId = 9999;
$this->updateServiceInfo['rest']['resourcePath']
= "/V1/products/downloadable-product/downloadable-links/samples/{$sampleId}";
@@ -498,12 +446,13 @@ public function testUpdateThrowsExceptionIfThereIsNoDownloadableSampleWithGivenI
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable_with_files.php
- * @expectedException \Exception
- * @expectedExceptionMessage Sort order must be a positive integer.
* @dataProvider getInvalidSortOrder
*/
public function testUpdateThrowsExceptionIfSortOrderIsInvalid($sortOrder)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Sort order must be a positive integer.');
+
$sampleId = $this->getTargetSample($this->getTargetProduct())->getId();
$this->updateServiceInfo['rest']['resourcePath']
= "/V1/products/downloadable-product/downloadable-links/samples/{$sampleId}";
@@ -536,21 +485,6 @@ public function testDelete()
$this->assertNull($sample);
}
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage No downloadable sample with the provided ID was found. Verify the ID and try again.
- */
- public function testDeleteThrowsExceptionIfThereIsNoDownloadableSampleWithGivenId()
- {
- $sampleId = 9999;
- $this->deleteServiceInfo['rest']['resourcePath'] = "/V1/products/downloadable-links/samples/{$sampleId}";
- $requestData = [
- 'id' => $sampleId,
- ];
-
- $this->_webApiCall($this->deleteServiceInfo, $requestData);
- }
-
/**
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable_with_files.php
* @dataProvider getListForAbsentProductProvider
@@ -575,7 +509,7 @@ public function testGetList($urlTail, $method, $expectations)
$list = $this->_webApiCall($serviceInfo, $requestData);
- $this->assertEquals(1, count($list));
+ $this->assertCount(1, $list);
$link = reset($list);
foreach ($expectations['fields'] as $index => $value) {
@@ -602,4 +536,92 @@ public function getListForAbsentProductProvider()
],
];
}
+
+ /**
+ */
+ public function testDeleteThrowsExceptionIfThereIsNoDownloadableSampleWithGivenId()
+ {
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'No downloadable sample with the provided ID was found. Verify the ID and try again.'
+ );
+
+ $sampleId = 9999;
+ $this->deleteServiceInfo['rest']['resourcePath'] = "/V1/products/downloadable-links/samples/{$sampleId}";
+ $requestData = [
+ 'id' => $sampleId,
+ ];
+
+ $this->_webApiCall($this->deleteServiceInfo, $requestData);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
+ */
+ public function testCreateThrowsExceptionIfTargetProductTypeIsNotDownloadable()
+ {
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'The product needs to be the downloadable type. Verify the product and try again.'
+ );
+
+ $this->createServiceInfo['rest']['resourcePath'] = '/V1/products/simple/downloadable-links/samples';
+ $requestData = [
+ 'isGlobalScopeContent' => false,
+ 'sku' => 'simple',
+ 'sample' => [
+ 'title' => 'Sample Title',
+ 'sort_order' => 50,
+ 'sample_type' => 'url',
+ 'sample_url' => 'http://example.com/',
+ ],
+ ];
+ $this->_webApiCall($this->createServiceInfo, $requestData);
+ }
+
+ /**
+ */
+ public function testCreateThrowsExceptionIfTargetProductDoesNotExist()
+ {
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'The product that was requested doesn\'t exist. Verify the product and try again.'
+ );
+
+ $this->createServiceInfo['rest']['resourcePath'] = '/V1/products/wrong-sku/downloadable-links/samples';
+ $requestData = [
+ 'isGlobalScopeContent' => false,
+ 'sku' => 'wrong-sku',
+ 'sample' => [
+ 'title' => 'Title',
+ 'sort_order' => 15,
+ 'sample_type' => 'url',
+ 'sample_url' => 'http://example.com/',
+ ],
+ ];
+ $this->_webApiCall($this->createServiceInfo, $requestData);
+ }
+
+ /**
+ */
+ public function testUpdateThrowsExceptionIfTargetProductDoesNotExist()
+ {
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'The product that was requested doesn\'t exist. Verify the product and try again.'
+ );
+
+ $this->updateServiceInfo['rest']['resourcePath'] = '/V1/products/wrong-sku/downloadable-links/samples/1';
+ $requestData = [
+ 'isGlobalScopeContent' => true,
+ 'sku' => 'wrong-sku',
+ 'sample' => [
+ 'id' => 1,
+ 'title' => 'Updated Title',
+ 'sort_order' => 2,
+ 'sample_type' => 'url',
+ ],
+ ];
+ $this->_webApiCall($this->updateServiceInfo, $requestData);
+ }
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetManagementTest.php
index 17fc436b2e401..ac05ef702e37d 100644
--- a/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetManagementTest.php
@@ -17,7 +17,7 @@ class AttributeSetManagementTest extends WebapiAbstract
*/
private $createServiceInfo;
- protected function setUp()
+ protected function setUp(): void
{
$this->createServiceInfo = [
'rest' => [
@@ -62,11 +62,12 @@ public function testCreate()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid value
*/
public function testCreateThrowsExceptionIfGivenAttributeSetAlreadyHasId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid value');
+
$entityTypeCode = 'catalog_product';
$entityType = $this->getEntityTypeByCode($entityTypeCode);
$attributeSetName = 'new_attribute_set';
@@ -84,11 +85,12 @@ public function testCreateThrowsExceptionIfGivenAttributeSetAlreadyHasId()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid value
*/
public function testCreateThrowsExceptionIfGivenSkeletonIdIsInvalid()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid value');
+
$entityTypeCode = 'catalog_product';
$attributeSetName = 'new_attribute_set';
@@ -104,11 +106,12 @@ public function testCreateThrowsExceptionIfGivenSkeletonIdIsInvalid()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage No such entity
*/
public function testCreateThrowsExceptionIfGivenSkeletonAttributeSetDoesNotExist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('No such entity');
+
$attributeSetName = 'new_attribute_set';
$entityTypeCode = 'catalog_product';
@@ -124,11 +127,12 @@ public function testCreateThrowsExceptionIfGivenSkeletonAttributeSetDoesNotExist
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid entity_type specified: invalid_entity_type
*/
public function testCreateThrowsExceptionIfGivenEntityTypeDoesNotExist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid entity_type specified: invalid_entity_type');
+
$entityTypeCode = 'catalog_product';
$entityType = $this->getEntityTypeByCode($entityTypeCode);
$attributeSetName = 'new_attribute_set';
@@ -145,11 +149,12 @@ public function testCreateThrowsExceptionIfGivenEntityTypeDoesNotExist()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The attribute set name is empty. Enter the name and try again.
*/
public function testCreateThrowsExceptionIfAttributeSetNameIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The attribute set name is empty. Enter the name and try again.');
+
$entityTypeCode = 'catalog_product';
$entityType = $this->getEntityTypeByCode($entityTypeCode);
$attributeSetName = '';
@@ -185,7 +190,7 @@ public function testCreateThrowsExceptionIfAttributeSetWithGivenNameAlreadyExist
$this->_webApiCall($this->createServiceInfo, $arguments);
$this->fail("Expected exception");
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"SoapFault does not contain expected message."
diff --git a/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetRepositoryTest.php
index 4e2d98279a4c4..8f849169a1493 100644
--- a/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Eav/Api/AttributeSetRepositoryTest.php
@@ -47,10 +47,11 @@ public function testGet()
}
/**
- * @expectedException \Exception
*/
public function testGetThrowsExceptionIfRequestedAttributeSetDoesNotExist()
{
+ $this->expectException(\Exception::class);
+
$attributeSetId = 9999;
$serviceInfo = [
@@ -140,11 +141,12 @@ public function testDeleteById()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The default attribute set can't be deleted.
*/
public function testDeleteByIdDefaultAttributeSet()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The default attribute set can\'t be deleted.');
+
$objectManager = Bootstrap::getObjectManager();
/** @var \Magento\Eav\Model\Config */
$eavConfig = $objectManager->create(\Magento\Eav\Model\Config::class);
@@ -172,10 +174,11 @@ public function testDeleteByIdDefaultAttributeSet()
}
/**
- * @expectedException \Exception
*/
public function testDeleteByIdThrowsExceptionIfRequestedAttributeSetDoesNotExist()
{
+ $this->expectException(\Exception::class);
+
$attributeSetId = 9999;
$serviceInfo = [
@@ -257,7 +260,7 @@ public function testGetList()
$searchResult = $this->_webApiCall($serviceInfo, $requestData);
$this->assertEquals(2, $searchResult['total_count']);
- $this->assertEquals(1, count($searchResult['items']));
+ $this->assertCount(1, $searchResult['items']);
$this->assertEquals(
$searchResult['items'][0]['attribute_set_name'],
'attribute_set_3_for_search'
diff --git a/dev/tests/api-functional/testsuite/Magento/Framework/Model/Entity/HydratorTest.php b/dev/tests/api-functional/testsuite/Magento/Framework/Model/Entity/HydratorTest.php
index 94070dd9190fc..3e88212d356d9 100644
--- a/dev/tests/api-functional/testsuite/Magento/Framework/Model/Entity/HydratorTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Framework/Model/Entity/HydratorTest.php
@@ -35,7 +35,7 @@ class HydratorTest extends \Magento\TestFramework\TestCase\WebapiAbstract
const PASSWORD = 'test@123';
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly('Hydrator can be tested using REST adapter only');
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
diff --git a/dev/tests/api-functional/testsuite/Magento/Framework/Stdlib/CookieManagerTest.php b/dev/tests/api-functional/testsuite/Magento/Framework/Stdlib/CookieManagerTest.php
index 724a43d8dcba5..28433f47362d9 100644
--- a/dev/tests/api-functional/testsuite/Magento/Framework/Stdlib/CookieManagerTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Framework/Stdlib/CookieManagerTest.php
@@ -21,7 +21,7 @@ class CookieManagerTest extends \Magento\TestFramework\TestCase\WebapiAbstract
/** @var CurlClientWithCookies */
protected $curlClient;
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->config = $objectManager->get(\Magento\Webapi\Model\Config::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/CartRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/CartRepositoryTest.php
index a1b87c3ba9e9d..d42166fe1d529 100644
--- a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/CartRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/CartRepositoryTest.php
@@ -18,7 +18,7 @@ class CartRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/GuestCartRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/GuestCartRepositoryTest.php
index 91204ef2d8f28..bbb8a18f07c0b 100644
--- a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/GuestCartRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/GuestCartRepositoryTest.php
@@ -18,7 +18,7 @@ class GuestCartRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/GuestItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/GuestItemRepositoryTest.php
index b7db294eedfbe..81a1bee7acf8d 100644
--- a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/GuestItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/GuestItemRepositoryTest.php
@@ -18,7 +18,7 @@ class GuestItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/ItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/ItemRepositoryTest.php
index d4df57fbff89e..e8aa8f044c995 100644
--- a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/ItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/ItemRepositoryTest.php
@@ -18,7 +18,7 @@ class ItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/CreateBraintreeClientTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/CreateBraintreeClientTokenTest.php
index 7d69c49ae6aa3..a60afde1f067e 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/CreateBraintreeClientTokenTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/CreateBraintreeClientTokenTest.php
@@ -35,11 +35,12 @@ public function testCreateBraintreeClientToken()
/**
* Test creating Braintree client token when method is disabled
*
- * @expectedException \Exception
- * @expectedExceptionMessage payment method is not active
*/
public function testCreateBraintreeClientTokenNotActive()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('payment method is not active');
+
$this->graphQlMutation($this->getMutation());
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php
index a36a4f5d38223..74ee7a3c77c4f 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Customer/SetPaymentMethodTest.php
@@ -67,7 +67,7 @@ class SetPaymentMethodTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -214,11 +214,12 @@ public function testPlaceOrderWithVault()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
* @dataProvider dataProviderTestSetPaymentMethodInvalidInput
- * @expectedException \Exception
* @param string $methodCode
*/
public function testSetPaymentMethodInvalidInput(string $methodCode)
{
+ $this->expectException(\Exception::class);
+
$reservedOrderId = 'test_quote';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
@@ -246,11 +247,12 @@ public function testSetPaymentMethodInvalidInput(string $methodCode)
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
* @dataProvider dataProviderTestSetPaymentMethodInvalidInput
- * @expectedException \Exception
* @param string $methodCode
*/
public function testSetPaymentMethodInvalidMethodInput(string $methodCode)
{
+ $this->expectException(\Exception::class);
+
$reservedOrderId = 'test_quote';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
@@ -458,7 +460,7 @@ private function getHeaderMap(string $username = 'customer@example.com', string
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->registry->unregister('isSecureArea');
$this->registry->register('isSecureArea', true);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php
index 5376634c05146..f217e63c9b61c 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Braintree/Guest/SetPaymentMethodTest.php
@@ -48,7 +48,7 @@ class SetPaymentMethodTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -117,10 +117,11 @@ public function dataProviderTestPlaceOrder(): array
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
- * @expectedException \Exception
*/
public function testSetPaymentMethodInvalidInput()
{
+ $this->expectException(\Exception::class);
+
$reservedOrderId = 'test_quote';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
@@ -218,7 +219,7 @@ private function getPlaceOrderQuery(string $maskedQuoteId): string
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->registry->unregister('isSecureArea');
$this->registry->register('isSecureArea', true);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartTest.php
index 826083b0b3378..0acd6bb333426 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartTest.php
@@ -42,7 +42,7 @@ class AddBundleProductToCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->quoteResource = $objectManager->get(QuoteResource::class);
@@ -208,11 +208,12 @@ public function dataProviderTestUpdateBundleItemQuantity(): array
/**
* @magentoApiDataFixture Magento/Bundle/_files/product_1.php
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
- * @expectedException \Exception
- * @expectedExceptionMessage Please select all required options
*/
public function testAddBundleToCartWithoutOptions()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Please select all required options');
+
$this->quoteResource->load(
$this->quote,
'test_order_1',
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php
index 4c58241590540..a18b6e1206895 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php
@@ -237,7 +237,7 @@ private function assertBundleProductOptions($product, $actualResponse)
$childProductSku = $bundleProductLink->getSku();
$productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class);
$childProduct = $productRepository->get($childProductSku);
- $this->assertEquals(1, count($options));
+ $this->assertCount(1, $options);
$this->assertResponseFields(
$actualResponse['items'][0],
[
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php
index 2bea5832126e8..4da588794b2a9 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php
@@ -367,11 +367,12 @@ public function testEmptyFiltersReturnRootCategory()
* Filtering with match value less than minimum query should return empty result
*
* @magentoApiDataFixture Magento/Catalog/_files/categories.php
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid match filter. Minimum length is 3.
*/
public function testMinimumMatchQueryLength()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid match filter. Minimum length is 3.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('currentPage value must be greater than 0.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('pageSize value must be greater than 0.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('currentPage value 6 specified is greater than the 2 page(s) available.');
+
$query = <<objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->categoryRepository = $this->objectManager->get(CategoryRepository::class);
@@ -204,7 +204,7 @@ public function testCategoriesTreeWithDisabledCategory()
$this->assertArrayHasKey('categories', $response);
$this->assertArrayHasKey('children', $response['categories']['items'][0]);
- $this->assertSame(6, count($response['categories']['items'][0]['children']));
+ $this->assertCount(6, $response['categories']['items'][0]['children']);
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php
index 82a606dad7dec..00eb235cb4dc3 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php
@@ -23,7 +23,7 @@ class CategoryListTest extends GraphQlAbstract
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
@@ -360,11 +360,12 @@ public function testEmptyFiltersReturnRootCategory()
* Filtering with match value less than minimum query should return empty result
*
* @magentoApiDataFixture Magento/Catalog/_files/categories.php
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid match filter. Minimum length is 3.
*/
public function testMinimumMatchQueryLength()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid match filter. Minimum length is 3.');
+
$query = <<objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->categoryRepository = $this->objectManager->get(CategoryRepository::class);
@@ -235,7 +235,7 @@ public function testCategoriesTreeWithDisabledCategory()
$this->assertArrayHasKey('category', $response);
$this->assertArrayHasKey('children', $response['category']);
- $this->assertSame(6, count($response['category']['children']));
+ $this->assertCount(6, $response['category']['children']);
}
/**
@@ -259,11 +259,12 @@ public function testGetCategoryById()
/**
* @magentoApiDataFixture Magento/Catalog/_files/categories.php
- * @expectedException \Exception
- * @expectedExceptionMessage Category doesn't exist
*/
public function testGetDisabledCategory()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Category doesn\'t exist');
+
$categoryId = 8;
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Category doesn\'t exist');
+
$categoryId = 0;
$query = <<objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -62,7 +62,7 @@ public function testHtmlDirectivesRendered()
QUERY;
$response = $this->graphQlQuery($query);
- self::assertNotContains('media url', $response['category']['description']);
- self::assertContains($storeBaseUrl, $response['category']['description']);
+ self::assertStringNotContainsString('media url', $response['category']['description']);
+ self::assertStringContainsString($storeBaseUrl, $response['category']['description']);
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php
index 615438d52e764..5f892ea158e1b 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php
@@ -34,7 +34,7 @@ public function testProductSmallImageUrlWithExistingImage()
$response = $this->graphQlQuery($query);
self::assertArrayHasKey('url', $response['products']['items'][0]['small_image']);
- self::assertContains('magento_image.jpg', $response['products']['items'][0]['small_image']['url']);
+ self::assertStringContainsString('magento_image.jpg', $response['products']['items'][0]['small_image']['url']);
self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url']));
}
@@ -61,7 +61,7 @@ public function testProductSmallImageUrlPlaceholder()
$responseImage = $response['products']['items'][0]['small_image'];
self::assertArrayHasKey('url', $responseImage);
- self::assertContains('placeholder/small_image.jpg', $responseImage['url']);
+ self::assertStringContainsString('placeholder/small_image.jpg', $responseImage['url']);
self::assertTrue($this->checkImageExists($responseImage['url']));
}
@@ -91,11 +91,11 @@ public function testMediaGalleryTypesAreCorrect()
$this->assertCount(2, $mediaGallery);
$this->assertEquals('Image Alt Text', $mediaGallery[0]['label']);
$this->assertEquals('image', $mediaGallery[0]['media_type']);
- $this->assertContains('magento_image', $mediaGallery[0]['file']);
+ $this->assertStringContainsString('magento_image', $mediaGallery[0]['file']);
$this->assertEquals(['image', 'small_image'], $mediaGallery[0]['types']);
$this->assertEquals('Thumbnail Image', $mediaGallery[1]['label']);
$this->assertEquals('image', $mediaGallery[1]['media_type']);
- $this->assertContains('magento_thumbnail', $mediaGallery[1]['file']);
+ $this->assertStringContainsString('magento_thumbnail', $mediaGallery[1]['file']);
$this->assertEquals(['thumbnail', 'swatch_image'], $mediaGallery[1]['types']);
}
@@ -205,7 +205,7 @@ public function testProductMediaGalleryEntries()
$response = $this->graphQlQuery($query);
self::assertArrayHasKey('file', $response['products']['items'][0]['media_gallery_entries'][0]);
- self::assertContains(
+ self::assertStringContainsString(
'magento_image.jpg',
$response['products']['items'][0]['media_gallery_entries'][0]['file']
);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php
index 52463485a34f9..520692a053e30 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php
@@ -16,7 +16,7 @@ class ProductImageTest extends GraphQlAbstract
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -36,12 +36,12 @@ public function testProductWithBaseImage()
label
}
}
- }
+ }
}
QUERY;
$response = $this->graphQlQuery($query);
- self::assertContains('magento_image.jpg', $response['products']['items'][0]['image']['url']);
+ self::assertStringContainsString('magento_image.jpg', $response['products']['items'][0]['image']['url']);
self::assertTrue($this->checkImageExists($response['products']['items'][0]['image']['url']));
self::assertEquals('Image Alt Text', $response['products']['items'][0]['image']['label']);
}
@@ -65,7 +65,7 @@ public function testProductWithoutBaseImage()
label
}
}
- }
+ }
}
QUERY;
$response = $this->graphQlQuery($query);
@@ -96,12 +96,12 @@ public function testProductWithSmallImage()
label
}
}
- }
+ }
}
QUERY;
$response = $this->graphQlQuery($query);
- self::assertContains('magento_image.jpg', $response['products']['items'][0]['small_image']['url']);
+ self::assertStringContainsString('magento_image.jpg', $response['products']['items'][0]['small_image']['url']);
self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url']));
self::assertEquals('Image Alt Text', $response['products']['items'][0]['small_image']['label']);
}
@@ -121,12 +121,12 @@ public function testProductWithThumbnail()
label
}
}
- }
+ }
}
QUERY;
$response = $this->graphQlQuery($query);
- self::assertContains('magento_image.jpg', $response['products']['items'][0]['thumbnail']['url']);
+ self::assertStringContainsString('magento_image.jpg', $response['products']['items'][0]['thumbnail']['url']);
self::assertTrue($this->checkImageExists($response['products']['items'][0]['thumbnail']['url']));
self::assertEquals('Image Alt Text', $response['products']['items'][0]['thumbnail']['label']);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductPriceTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductPriceTest.php
index af237f1bd6fb5..f1c1be44ccd13 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductPriceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductPriceTest.php
@@ -27,7 +27,7 @@ class ProductPriceTest extends GraphQlAbstract
/** @var ProductRepositoryInterface $productRepository */
private $productRepository;
- protected function setUp() :void
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
/** @var ProductRepositoryInterface $productRepository */
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchAggregationsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchAggregationsTest.php
index f647dc74ea55f..a75fb1e1e5ced 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchAggregationsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchAggregationsTest.php
@@ -59,12 +59,12 @@ function ($a) {
$booleanAggregation = reset($booleanAggregation);
$this->assertEquals('Boolean Attribute', $booleanAggregation['label']);
$this->assertEquals('boolean_attribute', $booleanAggregation['attribute_code']);
- $this->assertContains(['label' => '1', 'value'=> '1', 'count' => '3'], $booleanAggregation['options']);
+ $this->assertContainsEquals(['label' => '1', 'value'=> '1', 'count' => '3'], $booleanAggregation['options']);
$this->markTestIncomplete('MC-22184: Elasticsearch returns incorrect aggregation options for booleans');
$this->assertEquals(2, $booleanAggregation['count']);
$this->assertCount(2, $booleanAggregation['options']);
- $this->assertContains(['label' => '0', 'value'=> '0', 'count' => '2'], $booleanAggregation['options']);
+ $this->assertContainsEquals(['label' => '0', 'value'=> '0', 'count' => '2'], $booleanAggregation['options']);
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php
index d7f7a3601b7e9..7182c233f0f47 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php
@@ -1032,7 +1032,7 @@ private function getExpectedFiltersDataSet()
private function assertFilters($response, $expectedFilters, $message = '')
{
$this->assertArrayHasKey('filters', $response['products'], 'Product has filters');
- $this->assertTrue(is_array(($response['products']['filters'])), 'Product filters is not array');
+ $this->assertIsArray(($response['products']['filters']), 'Product filters is not array');
$this->assertTrue(count($response['products']['filters']) > 0, 'Product filters is empty');
foreach ($expectedFilters as $expectedFilter) {
$found = false;
@@ -1641,11 +1641,6 @@ public function testSearchAndSortByRelevance()
$this->assertEquals('Colorful Category', $response['products']['filters'][0]['filter_items'][0]['label']);
$this->assertCount(2, $response['products']['aggregations']);
$productsInResponse = ['Blue briefs','Navy Blue Striped Shoes','Grey shorts'];
- /** @var \Magento\Config\Model\Config $config */
- $config = Bootstrap::getObjectManager()->get(\Magento\Config\Model\Config::class);
- if (strpos($config->getConfigDataValue('catalog/search/engine'), 'elasticsearch') !== false) {
- $this->markTestIncomplete('MC-20716');
- }
$count = count($response['products']['items']);
for ($i = 0; $i < $count; $i++) {
$this->assertEquals($productsInResponse[$i], $response['products']['items'][$i]['name']);
@@ -2116,11 +2111,12 @@ public function testFilterProductsThatAreOutOfStockWithConfigSettings()
*
* @magentoApiDataFixture Magento/Catalog/_files/category.php
* @magentoApiDataFixture Magento/Catalog/_files/products_with_layered_navigation_attribute.php
- * @expectedException \Exception
- * @expectedExceptionMessage currentPage value must be greater than 0
*/
public function testInvalidCurrentPage()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('currentPage value must be greater than 0');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('pageSize value must be greater than 0');
+
$query = <<productRepository = Bootstrap::getObjectManager()::getInstance()->get(ProductRepositoryInterface::class);
}
@@ -134,9 +134,21 @@ public function testHtmlDirectivesRendering()
QUERY;
$response = $this->graphQlQuery($query);
- self::assertContains($assertionCmsBlockText, $response['products']['items'][0]['description']['html']);
- self::assertNotContains('{{block id', $response['products']['items'][0]['description']['html']);
- self::assertContains($assertionCmsBlockText, $response['products']['items'][0]['short_description']['html']);
- self::assertNotContains('{{block id', $response['products']['items'][0]['short_description']['html']);
+ self::assertStringContainsString(
+ $assertionCmsBlockText,
+ $response['products']['items'][0]['description']['html']
+ );
+ self::assertStringNotContainsString(
+ '{{block id',
+ $response['products']['items'][0]['description']['html']
+ );
+ self::assertStringContainsString(
+ $assertionCmsBlockText,
+ $response['products']['items'][0]['short_description']['html']
+ );
+ self::assertStringNotContainsString(
+ '{{block id',
+ $response['products']['items'][0]['short_description']['html']
+ );
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php
index 9d6a5e6d414e0..99fdfb2cf1b00 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php
@@ -26,7 +26,7 @@ class ProductViewTest extends GraphQlAbstract
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -271,7 +271,7 @@ public function testQueryAllFieldsSimpleProduct()
$product = $productRepository->get($productSku, false, null, true);
$this->assertArrayHasKey('products', $response);
$this->assertArrayHasKey('items', $response['products']);
- $this->assertEquals(1, count($response['products']['items']));
+ $this->assertCount(1, $response['products']['items']);
$this->assertArrayHasKey(0, $response['products']['items']);
$this->assertBaseFields($product, $response['products']['items'][0]);
$this->assertEavAttributes($product, $response['products']['items'][0]);
@@ -498,7 +498,7 @@ public function testQueryMediaGalleryEntryFieldsSimpleProduct()
$product = $productRepository->get($productSku, false, null, true);
$this->assertArrayHasKey('products', $response);
$this->assertArrayHasKey('items', $response['products']);
- $this->assertEquals(1, count($response['products']['items']));
+ $this->assertCount(1, $response['products']['items']);
$this->assertArrayHasKey(0, $response['products']['items']);
$this->assertMediaGalleryEntries($product, $response['products']['items'][0]);
$this->assertArrayHasKey('websites', $response['products']['items'][0]);
@@ -531,7 +531,7 @@ public function testQueryCustomAttributeField()
$this->assertArrayHasKey('products', $response);
$this->assertArrayHasKey('items', $response['products']);
- $this->assertEquals(1, count($response['products']['items']));
+ $this->assertCount(1, $response['products']['items']);
$this->assertArrayHasKey(0, $response['products']['items']);
$this->assertCustomAttribute($response['products']['items'][0]);
}
@@ -665,8 +665,7 @@ private function assertMediaGalleryEntries($product, $actualResponse)
{
$mediaGalleryEntries = $product->getMediaGalleryEntries();
$this->assertCount(1, $mediaGalleryEntries, "Precondition failed, incorrect number of media gallery entries.");
- $this->assertTrue(
- is_array([$actualResponse['media_gallery_entries']]),
+ $this->assertIsArray([$actualResponse['media_gallery_entries']],
"Media galleries field must be of an array type."
);
$this->assertCount(1, $actualResponse['media_gallery_entries'], "There must be 1 record in media gallery.");
@@ -968,7 +967,7 @@ public function testProductInAllAnchoredCategories()
$categoryIds = [3, 4, 5];
$productItemsInResponse = $response['products']['items'];
- $this->assertEquals(1, count($productItemsInResponse));
+ $this->assertCount(1, $productItemsInResponse);
$this->assertCount(3, $productItemsInResponse[0]['categories']);
$categoriesInResponse = array_map(null, $categoryIds, $productItemsInResponse[0]['categories']);
foreach ($categoriesInResponse as $key => $categoryData) {
@@ -1023,7 +1022,7 @@ public function testProductWithNonAnchoredParentCategory()
$this->assertNotEmpty($response['products']['items'][0]['categories'], "Categories must not be empty");
$productItemsInResponse = $response['products']['items'];
- $this->assertEquals(1, count($productItemsInResponse));
+ $this->assertCount(1, $productItemsInResponse);
$this->assertCount(3, $productItemsInResponse[0]['categories']);
$categoriesInResponse = array_map(null, $categoryIds, $productItemsInResponse[0]['categories']);
foreach ($categoriesInResponse as $key => $categoryData) {
@@ -1082,7 +1081,7 @@ public function testProductInNonAnchoredSubCategories()
$this->assertNotEmpty($response['products']['items'][0]['categories'], "Categories must not be empty");
$productItemsInResponse = $response['products']['items'];
- $this->assertEquals(1, count($productItemsInResponse));
+ $this->assertCount(1, $productItemsInResponse);
$this->assertCount(2, $productItemsInResponse[0]['categories']);
$categoriesInResponse = array_map(null, $categoryIds, $productItemsInResponse[0]['categories']);
foreach ($categoriesInResponse as $key => $categoryData) {
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php
index 80206b232585f..00f0c496d8ea4 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/VirtualProductViewTest.php
@@ -58,7 +58,7 @@ public function testQueryAllFieldsVirtualProduct()
$product = $productRepository->get($productSku, false, null, true);
$this->assertArrayHasKey('products', $response);
$this->assertArrayHasKey('items', $response['products']);
- $this->assertEquals(1, count($response['products']['items']));
+ $this->assertCount(1, $response['products']['items']);
$this->assertArrayHasKey(0, $response['products']['items']);
$this->assertBaseFields($product, $response['products']['items'][0]);
$this->assertArrayNotHasKey(
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/TierPricesForCustomersTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/TierPricesForCustomersTest.php
index 95f012f798d02..7c0297da607d6 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/TierPricesForCustomersTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/TierPricesForCustomersTest.php
@@ -25,7 +25,7 @@ class TierPricesForCustomersTest extends GraphQlAbstract
/** @var CustomerTokenServiceInterface */
private $customerTokenService;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $this->objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/TierPricesForGuestsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/TierPricesForGuestsTest.php
index d4c834c0aea6a..0290c71e503c0 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/TierPricesForGuestsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/TierPricesForGuestsTest.php
@@ -19,7 +19,7 @@ class TierPricesForGuestsTest extends GraphQlAbstract
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php
index 36f5d7028fb0a..9dd743f119749 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php
@@ -24,7 +24,7 @@ class AddProductToCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -33,11 +33,12 @@ protected function setUp()
/**
* @magentoApiDataFixture Magento/Catalog/_files/products.php
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
- * @expectedException \Exception
- * @expectedExceptionMessage The requested qty is not available
*/
public function testAddProductIfQuantityIsNotAvailable()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested qty is not available');
+
$sku = 'simple';
$quantity = 200;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
@@ -57,7 +58,7 @@ public function testAddMoreProductsThatAllowed()
$quantity = 7;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
- $this->expectExceptionMessageRegExp(
+ $this->expectExceptionMessageMatches(
'/The most you may purchase is 5|The requested qty exceeds the maximum qty allowed in shopping cart/'
);
@@ -68,11 +69,12 @@ public function testAddMoreProductsThatAllowed()
/**
* @magentoApiDataFixture Magento/Catalog/_files/products.php
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
- * @expectedException \Exception
- * @expectedExceptionMessage Please enter a number greater than 0 in this field.
*/
public function testAddSimpleProductToCartWithNegativeQuantity()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Please enter a number greater than 0 in this field.');
+
$sku = 'simple';
$quantity = -2;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
@@ -108,10 +110,10 @@ public function testAddProductIfQuantityIsDecimal()
private function getQuery(string $maskedQuoteId, string $sku, float $quantity) : string
{
return <<stockRegistry = Bootstrap::getObjectManager()->create(StockRegistryInterface::class);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/UpdateCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/UpdateCartItemsTest.php
index 3b238f8641637..1242bf098e6fd 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/UpdateCartItemsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/UpdateCartItemsTest.php
@@ -27,7 +27,7 @@ class UpdateCartItemsTest extends GraphQlAbstract
*/
private $getQuoteItemIdByReservedQuoteIdAndSku;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php
index 29696e29908fe..b12630d70713a 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php
@@ -24,7 +24,7 @@ class UrlResolverTest extends GraphQlAbstract
/**
* {@inheritdoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php
index f0b7ab1b924b6..5c8bfa1e6b147 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php
@@ -28,7 +28,7 @@ class CmsBlockTest extends GraphQlAbstract
*/
private $filterEmulate;
- protected function setUp()
+ protected function setUp(): void
{
$this->blockRepository = Bootstrap::getObjectManager()->get(BlockRepositoryInterface::class);
$this->filterEmulate = Bootstrap::getObjectManager()->get(FilterEmulate::class);
@@ -103,13 +103,14 @@ public function testGetCmsBlockByBlockId()
/**
* Verify the message when CMS Block is disabled
*
- * @expectedException \Exception
- * @expectedExceptionMessage The CMS block with the "disabled_block" ID doesn't exist
*
* @magentoApiDataFixture Magento/Cms/_files/blocks.php
*/
public function testGetDisabledCmsBlock()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The CMS block with the "disabled_block" ID doesn\'t exist');
+
$query =
<<expectException(\Exception::class);
+ $this->expectExceptionMessage('"identifiers" of CMS blocks should be specified');
+
$query =
<<expectException(\Exception::class);
+ $this->expectExceptionMessage('The CMS block with the "nonexistent_id" ID doesn\'t exist.');
+
$query =
<<expectException(\Exception::class);
+ $this->expectExceptionMessage('The CMS page with the "" ID doesn\'t exist.');
+
$query =
<<expectException(\Exception::class);
+ $this->expectExceptionMessage('The CMS page with the "no-route" ID doesn\'t exist.');
+
$cmsPageIdentifier = 'no-route';
$query =
<<objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php
index 8e6400a9a3b93..519f5fef13fdc 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php
@@ -25,7 +25,7 @@ class AddConfigurableProductToCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -144,11 +144,12 @@ public function testAddMultipleConfigurableProductToCart()
* @magentoApiDataFixture Magento/Catalog/_files/configurable_products_with_custom_attribute_layered_navigation.php
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Could not find specified product.
*/
public function testAddVariationFromAnotherConfigurableProductWithTheSameSuperAttributeToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find specified product.');
+
$searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable_12345'));
$product = current($searchResponse['products']['items']);
@@ -172,11 +173,12 @@ public function testAddVariationFromAnotherConfigurableProductWithTheSameSuperAt
* @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products_with_different_super_attribute.php
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Could not find specified product.
*/
public function testAddVariationFromAnotherConfigurableProductWithDifferentSuperAttributeToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find specified product.');
+
$searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable_12345'));
$product = current($searchResponse['products']['items']);
@@ -199,11 +201,12 @@ public function testAddVariationFromAnotherConfigurableProductWithDifferentSuper
/**
* @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
- * @expectedException Exception
- * @expectedExceptionMessage The requested qty is not available
*/
public function testAddProductIfQuantityIsNotAvailable()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested qty is not available');
+
$searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable'));
$product = current($searchResponse['products']['items']);
@@ -224,11 +227,12 @@ public function testAddProductIfQuantityIsNotAvailable()
/**
* @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a product with SKU "configurable_no_exist"
*/
public function testAddNonExistentConfigurableProductParentToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a product with SKU "configurable_no_exist"');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
$parentSku = 'configurable_no_exist';
$sku = 'simple_20';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductStockStatusTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductStockStatusTest.php
index f37de6e8bb916..9208a7f4852a5 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductStockStatusTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductStockStatusTest.php
@@ -24,7 +24,7 @@ class ConfigurableProductStockStatusTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->stockRegistry = Bootstrap::getObjectManager()->create(StockRegistryInterface::class);
}
@@ -42,8 +42,8 @@ public function testConfigurableProductShowOutOfStock()
$this->stockRegistry->updateStockItemBySku($childSkuOutOfStock, $stockItem);
$query = $this->getQuery($parentSku);
$response = $this->graphQlQuery($query);
- $this->assertArraySubset(
- [['product' => ['sku' => $childSkuOutOfStock, 'stock_status' => 'OUT_OF_STOCK']]],
+ $this->assertContainsEquals(
+ ['product' => ['sku' => $childSkuOutOfStock, 'stock_status' => 'OUT_OF_STOCK']],
$response['products']['items'][0]['variants']
);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php
index 4837e2c6ec98a..757998daf816f 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php
@@ -212,7 +212,7 @@ public function testQueryConfigurableProductLinks()
$this->assertArrayHasKey('products', $response);
$this->assertArrayHasKey('items', $response['products']);
- $this->assertEquals(1, count($response['products']['items']));
+ $this->assertCount(1, $response['products']['items']);
$this->assertArrayHasKey(0, $response['products']['items']);
$this->assertBaseFields($product, $response['products']['items'][0]);
$this->assertConfigurableProductOptions($response['products']['items'][0]);
@@ -335,13 +335,11 @@ private function assertConfigurableVariants($actualResponse)
$mediaGalleryEntries,
"Precondition failed since there are incorrect number of media gallery entries"
);
- $this->assertTrue(
- is_array(
- $actualResponse['variants']
+ $this->assertIsArray($actualResponse['variants']
[$variantKey]
['product']
['media_gallery_entries']
- )
+
);
$this->assertCount(
1,
@@ -415,7 +413,7 @@ private function assertConfigurableVariants($actualResponse)
$variantArray['product']['price']
);
$configurableOptions = $this->getConfigurableOptions();
- $this->assertEquals(1, count($variantArray['attributes']));
+ $this->assertCount(1, $variantArray['attributes']);
foreach ($variantArray['attributes'] as $attribute) {
$hasAssertion = false;
foreach ($configurableOptions as $option) {
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/RemoveConfigurableProductFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/RemoveConfigurableProductFromCartTest.php
index 31308eaef5acc..f1b08d8858ba0 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/RemoveConfigurableProductFromCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/RemoveConfigurableProductFromCartTest.php
@@ -43,7 +43,7 @@ class RemoveConfigurableProductFromCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -65,7 +65,7 @@ public function testRemoveConfigurableProductFromCart()
$this->assertArrayHasKey('cart', $response['removeItemFromCart']);
$this->assertArrayHasKey('items', $response['removeItemFromCart']['cart']);
- $this->assertEquals(0, count($response['removeItemFromCart']['cart']['items']));
+ $this->assertCount(0, $response['removeItemFromCart']['cart']['items']);
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/UpdateConfigurableCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/UpdateConfigurableCartItemsTest.php
index 8f32caa9dcf0f..d3bc0204efe23 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/UpdateConfigurableCartItemsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/UpdateConfigurableCartItemsTest.php
@@ -66,7 +66,7 @@ public function testUpdateConfigurableCartItemQuantity()
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/ChangeCustomerPasswordTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/ChangeCustomerPasswordTest.php
index bf01ad4b37218..ed2b5245a2251 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/ChangeCustomerPasswordTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/ChangeCustomerPasswordTest.php
@@ -82,11 +82,12 @@ public function testChangePassword()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testChangePasswordIfUserIsNotAuthorizedTest()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$query = $this->getQuery('currentpassword', 'newpassword');
$this->graphQlMutation($query);
}
@@ -104,18 +105,19 @@ public function testChangeWeakPassword()
$headerMap = $this->getCustomerAuthHeaders($customerEmail, $currentPassword);
$this->expectException(\Exception::class);
- $this->expectExceptionMessageRegExp('/Minimum of different classes of characters in password is.*/');
+ $this->expectExceptionMessageMatches('/Minimum of different classes of characters in password is.*/');
$this->graphQlMutation($query, [], '', $headerMap);
}
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid login or password.
*/
public function testChangePasswordIfPasswordIsInvalid()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid login or password.');
+
$customerEmail = 'customer@example.com';
$currentPassword = 'password';
$newPassword = 'anotherPassword1';
@@ -129,11 +131,12 @@ public function testChangePasswordIfPasswordIsInvalid()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Specify the "currentPassword" value.
*/
public function testChangePasswordIfCurrentPasswordIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Specify the "currentPassword" value.');
+
$customerEmail = 'customer@example.com';
$currentPassword = 'password';
$newPassword = 'anotherPassword1';
@@ -147,11 +150,12 @@ public function testChangePasswordIfCurrentPasswordIsEmpty()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Specify the "newPassword" value.
*/
public function testChangePasswordIfNewPasswordIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Specify the "newPassword" value.');
+
$customerEmail = 'customer@example.com';
$currentPassword = 'password';
$incorrectNewPassword = '';
@@ -164,11 +168,12 @@ public function testChangePasswordIfNewPasswordIsEmpty()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage The account is locked.
*/
public function testChangePasswordIfCustomerIsLocked()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The account is locked.');
+
$customerEmail = 'customer@example.com';
$currentPassword = 'password';
$newPassword = 'anotherPassword1';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerAddressTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerAddressTest.php
index 81300e967f6a2..4576bb654f22a 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerAddressTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerAddressTest.php
@@ -123,7 +123,7 @@ public function testCreateCustomerAddress()
$response = $this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
$this->assertArrayHasKey('createCustomerAddress', $response);
$this->assertArrayHasKey('customer_id', $response['createCustomerAddress']);
- $this->assertEquals(null, $response['createCustomerAddress']['customer_id']);
+ $this->assertNull($response['createCustomerAddress']['customer_id']);
$this->assertArrayHasKey('id', $response['createCustomerAddress']);
$address = $this->addressRepository->getById($response['createCustomerAddress']['id']);
@@ -203,11 +203,12 @@ public function testCreateCustomerAddressWithCountryId()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testCreateCustomerAddressIfUserIsNotAuthorized()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$mutation
= <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameters are missing: firstname');
+
$mutation
= <<expectException(\Exception::class);
+ $this->expectExceptionMessage('"input" value should be specified');
+
$userName = 'customer@example.com';
$password = 'password';
$mutation = << 'default_billing', 'expected_value' => (bool)$address->isDefaultBilling()],
];
$this->assertResponseFields($actualResponse, $assertionMap);
- $this->assertTrue(is_array([$actualResponse['region']]), "region field must be of an array type.");
+ $this->assertIsArray([$actualResponse['region']], "region field must be of an array type.");
$assertionRegionMap = [
['response_field' => 'region', 'expected_value' => $address->getRegion()->getRegion()],
['response_field' => 'region_code', 'expected_value' => $address->getRegion()->getRegionCode()],
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php
index 3da51088f0af6..3560a6ba48dd5 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php
@@ -68,11 +68,11 @@ public function testCreateCustomerAccountWithPassword()
QUERY;
$response = $this->graphQlMutation($query);
- $this->assertEquals(null, $response['createCustomer']['customer']['id']);
+ $this->assertNull($response['createCustomer']['customer']['id']);
$this->assertEquals($newFirstname, $response['createCustomer']['customer']['firstname']);
$this->assertEquals($newLastname, $response['createCustomer']['customer']['lastname']);
$this->assertEquals($newEmail, $response['createCustomer']['customer']['email']);
- $this->assertEquals(true, $response['createCustomer']['customer']['is_subscribed']);
+ $this->assertTrue($response['createCustomer']['customer']['is_subscribed']);
}
/**
@@ -109,15 +109,16 @@ public function testCreateCustomerAccountWithoutPassword()
$this->assertEquals($newFirstname, $response['createCustomer']['customer']['firstname']);
$this->assertEquals($newLastname, $response['createCustomer']['customer']['lastname']);
$this->assertEquals($newEmail, $response['createCustomer']['customer']['email']);
- $this->assertEquals(true, $response['createCustomer']['customer']['is_subscribed']);
+ $this->assertTrue($response['createCustomer']['customer']['is_subscribed']);
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage "input" value should be specified
*/
public function testCreateCustomerIfInputDataIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('"input" value should be specified');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameters are missing: Email');
+
$newFirstname = 'Richard';
$newLastname = 'Rowe';
$currentPassword = 'test123#';
@@ -228,11 +230,12 @@ public function invalidEmailAddressDataProvider(): array
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Field "test123" is not defined by type CustomerInput.
*/
public function testCreateCustomerIfPassedAttributeDosNotExistsInCustomerInput()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Field "test123" is not defined by type CustomerInput.');
+
$newFirstname = 'Richard';
$newLastname = 'Rowe';
$currentPassword = 'test123#';
@@ -264,11 +267,12 @@ public function testCreateCustomerIfPassedAttributeDosNotExistsInCustomerInput()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Required parameters are missing: First Name
*/
public function testCreateCustomerIfNameEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameters are missing: First Name');
+
$newEmail = 'customer_created' . rand(1, 2000000) . '@example.com';
$newFirstname = '';
$newLastname = 'Rowe';
@@ -326,16 +330,17 @@ public function testCreateCustomerSubscribed()
$response = $this->graphQlMutation($query);
- $this->assertEquals(false, $response['createCustomer']['customer']['is_subscribed']);
+ $this->assertFalse($response['createCustomer']['customer']['is_subscribed']);
}
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage A customer with the same email address already exists in an associated website.
*/
public function testCreateCustomerIfCustomerWithProvidedEmailAlreadyExists()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('A customer with the same email address already exists in an associated website.');
+
$existedEmail = 'customer@example.com';
$password = 'test123#';
$firstname = 'John';
@@ -362,7 +367,7 @@ public function testCreateCustomerIfCustomerWithProvidedEmailAlreadyExists()
$this->graphQlMutation($query);
}
- public function tearDown(): void
+ protected function tearDown(): void
{
$newEmail = 'new_customer@example.com';
try {
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/DeleteCustomerAddressTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/DeleteCustomerAddressTest.php
index 31065f3f6f98b..88da6ddee198a 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/DeleteCustomerAddressTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/DeleteCustomerAddressTest.php
@@ -67,15 +67,16 @@ public function testDeleteCustomerAddress()
MUTATION;
$response = $this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
$this->assertArrayHasKey('deleteCustomerAddress', $response);
- $this->assertEquals(true, $response['deleteCustomerAddress']);
+ $this->assertTrue($response['deleteCustomerAddress']);
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testDeleteCustomerAddressIfUserIsNotAuthorized()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$addressId = 1;
$mutation
= <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Customer Address 2 is set as default shipping address and can not be deleted');
+
$userName = 'customer@example.com';
$password = 'password';
$addressId = 2;
@@ -116,11 +118,12 @@ public function testDeleteDefaultShippingCustomerAddress()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Customer Address 2 is set as default billing address and can not be deleted
*/
public function testDeleteDefaultBillingCustomerAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Customer Address 2 is set as default billing address and can not be deleted');
+
$userName = 'customer@example.com';
$password = 'password';
$addressId = 2;
@@ -141,11 +144,12 @@ public function testDeleteDefaultBillingCustomerAddress()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a address with ID "9999"
*/
public function testDeleteNonExistCustomerAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a address with ID "9999"');
+
$userName = 'customer@example.com';
$password = 'password';
$mutation
@@ -161,12 +165,13 @@ public function testDeleteNonExistCustomerAddress()
* Delete address with missing ID input.
*
* @magentoApiDataFixture Magento/Customer/_files/customer_without_addresses.php
- * @expectedException Exception
- * @expectedExceptionMessage Syntax Error: Expected Name, found )
* @throws Exception
*/
public function testDeleteCustomerAddressWithMissingData()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Syntax Error: Expected Name, found )');
+
$userName = 'customer@example.com';
$password = 'password';
$mutation
@@ -182,12 +187,13 @@ public function testDeleteCustomerAddressWithMissingData()
* Delete address with incorrect ID input type.
*
* @magentoApiDataFixture Magento/Customer/_files/customer_without_addresses.php
- * @expectedException Exception
- * @expectedExceptionMessage Expected type Int!, found "".
* @throws Exception
*/
public function testDeleteCustomerAddressWithIncorrectIdType()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Expected type Int!, found "".');
+
$this->markTestSkipped(
'Type validation returns wrong message https://github.com/magento/graphql-ce/issues/735'
);
@@ -206,11 +212,12 @@ public function testDeleteCustomerAddressWithIncorrectIdType()
* @magentoApiDataFixture Magento/Customer/_files/two_customers.php
* @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Current customer does not have permission to address with ID "2"
*/
public function testDeleteAnotherCustomerAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Current customer does not have permission to address with ID "2"');
+
$userName = 'customer_two@example.com';
$password = 'password';
$addressId = 2;
@@ -228,11 +235,12 @@ public function testDeleteAnotherCustomerAddress()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The account is locked
*/
public function testDeleteCustomerAddressIfAccountIsLocked()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The account is locked');
+
$this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/750');
$userName = 'customer@example.com';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GenerateCustomerTokenTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GenerateCustomerTokenTest.php
index 1388f745783a6..261e727448d04 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GenerateCustomerTokenTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GenerateCustomerTokenTest.php
@@ -28,14 +28,13 @@ public function testGenerateCustomerValidToken()
$response = $this->graphQlMutation($mutation);
$this->assertArrayHasKey('generateCustomerToken', $response);
- $this->assertInternalType('array', $response['generateCustomerToken']);
+ $this->assertIsArray($response['generateCustomerToken']);
}
/**
* Test customer with invalid data.
*
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
*
* @dataProvider dataProviderInvalidCustomerInfo
* @param string $email
@@ -44,6 +43,8 @@ public function testGenerateCustomerValidToken()
*/
public function testGenerateCustomerTokenInvalidData(string $email, string $password, string $message)
{
+ $this->expectException(\Exception::class);
+
$mutation = $this->getQuery($email, $password);
$this->expectExceptionMessage($message);
$this->graphQlMutation($mutation);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetAddressesTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetAddressesTest.php
index ed360919d8320..2ead4e419d705 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetAddressesTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetAddressesTest.php
@@ -58,22 +58,22 @@ public function testGetCustomerWithAddresses()
$response = $this->graphQlQuery($query, [], '', $headerMap);
$this->assertArrayHasKey('customer', $response);
$this->assertArrayHasKey('addresses', $response['customer']);
- $this->assertTrue(
- is_array([$response['customer']['addresses']]),
+ $this->assertIsArray([$response['customer']['addresses']],
" Addresses field must be of an array type."
);
- self::assertEquals(null, $response['customer']['id']);
+ self::assertNull($response['customer']['id']);
$this->assertCustomerAddressesFields($customer, $response);
}
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
- * @expectedException Exception
- * @expectedExceptionMessage GraphQL response contains errors: The account is locked.
*/
public function testGetCustomerAddressIfAccountIsLocked()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('GraphQL response contains errors: The account is locked.');
+
$query = $this->getQuery();
$userName = 'customer@example.com';
@@ -89,11 +89,12 @@ public function testGetCustomerAddressIfAccountIsLocked()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
- * @expectedException Exception
- * @expectedExceptionMessage GraphQL response contains errors: The current customer isn't authorized.
*/
public function testGetCustomerAddressIfUserIsNotAuthorized()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('GraphQL response contains errors: The current customer isn\'t authorized.');
+
$query = $this->getQuery();
$this->graphQlQuery($query);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetCustomerTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetCustomerTest.php
index c645d8953981a..daae62ce8d535 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetCustomerTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetCustomerTest.php
@@ -71,18 +71,19 @@ public function testGetCustomer()
$this->getCustomerAuthHeaders($currentEmail, $currentPassword)
);
- $this->assertEquals(null, $response['customer']['id']);
+ $this->assertNull($response['customer']['id']);
$this->assertEquals('John', $response['customer']['firstname']);
$this->assertEquals('Smith', $response['customer']['lastname']);
$this->assertEquals($currentEmail, $response['customer']['email']);
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testGetCustomerIfUserIsNotAuthorized()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('The account is locked.');
+
$this->lockCustomer(1);
$currentEmail = 'customer@example.com';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/IsEmailAvailableTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/IsEmailAvailableTest.php
index a8c4d453e2962..f0bd7dc1e854a 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/IsEmailAvailableTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/IsEmailAvailableTest.php
@@ -55,11 +55,12 @@ public function testEmailAvailable()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage GraphQL response contains errors: Email must be specified
*/
public function testEmailAvailableEmptyValue()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('GraphQL response contains errors: Email must be specified');
+
$query =
<<expectException(\Exception::class);
+ $this->expectExceptionMessage('Field "isEmailAvailable" argument "email" of type "String!" is required');
+
$query =
<<expectException(\Exception::class);
+ $this->expectExceptionMessage('GraphQL response contains errors: Email is invalid');
+
$query =
<<expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$query = <<graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
$this->assertArrayHasKey('updateCustomerAddress', $response);
$this->assertArrayHasKey('customer_id', $response['updateCustomerAddress']);
- $this->assertEquals(null, $response['updateCustomerAddress']['customer_id']);
+ $this->assertNull($response['updateCustomerAddress']['customer_id']);
$this->assertArrayHasKey('id', $response['updateCustomerAddress']);
$address = $this->addressRepository->getById($addressId);
@@ -127,11 +127,12 @@ public function testUpdateCustomerAddressWithCountryId()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testUpdateCustomerAddressIfUserIsNotAuthorized()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$addressId = 1;
$mutation
= <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameters are missing: firstname');
+
$userName = 'customer@example.com';
$password = 'password';
$addressId = 1;
@@ -249,7 +251,7 @@ private function assertCustomerAddressesFields(
['response_field' => 'default_billing', 'expected_value' => (bool)$address->isDefaultBilling()],
];
$this->assertResponseFields($actualResponse, $assertionMap);
- $this->assertTrue(is_array([$actualResponse['region']]), "region field must be of an array type.");
+ $this->assertIsArray([$actualResponse['region']], "region field must be of an array type.");
$assertionRegionMap = [
['response_field' => 'region', 'expected_value' => $address->getRegion()->getRegion()],
['response_field' => 'region_code', 'expected_value' => $address->getRegion()->getRegionCode()],
@@ -409,11 +411,12 @@ public function invalidInputDataProvider()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a address with ID "9999"
*/
public function testUpdateNotExistingCustomerAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a address with ID "9999"');
+
$userName = 'customer@example.com';
$password = 'password';
$addressId = 9999;
@@ -426,11 +429,12 @@ public function testUpdateNotExistingCustomerAddress()
/**
* @magentoApiDataFixture Magento/Customer/_files/two_customers.php
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
- * @expectedException Exception
- * @expectedExceptionMessage Current customer does not have permission to address with ID "1"
*/
public function testUpdateAnotherCustomerAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Current customer does not have permission to address with ID "1"');
+
$userName = 'customer_two@example.com';
$password = 'password';
$addressId = 1;
@@ -443,11 +447,12 @@ public function testUpdateAnotherCustomerAddress()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_address.php
- * @expectedException Exception
- * @expectedExceptionMessage The account is locked.
*/
public function testUpdateCustomerAddressIfAccountIsLocked()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The account is locked.');
+
$this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/750');
$userName = 'customer@example.com';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerTest.php
index 7121f12bc2a42..6e90e85782bb2 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerTest.php
@@ -110,11 +110,12 @@ public function testUpdateCustomer()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage "input" value should be specified
*/
public function testUpdateCustomerIfInputDataIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('"input" value should be specified');
+
$currentEmail = 'customer@example.com';
$currentPassword = 'password';
@@ -135,11 +136,12 @@ public function testUpdateCustomerIfInputDataIsEmpty()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testUpdateCustomerIfUserIsNotAuthorized()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$newFirstname = 'Richard';
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('The account is locked.');
+
$this->lockCustomer->execute(1);
$currentEmail = 'customer@example.com';
@@ -189,11 +192,12 @@ public function testUpdateCustomerIfAccountIsLocked()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Provide the current "password" to change "email".
*/
public function testUpdateEmailIfPasswordIsMissed()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Provide the current "password" to change "email".');
+
$currentEmail = 'customer@example.com';
$currentPassword = 'password';
$newEmail = 'customer_updated@example.com';
@@ -216,11 +220,12 @@ public function testUpdateEmailIfPasswordIsMissed()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid login or password.
*/
public function testUpdateEmailIfPasswordIsInvalid()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid login or password.');
+
$currentEmail = 'customer@example.com';
$currentPassword = 'password';
$invalidPassword = 'invalid_password';
@@ -245,11 +250,12 @@ public function testUpdateEmailIfPasswordIsInvalid()
/**
* @magentoApiDataFixture Magento/Customer/_files/two_customers.php
- * @expectedException \Exception
- * @expectedExceptionMessage A customer with the same email address already exists in an associated website.
*/
public function testUpdateEmailIfEmailAlreadyExists()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('A customer with the same email address already exists in an associated website.');
+
$currentEmail = 'customer@example.com';
$currentPassword = 'password';
$existedEmail = 'customer_two@example.com';
@@ -277,11 +283,12 @@ public function testUpdateEmailIfEmailAlreadyExists()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Required parameters are missing: First Name
*/
public function testEmptyCustomerName()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameters are missing: First Name');
+
$currentEmail = 'customer@example.com';
$currentPassword = 'password';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CustomerDownloadableProduct/CustomerDownloadableProductTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CustomerDownloadableProduct/CustomerDownloadableProductTest.php
index d0ad772e9bb27..e65aabadc5c0c 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CustomerDownloadableProduct/CustomerDownloadableProductTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CustomerDownloadableProduct/CustomerDownloadableProductTest.php
@@ -23,7 +23,7 @@ class CustomerDownloadableProductTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
@@ -56,11 +56,12 @@ public function testCustomerDownloadableProducts()
* @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php
* @magentoApiDataFixture Magento/Downloadable/_files/customer_order_with_downloadable_product.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testGuestCannotAccessDownloadableProducts()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$this->graphQlQuery($this->getQuery());
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Directory/CountryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Directory/CountryTest.php
index 8be8ed793ccb0..55966fc0bce60 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Directory/CountryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Directory/CountryTest.php
@@ -47,11 +47,12 @@ public function testGetCountry()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage GraphQL response contains errors: The country isn't available.
*/
public function testGetCountryNotFoundException()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('GraphQL response contains errors: The country isn\'t available.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Country "id" value should be specified');
+
$query = <<objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $this->objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/DownloadableProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/DownloadableProductViewTest.php
index 37f8801a6c2e9..c2a1b0778d3c6 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/DownloadableProductViewTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/DownloadableProductViewTest.php
@@ -33,11 +33,11 @@ public function testQueryAllFieldsDownloadableProductsWithDownloadableFileAndSam
{
items{
id
- attribute_set_id
+ attribute_set_id
created_at
name
sku
- type_id
+ type_id
updated_at
price{
regularPrice{
@@ -50,16 +50,16 @@ public function testQueryAllFieldsDownloadableProductsWithDownloadableFileAndSam
description
}
}
- }
+ }
... on DownloadableProduct {
links_title
links_purchased_separately
-
+
downloadable_product_links{
sample_url
sort_order
title
- price
+ price
}
downloadable_product_samples{
title
@@ -203,7 +203,7 @@ private function assertDownloadableProductLinks($product, $actualResponse)
/** @var LinkInterface $downloadableProductLinks */
$downloadableProductLinks = $product->getExtensionAttributes()->getDownloadableProductLinks();
$downloadableProductLink = $downloadableProductLinks[1];
- $this->assertNotEmpty('sample_url', $actualResponse['downloadable_product_links'][1]);
+ $this->assertNotEmpty($actualResponse['downloadable_product_links'][1]['sample_url']);
$this->assertResponseFields(
$actualResponse['downloadable_product_links'][1],
[
@@ -227,7 +227,7 @@ private function assertDownloadableProductSamples($product, $actualResponse)
/** @var SampleInterface $downloadableProductSamples */
$downloadableProductSamples = $product->getExtensionAttributes()->getDownloadableProductSamples();
$downloadableProductSample = $downloadableProductSamples[0];
- $this->assertNotEmpty('sample_url', $actualResponse['downloadable_product_samples'][0]);
+ $this->assertNotEmpty($actualResponse['downloadable_product_samples'][0]['sample_url']);
$this->assertResponseFields(
$actualResponse['downloadable_product_samples'][0],
[
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/UpdateDownloadableCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/UpdateDownloadableCartItemsTest.php
index ae533252f14c0..072890b0bd96e 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/UpdateDownloadableCartItemsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/DownloadableProduct/UpdateDownloadableCartItemsTest.php
@@ -57,7 +57,7 @@ class UpdateDownloadableCartItemsTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $this->objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/FedEx/SetFedExShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/FedEx/SetFedExShippingMethodsOnCartTest.php
index 9525ab521a5ea..c1b956c118d53 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/FedEx/SetFedExShippingMethodsOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/FedEx/SetFedExShippingMethodsOnCartTest.php
@@ -52,7 +52,7 @@ class SetFedExShippingMethodsOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php
index e784061d5562f..2ab7f50b86ae9 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Framework/QueryComplexityLimiterTest.php
@@ -392,7 +392,7 @@ public function testQueryComplexityIsLimited()
}
QUERY;
- self::expectExceptionMessageRegExp('/Max query complexity should be 300 but got 302/');
+ self::expectExceptionMessageMatches('/Max query complexity should be 300 but got 302/');
//Use POST request because request uri is too large for some servers
$this->graphQlMutation($query);
}
@@ -460,7 +460,7 @@ public function testQueryDepthIsLimited()
}
}
QUERY;
- self::expectExceptionMessageRegExp('/Max query depth should be 20 but got 23/');
+ self::expectExceptionMessageMatches('/Max query depth should be 20 but got 23/');
$this->graphQlQuery($query);
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/GroupedProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/GroupedProductViewTest.php
index cbd91f6fbdb37..e6db0b9e808ef 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/GroupedProductViewTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/GroupedProduct/GroupedProductViewTest.php
@@ -62,7 +62,7 @@ private function assertGroupedProductItems($product, $actualResponse)
$actualResponse['items'],
"Precondition failed: 'grouped product items' must not be empty"
);
- $this->assertEquals(2, count($actualResponse['items']));
+ $this->assertCount(2, $actualResponse['items']);
$groupedProductLinks = $product->getProductLinks();
foreach ($actualResponse['items'] as $itemIndex => $bundleItems) {
$this->assertNotEmpty($bundleItems);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/CacheTagTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/CacheTagTest.php
index 23bcd342ec994..6fb587fae7365 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/CacheTagTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/CacheTagTest.php
@@ -20,7 +20,7 @@ class CacheTagTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->markTestSkipped(
'This test will stay skipped until DEVOPS-4924 is resolved'
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/BlockCacheTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/BlockCacheTest.php
index 5182ff791f576..0400919484f81 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/BlockCacheTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/BlockCacheTest.php
@@ -20,7 +20,7 @@ class BlockCacheTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->markTestSkipped(
'This test will stay skipped until DEVOPS-4924 is resolved'
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/PageCacheTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/PageCacheTest.php
index 34dc9eef4c339..355c23769af09 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/PageCacheTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Cms/PageCacheTest.php
@@ -25,7 +25,7 @@ class PageCacheTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->markTestSkipped(
'This test will stay skipped until DEVOPS-4924 is resolved'
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php
index cf4cebdfe8e44..20a612e9f88b0 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/ProductInMultipleStoresCacheTest.php
@@ -20,7 +20,7 @@ class ProductInMultipleStoresCacheTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
/** @var \Magento\Store\Model\Store $store */
$store = ObjectManager::getInstance()->get(\Magento\Store\Model\Store::class);
@@ -59,7 +59,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
/** @var \Magento\Config\App\Config\Type\System $config */
$config = ObjectManager::getInstance()->get(\Magento\Config\App\Config\Type\System::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Quote/Guest/CartCacheTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Quote/Guest/CartCacheTest.php
index 808fd95d331e1..ee5e186ee56c9 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Quote/Guest/CartCacheTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/Quote/Guest/CartCacheTest.php
@@ -19,7 +19,7 @@ class CartCacheTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->markTestSkipped(
'This test will stay skipped until DEVOPS-4924 is resolved'
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/UrlRewrite/UrlResolverCacheTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/UrlRewrite/UrlResolverCacheTest.php
index 1cf33184714d9..226ca283c9dcd 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/UrlRewrite/UrlResolverCacheTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/UrlRewrite/UrlResolverCacheTest.php
@@ -22,7 +22,7 @@ class UrlResolverCacheTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->markTestSkipped(
'This test will stay skipped until DEVOPS-4924 is resolved'
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddDownloadableProductWithCustomOptionsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddDownloadableProductWithCustomOptionsToCartTest.php
index 8b8973ad0fd95..8e5dca15ee5dc 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddDownloadableProductWithCustomOptionsToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddDownloadableProductWithCustomOptionsToCartTest.php
@@ -35,7 +35,7 @@ class AddDownloadableProductWithCustomOptionsToCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $this->objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php
index 5c2bc10bf771e..f731b60c15aa1 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php
@@ -34,7 +34,7 @@ class AddSimpleProductWithCustomOptionsToCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php
index 561318889e325..8e0b76e6fef24 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php
@@ -34,7 +34,7 @@ class AddVirtualProductWithCustomOptionsToCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php
index aca98e946054c..dc9b2540aba1c 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddSimpleProductToCartTest.php
@@ -84,11 +84,12 @@ public function testAddSimpleProductToCart()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testAddSimpleProductToCartIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_items" is missing');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$sku = 'simple_product';
$quantity = 2;
$maskedQuoteId = 'non_existent_masked_id';
@@ -157,11 +160,12 @@ public function testAddProductToNonExistentCart()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a product with SKU "simple_product"
*/
public function testNonExistentProductToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a product with SKU "simple_product"');
+
$sku = 'simple_product';
$qty = 2;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php
index 4805721de625a..de4805de1f568 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/AddVirtualProductToCartTest.php
@@ -29,7 +29,7 @@ class AddVirtualProductToCartTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
@@ -56,11 +56,12 @@ public function testAddVirtualProductToCart()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testAddVirtualProductToCartIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_items" is missing');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$sku = 'virtual_product';
$qty = 2;
$nonExistentMaskedQuoteId = 'non_existent_masked_id';
@@ -129,11 +132,12 @@ public function testAddVirtualToNonExistentCart()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a product with SKU "virtual_product"
*/
public function testNonExistentProductToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a product with SKU "virtual_product"');
+
$sku = 'virtual_product';
$qty = 2;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php
index d96bf77f2ef0e..cf3728dc3247d 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php
@@ -28,7 +28,7 @@ class ApplyCouponToCartTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
@@ -59,11 +59,12 @@ public function testApplyCouponToCart()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage A coupon is already applied to the cart. Please remove it to apply another
*/
public function testApplyCouponTwice()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('A coupon is already applied to the cart. Please remove it to apply another');
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -80,11 +81,12 @@ public function testApplyCouponTwice()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
- * @expectedException \Exception
- * @expectedExceptionMessage Cart does not contain products.
*/
public function testApplyCouponToCartWithoutItems()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Cart does not contain products.');
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -97,10 +99,11 @@ public function testApplyCouponToCartWithoutItems()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
- * @expectedException \Exception
*/
public function testApplyCouponToGuestCart()
{
+ $this->expectException(\Exception::class);
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -116,10 +119,11 @@ public function testApplyCouponToGuestCart()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
- * @expectedException \Exception
*/
public function testApplyCouponToAnotherCustomerCart()
{
+ $this->expectException(\Exception::class);
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -133,11 +137,12 @@ public function testApplyCouponToAnotherCustomerCart()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage The coupon code isn't valid. Verify the code and try again.
*/
public function testApplyNonExistentCouponToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The coupon code isn\'t valid. Verify the code and try again.');
+
$couponCode = 'non_existent_coupon_code';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -150,10 +155,11 @@ public function testApplyNonExistentCouponToCart()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
- * @expectedException \Exception
*/
public function testApplyCouponToNonExistentCart()
{
+ $this->expectException(\Exception::class);
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -171,11 +177,12 @@ public function testApplyCouponToNonExistentCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/restrict_coupon_usage_for_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage The coupon code isn't valid. Verify the code and try again.
*/
public function testApplyCouponWhichIsNotApplicable()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The coupon code isn\'t valid. Verify the code and try again.');
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartDiscountTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartDiscountTest.php
index 37c53a62f7d39..5b29ed18b2c7d 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartDiscountTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartDiscountTest.php
@@ -27,7 +27,7 @@ class CartDiscountTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -81,7 +81,7 @@ public function testGetDiscountInformationWithNoRulesApplied()
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
$response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
- self::assertEquals(null, $response['cart']['prices']['discount']);
+ self::assertNull($response['cart']['prices']['discount']);
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartTotalsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartTotalsTest.php
index 29dad25055636..b43aa88e30251 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartTotalsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartTotalsTest.php
@@ -27,7 +27,7 @@ class CartTotalsTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CheckoutEndToEndTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CheckoutEndToEndTest.php
index ddf94fbcc1edf..7b686ea8c92f9 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CheckoutEndToEndTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CheckoutEndToEndTest.php
@@ -62,7 +62,7 @@ class CheckoutEndToEndTest extends GraphQlAbstract
*/
private $headers = [];
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -466,7 +466,7 @@ private function checkOrderInHistory(string $orderId): void
self::assertArrayHasKey('grand_total', $order);
}
- public function tearDown()
+ protected function tearDown(): void
{
$this->deleteCustomer();
$this->deleteQuote();
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CreateEmptyCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CreateEmptyCartTest.php
index ec83e05c342d1..360e405cab139 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CreateEmptyCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CreateEmptyCartTest.php
@@ -45,7 +45,7 @@ class CreateEmptyCartTest extends GraphQlAbstract
*/
private $quoteIdMaskFactory;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->quoteCollectionFactory = $objectManager->get(QuoteCollectionFactory::class);
@@ -140,11 +140,12 @@ public function testCreateEmptyCartWithPredefinedCartId()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage Cart with ID "572cda51902b5b517c0e1a2b2fd004b4" already exists.
*/
public function testCreateEmptyCartIfPredefinedCartIdAlreadyExists()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Cart with ID "572cda51902b5b517c0e1a2b2fd004b4" already exists.');
+
$predefinedCartId = '572cda51902b5b517c0e1a2b2fd004b4';
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Cart ID length should to be 32 symbols.');
+
$predefinedCartId = '572';
$query = <<quoteCollectionFactory->create();
foreach ($quoteCollection as $quote) {
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailablePaymentMethodsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailablePaymentMethodsTest.php
index 9baa3543b6a3b..c931e1e6fcf71 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailablePaymentMethodsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailablePaymentMethodsTest.php
@@ -30,7 +30,7 @@ class GetAvailablePaymentMethodsTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -119,11 +119,12 @@ public function testGetAvailablePaymentMethodsIfPaymentsAreNotPresent()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetAvailablePaymentMethodsOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailableShippingMethodsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailableShippingMethodsTest.php
index ded3caa0d812c..e7b62f85a5d85 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailableShippingMethodsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailableShippingMethodsTest.php
@@ -30,7 +30,7 @@ class GetAvailableShippingMethodsTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -191,11 +191,12 @@ public function testGetAvailableShippingMethodsIfShippingMethodsAreNotPresent()
* Test case: get available shipping methods from non-existent cart
*
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetAvailableShippingMethodsOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartEmailTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartEmailTest.php
index 951fe08db5e3d..56d560299e39c 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartEmailTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartEmailTest.php
@@ -27,7 +27,7 @@ class GetCartEmailTest extends GraphQlAbstract
*/
private $customerTokenService;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -52,11 +52,12 @@ public function testGetCartEmail()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetCartEmailFromNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartIsVirtualTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartIsVirtualTest.php
index cf72435a123bf..4bfd524b358ae 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartIsVirtualTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartIsVirtualTest.php
@@ -27,7 +27,7 @@ class GetCartIsVirtualTest extends GraphQlAbstract
*/
private $customerTokenService;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartTest.php
index 90ee6caec6797..ec5b3e92f8283 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartTest.php
@@ -40,7 +40,7 @@ class GetCartTest extends GraphQlAbstract
*/
private $customerRegistry;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -113,11 +113,12 @@ public function testGetAnotherCustomerCart()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testGetCartIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$maskedQuoteId = '';
$query = $this->getQuery($maskedQuoteId);
@@ -126,11 +127,12 @@ public function testGetCartIfCartIdIsEmpty()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException Exception
- * @expectedExceptionMessage Field "cart" argument "cart_id" of type "String!" is required but not provided.
*/
public function testGetCartIfCartIdIsMissed()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Field "cart" argument "cart_id" of type "String!" is required but not provided.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
@@ -161,11 +164,12 @@ public function testGetNonExistentCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/make_cart_inactive.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The cart isn't active.
*/
public function testGetInactiveCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The cart isn\'t active.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
@@ -193,12 +197,12 @@ public function testGetCartWithNotDefaultStore()
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
* @magentoApiDataFixture Magento/Store/_files/second_store.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The account sign-in was incorrect or your account is disabled temporarily.
- * Please wait and try again later.
*/
public function testGetCartWithWrongStore()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
$query = $this->getQuery($maskedQuoteId);
@@ -211,11 +215,12 @@ public function testGetCartWithWrongStore()
/**
* @magentoApiDataFixture Magento/Checkout/_files/active_quote_customer_not_default_store.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Requested store is not found
*/
public function testGetCartWithNotExistingStore()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Requested store is not found');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1_not_default_store');
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCustomerCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCustomerCartTest.php
index 6ee9bcc516172..ea17e54ea4119 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCustomerCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCustomerCartTest.php
@@ -35,7 +35,7 @@ class GetCustomerCartTest extends GraphQlAbstract
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $this->objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -45,7 +45,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
/** @var \Magento\Quote\Model\Quote $quote */
$quoteCollection = $this->objectManager->create(Collection::class);
@@ -123,11 +123,12 @@ public function testGetNewCustomerCart()
/**
* Query for customer cart with no customer token passed
*
- * @expectedException Exception
- * @expectedExceptionMessage The request is allowed for logged in customer
*/
public function testGetCustomerCartWithNoCustomerToken()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The request is allowed for logged in customer');
+
$customerCartQuery = $this->getCustomerCartQuery();
$this->graphQlQuery($customerCartQuery);
}
@@ -136,11 +137,12 @@ public function testGetCustomerCartWithNoCustomerToken()
* Query for customer cart after customer token is revoked
*
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage The request is allowed for logged in customer
*/
public function testGetCustomerCartAfterTokenRevoked()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The request is allowed for logged in customer');
+
$customerCartQuery = $this->getCustomerCartQuery();
$headers = $this->getHeaderMap();
$response = $this->graphQlMutation($customerCartQuery, [], '', $headers);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedPaymentMethodTest.php
index cd96e3af6f012..7e11257e6b29d 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedPaymentMethodTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedPaymentMethodTest.php
@@ -78,10 +78,11 @@ public function testGetSelectedPaymentMethodBeforeSet()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
*/
public function testGetSelectedPaymentMethodFromNonExistentCart()
{
+ $this->expectException(\Exception::class);
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
@@ -134,7 +135,7 @@ public function testGetSelectedPaymentMethodFromAnotherCustomerCart()
$this->graphQlQuery($query, [], '', $this->getHeaderMap('customer3@search.example.com'));
}
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedShippingMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedShippingMethodTest.php
index f5700d27fea7a..590290ffc4e9d 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedShippingMethodTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedShippingMethodTest.php
@@ -30,7 +30,7 @@ class GetSelectedShippingMethodTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -169,11 +169,12 @@ public function testGetGetSelectedShippingMethodIfShippingMethodIsNotSet()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetGetSelectedShippingMethodOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedBillingAddressTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedBillingAddressTest.php
index e5353fc841c5d..64ae89447ae34 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedBillingAddressTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedBillingAddressTest.php
@@ -30,7 +30,7 @@ class GetSpecifiedBillingAddressTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -96,11 +96,12 @@ public function testGetSpecifiedBillingAddressIfBillingAddressIsNotSet()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetSpecifiedBillingAddressOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedShippingAddressTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedShippingAddressTest.php
index 2023603a21eed..14ecc1511bd4e 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedShippingAddressTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedShippingAddressTest.php
@@ -30,7 +30,7 @@ class GetSpecifiedShippingAddressTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -97,11 +97,12 @@ public function testGetSpecifiedShippingAddressIfShippingAddressIsNotSet()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetSpecifiedShippingAddressOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/MergeCartsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/MergeCartsTest.php
index 695857f781b23..65e91bf193020 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/MergeCartsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/MergeCartsTest.php
@@ -39,7 +39,7 @@ class MergeCartsTest extends GraphQlAbstract
*/
private $customerTokenService;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->quoteResource = $objectManager->get(QuoteResource::class);
@@ -48,7 +48,7 @@ protected function setUp()
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$quote = $this->quoteFactory->create();
$this->quoteResource->load($quote, '1', 'customer_id');
@@ -107,11 +107,12 @@ public function testMergeGuestWithCustomerCart()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage The cart isn't active.
*/
public function testGuestCartExpiryAfterMerge()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The cart isn\'t active.');
+
$customerQuote = $this->quoteFactory->create();
$this->quoteResource->load($customerQuote, 'test_quote', 'reserved_order_id');
@@ -140,11 +141,12 @@ public function testGuestCartExpiryAfterMerge()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage The current user cannot perform operations on cart
*/
public function testMergeTwoCustomerCarts()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current user cannot perform operations on cart');
+
$firstQuote = $this->quoteFactory->create();
$this->quoteResource->load($firstQuote, 'test_quote', 'reserved_order_id');
$firstMaskedId = $this->quoteIdToMaskedId->execute((int)$firstQuote->getId());
@@ -168,11 +170,12 @@ public function testMergeTwoCustomerCarts()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage Required parameter "source_cart_id" is missing
*/
public function testMergeCartsWithEmptySourceCartId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "source_cart_id" is missing');
+
$customerQuote = $this->quoteFactory->create();
$this->quoteResource->load($customerQuote, 'test_quote', 'reserved_order_id');
@@ -186,11 +189,12 @@ public function testMergeCartsWithEmptySourceCartId()
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_virtual_product_saved.php
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Required parameter "destination_cart_id" is missing
*/
public function testMergeCartsWithEmptyDestinationCartId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "destination_cart_id" is missing');
+
$guestQuote = $this->quoteFactory->create();
$this->quoteResource->load(
$guestQuote,
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php
index 11dc10beb72e2..127edb84a4190 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php
@@ -49,7 +49,7 @@ class PlaceOrderTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -91,11 +91,12 @@ public function testPlaceOrder()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testPlaceOrderIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$maskedQuoteId = '';
$query = $this->getQuery($maskedQuoteId);
@@ -173,7 +174,7 @@ public function testPlaceOrderWithNoBillingAddress()
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
$query = $this->getQuery($maskedQuoteId);
- self::expectExceptionMessageRegExp(
+ self::expectExceptionMessageMatches(
'/Unable to place order: Please check the billing address information*/'
);
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
@@ -248,7 +249,7 @@ public function testPlaceOrderOfGuestCart()
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
$query = $this->getQuery($maskedQuoteId);
- self::expectExceptionMessageRegExp('/The current user cannot perform operations on cart*/');
+ self::expectExceptionMessageMatches('/The current user cannot perform operations on cart*/');
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
}
@@ -276,7 +277,7 @@ public function testPlaceOrderOfAnotherCustomerCart()
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
$query = $this->getQuery($maskedQuoteId);
- self::expectExceptionMessageRegExp('/The current user cannot perform operations on cart*/');
+ self::expectExceptionMessageMatches('/The current user cannot perform operations on cart*/');
$this->graphQlMutation($query, [], '', $this->getHeaderMap('customer3@search.example.com'));
}
@@ -313,7 +314,7 @@ private function getHeaderMap(string $username = 'customer@example.com', string
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->registry->unregister('isSecureArea');
$this->registry->register('isSecureArea', true);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php
index 1b5a308b5a9a8..2e066fa39c3d7 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveCouponFromCartTest.php
@@ -31,7 +31,7 @@ class RemoveCouponFromCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -54,16 +54,17 @@ public function testRemoveCouponFromCart()
$response = $this->graphQlMutation($query, [], '', $this->getHeaderMap());
self::assertArrayHasKey('removeCouponFromCart', $response);
- self::assertNull($response['removeCouponFromCart']['cart']['applied_coupon']['code']);
+ self::assertNull($response['removeCouponFromCart']['cart']['applied_coupon']);
}
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testRemoveCouponFromCartIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$maskedQuoteId = '';
$query = $this->getQuery($maskedQuoteId);
@@ -72,11 +73,12 @@ public function testRemoveCouponFromCartIfCartIdIsEmpty()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testRemoveCouponFromNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
@@ -86,11 +88,12 @@ public function testRemoveCouponFromNonExistentCart()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
- * @expectedException Exception
- * @expectedExceptionMessage Cart does not contain products
*/
public function testRemoveCouponFromEmptyCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Cart does not contain products');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
@@ -111,7 +114,7 @@ public function testRemoveCouponFromCartIfCouponWasNotSet()
$response = $this->graphQlMutation($query, [], '', $this->getHeaderMap());
self::assertArrayHasKey('removeCouponFromCart', $response);
- self::assertNull($response['removeCouponFromCart']['cart']['applied_coupon']['code']);
+ self::assertNull($response['removeCouponFromCart']['cart']['applied_coupon']);
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php
index 806cd08415ac1..2f64d0898c301 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/RemoveItemFromCartTest.php
@@ -33,7 +33,7 @@ class RemoveItemFromCartTest extends GraphQlAbstract
*/
private $getQuoteItemIdByReservedQuoteIdAndSku;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
@@ -64,11 +64,12 @@ public function testRemoveItemFromCart()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testRemoveItemFromNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$query = $this->getQuery('non_existent_masked_id', 1);
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php
index b7376e91f705e..8fd1ef6dfde8e 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php
@@ -61,7 +61,7 @@ class SetBillingAddressOnCartTest extends GraphQlAbstract
*/
private $customerRepository;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -318,11 +318,12 @@ public function testVerifyBillingAddressType()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a address with ID "100"
*/
public function testSetNotExistedBillingAddressFromAddressBook()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a address with ID "100"');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Current customer does not have permission to address with ID "1"');
+
$maskedQuoteId = $this->assignQuoteToCustomer('test_order_with_simple_product_without_address', 2);
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = <<getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -38,11 +38,12 @@ protected function setUp()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage The request is not allowed for logged in customers
*/
public function testSetGuestEmailOnCartForLoggedInCustomer()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The request is not allowed for logged in customers');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$email = 'some@user.com';
@@ -55,11 +56,12 @@ public function testSetGuestEmailOnCartForLoggedInCustomer()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage The request is not allowed for logged in customers
*/
public function testSetGuestEmailOnGuestCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The request is not allowed for logged in customers');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$email = 'some@user.com';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflinePaymentMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflinePaymentMethodsOnCartTest.php
index dbd6bb90f9a03..7d22496924ebd 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflinePaymentMethodsOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflinePaymentMethodsOnCartTest.php
@@ -34,7 +34,7 @@ class SetOfflinePaymentMethodsOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php
index fa8a7da092f5e..994a837dbdcc1 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php
@@ -30,7 +30,7 @@ class SetOfflineShippingMethodsOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php
index b31ce8a7302a9..21a8d6ae94312 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodAndPlaceOrderTest.php
@@ -51,7 +51,7 @@ class SetPaymentMethodAndPlaceOrderTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -148,11 +148,12 @@ public function dataProviderSetPaymentOnCartWithException(): array
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The shipping address is missing. Set the address and try again.
*/
public function testSetPaymentOnCartWithSimpleProductAndWithoutAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The shipping address is missing. Set the address and try again.');
+
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -192,11 +193,12 @@ public function testSetPaymentOnCartWithVirtualProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetNonExistentPaymentMethod()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = 'noway';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -207,11 +209,12 @@ public function testSetNonExistentPaymentMethod()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testSetPaymentOnNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
@@ -265,11 +268,12 @@ public function testSetPaymentMethodToAnotherCustomerCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetDisabledPaymentOnCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -330,7 +334,7 @@ private function getHeaderMap(string $username = 'customer@example.com', string
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->registry->unregister('isSecureArea');
$this->registry->register('isSecureArea', true);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php
index fa3cbb5a9b457..1f6f5c1c3c581 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php
@@ -34,7 +34,7 @@ class SetPaymentMethodOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -68,11 +68,12 @@ public function testSetPaymentOnCartWithSimpleProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The shipping address is missing. Set the address and try again.
*/
public function testSetPaymentOnCartWithSimpleProductAndWithoutAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The shipping address is missing. Set the address and try again.');
+
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -107,11 +108,12 @@ public function testSetPaymentOnCartWithVirtualProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetNonExistentPaymentMethod()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = 'noway';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -122,11 +124,12 @@ public function testSetNonExistentPaymentMethod()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testSetPaymentOnNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
@@ -215,11 +218,12 @@ public function testSetPaymentMethodWithoutRequiredParameters(string $input, str
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetDisabledPaymentOnCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPurchaseOrderPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPurchaseOrderPaymentMethodOnCartTest.php
index 1e64679b4abd8..1777289afe5bc 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPurchaseOrderPaymentMethodOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPurchaseOrderPaymentMethodOnCartTest.php
@@ -32,7 +32,7 @@ class SetPurchaseOrderPaymentMethodOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -97,11 +97,12 @@ public function testSetPurchaseOrderPaymentMethodOnCartWithSimpleProduct()
* @magentoConfigFixture default_store payment/checkmo/active 1
* @magentoConfigFixture default_store payment/purchaseorder/active 1
*
- * @expectedException Exception
- * @expectedExceptionMessage Purchase order number is a required field.
*/
public function testSetPurchaseOrderPaymentMethodOnCartWithoutPurchaseOrderNumber()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Purchase order number is a required field.');
+
$methodCode = Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -131,11 +132,12 @@ public function testSetPurchaseOrderPaymentMethodOnCartWithoutPurchaseOrderNumbe
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetDisabledPurchaseOrderPaymentMethodOnCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
$purchaseOrderNumber = '123456';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php
index 9256c1c41b49f..bcc46fec9a659 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php
@@ -63,7 +63,7 @@ class SetShippingAddressOnCartTest extends GraphQlAbstract
*/
private $customerRepository;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->quoteResource = $objectManager->get(QuoteResource::class);
@@ -144,11 +144,12 @@ public function testSetNewShippingAddressOnCartWithSimpleProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_virtual_product.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage The Cart includes virtual product(s) only, so a shipping address is not used.
*/
public function testSetNewShippingAddressOnCartWithVirtualProduct()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The Cart includes virtual product(s) only, so a shipping address is not used.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a address with ID "100"');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Current customer does not have permission to address with ID "1"');
+
$maskedQuoteId = $this->assignQuoteToCustomer('test_order_with_simple_product_without_address', 2);
$query = <<expectException(\Exception::class);
+
$maskedQuoteId = $this->assignQuoteToCustomer('test_order_with_simple_product_without_address', 1);
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Field CartAddressInput.street of required type [String]! was not provided.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('You cannot specify multiple shipping addresses.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = <<getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -238,11 +238,12 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
- * @expectedException Exception
- * @expectedExceptionMessage You cannot specify multiple shipping methods.
*/
public function testSetMultipleShippingMethods()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('You cannot specify multiple shipping methods.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$carrierCode = 'flatrate';
$methodCode = 'flatrate';
@@ -308,10 +310,11 @@ public function testSetShippingMethodToGuestCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException Exception
*/
public function testSetShippingMethodToAnotherCustomerCart()
{
+ $this->expectException(\Exception::class);
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$carrierCode = 'flatrate';
$methodCode = 'flatrate';
@@ -378,11 +381,12 @@ private function getQuery(
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The shipping method can't be set for an empty cart. Add an item to cart and try again.
*/
public function testSetShippingMethodOnAnEmptyCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The shipping method can\'t be set for an empty cart. Add an item to cart and try again.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$carrierCode = 'flatrate';
$methodCode = 'flatrate';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php
index b351872a69bc7..de0b04f08c270 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/UpdateCartItemsTest.php
@@ -45,7 +45,7 @@ class UpdateCartItemsTest extends GraphQlAbstract
*/
private $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->quoteResource = $objectManager->get(QuoteResource::class);
@@ -102,11 +102,12 @@ public function testRemoveCartItemIfQuantityIsZero()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testUpdateItemInNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$query = $this->getQuery('non_existent_masked_id', 1, 2);
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php
index d1edf742931c3..d51e632035dfc 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/EditQuoteItemWithCustomOptionsTest.php
@@ -49,7 +49,7 @@ class EditQuoteItemWithCustomOptionsTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTotalQuantityTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTotalQuantityTest.php
index aa7cb16ec1296..3620494073c1c 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTotalQuantityTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTotalQuantityTest.php
@@ -20,7 +20,7 @@ class GetCartTotalQuantityTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php
index 3ee27acfa2418..d67aa5430e436 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php
@@ -27,7 +27,7 @@ class AddSimpleProductToCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -133,11 +133,12 @@ public function testAddOutOfStockProductToCart(): void
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testAddSimpleProductToCartIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_items" is missing');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$sku = 'simple_product';
$quantity = 1;
$maskedQuoteId = 'non_existent_masked_id';
@@ -203,11 +206,12 @@ public function testAddProductToNonExistentCart()
/**
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a product with SKU "simple_product"
*/
public function testNonExistentProductToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a product with SKU "simple_product"');
+
$sku = 'simple_product';
$quantity = 1;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php
index 3811a60ffc522..ca5ab27904987 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddVirtualProductToCartTest.php
@@ -25,7 +25,7 @@ class AddVirtualProductToCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -52,11 +52,12 @@ public function testAddVirtualProductToCart()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testAddVirtualProductToCartIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_items" is missing');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$sku = 'virtual_product';
$quantity = 1;
$maskedQuoteId = 'non_existent_masked_id';
@@ -122,11 +125,12 @@ public function testAddVirtualToNonExistentCart()
/**
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a product with SKU "virtual_product"
*/
public function testNonExistentProductToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a product with SKU "virtual_product"');
+
$sku = 'virtual_product';
$quantity = 1;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AllowGuestCheckoutOptionTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AllowGuestCheckoutOptionTest.php
index f67638015988b..dc91758397ad6 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AllowGuestCheckoutOptionTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AllowGuestCheckoutOptionTest.php
@@ -49,7 +49,7 @@ class AllowGuestCheckoutOptionTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -85,11 +85,12 @@ public function testCreateEmptyCartIfGuestCheckoutIsDisabled()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoConfigFixture default_store checkout/options/guest_checkout 0
*
- * @expectedException \Exception
- * @expectedExceptionMessage Guest checkout is not allowed. Register a customer account or login with existing one.
*/
public function testSetBillingAddressToGuestCustomerCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Guest checkout is not allowed. Register a customer account or login with existing one.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Guest checkout is not allowed. Register a customer account or login with existing one.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$email = 'some@user.com';
@@ -158,11 +160,12 @@ public function testSetGuestEmailOnCartWithGuestCheckoutDisabled()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
* @magentoConfigFixture default_store checkout/options/guest_checkout 0
*
- * @expectedException \Exception
- * @expectedExceptionMessage Guest checkout is not allowed. Register a customer account or login with existing one.
*/
public function testSetPaymentOnCartWithGuestCheckoutDisabled()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Guest checkout is not allowed. Register a customer account or login with existing one.');
+
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -196,11 +199,12 @@ public function testSetPaymentOnCartWithGuestCheckoutDisabled()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoConfigFixture default_store checkout/options/guest_checkout 0
*
- * @expectedException \Exception
- * @expectedExceptionMessage Guest checkout is not allowed. Register a customer account or login with existing one.
*/
public function testSetNewShippingAddressOnCartWithGuestCheckoutDisabled()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Guest checkout is not allowed. Register a customer account or login with existing one.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Guest checkout is not allowed. Register a customer account or login with existing one.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$carrierCode = 'flatrate';
$methodCode = 'flatrate';
@@ -293,11 +298,12 @@ public function testSetShippingMethodOnCartWithGuestCheckoutDisabled()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php
* @magentoConfigFixture default_store checkout/options/guest_checkout 0
*
- * @expectedException \Exception
- * @expectedExceptionMessage Guest checkout is not allowed. Register a customer account or login with existing one.
*/
public function testPlaceOrderWithGuestCheckoutDisabled()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Guest checkout is not allowed. Register a customer account or login with existing one.');
+
$reservedOrderId = 'test_quote';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
@@ -325,7 +331,7 @@ private function getQuery(string $maskedQuoteId): string
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->registry->unregister('isSecureArea');
$this->registry->register('isSecureArea', true);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php
index 454f01b5cde19..c8d44c3baed3b 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponToCartTest.php
@@ -21,7 +21,7 @@ class ApplyCouponToCartTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -51,11 +51,12 @@ public function testApplyCouponToCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
- * @expectedException \Exception
- * @expectedExceptionMessage A coupon is already applied to the cart. Please remove it to apply another
*/
public function testApplyCouponTwice()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('A coupon is already applied to the cart. Please remove it to apply another');
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -71,11 +72,12 @@ public function testApplyCouponTwice()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
- * @expectedException \Exception
- * @expectedExceptionMessage Cart does not contain products.
*/
public function testApplyCouponToCartWithoutItems()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Cart does not contain products.');
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -88,10 +90,11 @@ public function testApplyCouponToCartWithoutItems()
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
- * @expectedException \Exception
*/
public function testApplyCouponToCustomerCart()
{
+ $this->expectException(\Exception::class);
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -104,11 +107,12 @@ public function testApplyCouponToCustomerCart()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage The coupon code isn't valid. Verify the code and try again.
*/
public function testApplyNonExistentCouponToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The coupon code isn\'t valid. Verify the code and try again.');
+
$couponCode = 'non_existent_coupon_code';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -118,10 +122,11 @@ public function testApplyNonExistentCouponToCart()
/**
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
- * @expectedException \Exception
*/
public function testApplyCouponToNonExistentCart()
{
+ $this->expectException(\Exception::class);
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -138,11 +143,12 @@ public function testApplyCouponToNonExistentCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/restrict_coupon_usage_for_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage The coupon code isn't valid. Verify the code and try again.
*/
public function testApplyCouponWhichIsNotApplicable()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The coupon code isn\'t valid. Verify the code and try again.');
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php
index 0344e274d6fbc..d33d0ee0569cd 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/ApplyCouponsToCartTest.php
@@ -21,7 +21,7 @@ class ApplyCouponsToCartTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -48,11 +48,12 @@ public function testApplyCouponsToCart()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
- * @expectedException \Exception
- * @expectedExceptionMessage Cart does not contain products.
*/
public function testApplyCouponsToCartWithoutItems()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Cart does not contain products.');
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -65,10 +66,11 @@ public function testApplyCouponsToCartWithoutItems()
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
- * @expectedException \Exception
*/
public function testApplyCouponsToCustomerCart()
{
+ $this->expectException(\Exception::class);
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -81,11 +83,12 @@ public function testApplyCouponsToCustomerCart()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage The coupon code isn't valid. Verify the code and try again.
*/
public function testApplyNonExistentCouponToCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The coupon code isn\'t valid. Verify the code and try again.');
+
$couponCode = 'non_existent_coupon_code';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -95,10 +98,11 @@ public function testApplyNonExistentCouponToCart()
/**
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
- * @expectedException \Exception
*/
public function testApplyCouponsToNonExistentCart()
{
+ $this->expectException(\Exception::class);
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId, $couponCode);
@@ -115,11 +119,12 @@ public function testApplyCouponsToNonExistentCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/restrict_coupon_usage_for_simple_product.php
- * @expectedException \Exception
- * @expectedExceptionMessage The coupon code isn't valid. Verify the code and try again.
*/
public function testApplyCouponsWhichIsNotApplicable()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The coupon code isn\'t valid. Verify the code and try again.');
+
$couponCode = '2?ds5!2d';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $couponCode);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CartDiscountTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CartDiscountTest.php
index 4dc02c343d707..bbd6556a025f3 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CartDiscountTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CartDiscountTest.php
@@ -21,7 +21,7 @@ class CartDiscountTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -71,7 +71,7 @@ public function testGetDiscountInformationWithNoRulesApplied()
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
$response = $this->graphQlQuery($query);
- self::assertEquals(null, $response['cart']['prices']['discount']);
+ self::assertNull($response['cart']['prices']['discount']);
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CartTotalsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CartTotalsTest.php
index 135b61849c29a..ba59553ff4b93 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CartTotalsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CartTotalsTest.php
@@ -24,7 +24,7 @@ class CartTotalsTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CheckoutEndToEndTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CheckoutEndToEndTest.php
index 315c046148506..d65fb96a7f5b5 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CheckoutEndToEndTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CheckoutEndToEndTest.php
@@ -51,7 +51,7 @@ class CheckoutEndToEndTest extends GraphQlAbstract
*/
private $orderRepository;
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -396,7 +396,7 @@ private function placeOrder(string $cartId): void
self::assertNotEmpty($response['placeOrder']['order']['order_number']);
}
- public function tearDown()
+ protected function tearDown(): void
{
$this->deleteQuote();
$this->deleteOrder();
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CreateEmptyCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CreateEmptyCartTest.php
index 6ed91d21f0ae2..be183fe93815a 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CreateEmptyCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/CreateEmptyCartTest.php
@@ -39,7 +39,7 @@ class CreateEmptyCartTest extends GraphQlAbstract
*/
private $quoteIdMaskFactory;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->guestCartRepository = $objectManager->get(GuestCartRepositoryInterface::class);
@@ -108,11 +108,12 @@ public function testCreateEmptyCartWithPredefinedCartId()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage Cart with ID "572cda51902b5b517c0e1a2b2fd004b4" already exists.
*/
public function testCreateEmptyCartIfPredefinedCartIdAlreadyExists()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Cart with ID "572cda51902b5b517c0e1a2b2fd004b4" already exists.');
+
$predefinedCartId = '572cda51902b5b517c0e1a2b2fd004b4';
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Cart ID length should to be 32 symbols.');
+
$predefinedCartId = '572';
$query = <<quoteCollectionFactory->create();
foreach ($quoteCollection as $quote) {
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php
index 3634403e0b23c..5cd977aee6981 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php
@@ -24,7 +24,7 @@ class GetAvailablePaymentMethodsTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -89,11 +89,12 @@ public function testGetAvailablePaymentMethodsIfPaymentsAreNotPresent()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetAvailablePaymentMethodsOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
$this->graphQlQuery($query);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailableShippingMethodsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailableShippingMethodsTest.php
index 9a1eea82686e5..fcc8cc8d4046a 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailableShippingMethodsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailableShippingMethodsTest.php
@@ -24,7 +24,7 @@ class GetAvailableShippingMethodsTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -172,11 +172,12 @@ public function testGetAvailableShippingMethodsIfShippingMethodsAreNotPresent()
/**
* Test case: get available shipping methods from non-existent cart
*
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetAvailableShippingMethodsOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartEmailTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartEmailTest.php
index 8c6ecd075049f..f65f90c0c8e69 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartEmailTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartEmailTest.php
@@ -21,7 +21,7 @@ class GetCartEmailTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -44,11 +44,12 @@ public function testGetCartEmail()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetCartEmailFromNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartIsVirtualTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartIsVirtualTest.php
index 79fe2273184b2..2221c0722d623 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartIsVirtualTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartIsVirtualTest.php
@@ -21,7 +21,7 @@ class GetCartIsVirtualTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php
index 1b54e2f57017f..858c38cc72dfd 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetCartTest.php
@@ -22,7 +22,7 @@ class GetCartTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -74,11 +74,12 @@ public function testGetCustomerCart()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testGetCartIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$maskedQuoteId = '';
$query = $this->getQuery($maskedQuoteId);
@@ -86,11 +87,12 @@ public function testGetCartIfCartIdIsEmpty()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage Field "cart" argument "cart_id" of type "String!" is required but not provided.
*/
public function testGetCartIfCartIdIsMissed()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Field "cart" argument "cart_id" of type "String!" is required but not provided.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
@@ -118,11 +121,12 @@ public function testGetNonExistentCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/make_cart_inactive.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The cart isn't active.
*/
public function testGetInactiveCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The cart isn\'t active.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
@@ -148,11 +152,12 @@ public function testGetCartWithNotDefaultStore()
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
* @magentoApiDataFixture Magento/Store/_files/second_store.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Wrong store code specified for cart
*/
public function testGetCartWithWrongStore()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Wrong store code specified for cart');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
$query = $this->getQuery($maskedQuoteId);
@@ -164,11 +169,12 @@ public function testGetCartWithWrongStore()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Checkout/_files/active_quote_guest_not_default_store.php
*
- * @expectedException Exception
- * @expectedExceptionMessage Requested store is not found
*/
public function testGetCartWithNotExistingStore()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Requested store is not found');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1_not_default_store_guest');
$headerMap['Store'] = 'not_existing_store';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedPaymentMethodTest.php
index 7619212942812..b48e963167060 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedPaymentMethodTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedPaymentMethodTest.php
@@ -21,7 +21,7 @@ class GetSelectedPaymentMethodTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -76,10 +76,11 @@ public function testGetSelectedPaymentMethodBeforeSet()
}
/**
- * @expectedException \Exception
*/
public function testGetSelectedPaymentMethodFromNonExistentCart()
{
+ $this->expectException(\Exception::class);
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedShippingMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedShippingMethodTest.php
index a6e4a4afa9825..47fd37164de29 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedShippingMethodTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedShippingMethodTest.php
@@ -24,7 +24,7 @@ class GetSelectedShippingMethodTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -137,11 +137,12 @@ public function testGetGetSelectedShippingMethodIfShippingMethodIsNotSet()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetSelectedShippingMethodOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
$this->graphQlQuery($query);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSpecifiedBillingAddressTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSpecifiedBillingAddressTest.php
index cb1565879a81e..89ba2f8c2e330 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSpecifiedBillingAddressTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSpecifiedBillingAddressTest.php
@@ -24,7 +24,7 @@ class GetSpecifiedBillingAddressTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -85,11 +85,12 @@ public function testGetSpecifiedBillingAddressIfBillingAddressIsNotSet()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetBillingAddressOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
$this->graphQlQuery($query);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSpecifiedShippingAddressTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSpecifiedShippingAddressTest.php
index b5fa0d8f12dfc..4b99a28c7978b 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSpecifiedShippingAddressTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSpecifiedShippingAddressTest.php
@@ -24,7 +24,7 @@ class GetSpecifiedShippingAddressTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -86,11 +86,12 @@ public function testGetSpecifiedShippingAddressIfShippingAddressIsNotSet()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testGetShippingAddressOfNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
$this->graphQlQuery($query);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/MergeCartsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/MergeCartsTest.php
index e558ac41eae52..bd5f68c52d7dd 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/MergeCartsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/MergeCartsTest.php
@@ -33,7 +33,7 @@ class MergeCartsTest extends GraphQlAbstract
*/
private $quoteIdToMaskedId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->quoteResource = $objectManager->get(QuoteResource::class);
@@ -45,11 +45,12 @@ protected function setUp()
* @magentoApiDataFixture Magento/Checkout/_files/simple_product.php
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_virtual_product_saved.php
- * @expectedException \Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testMergeGuestCarts()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$firstQuote = $this->quoteFactory->create();
$this->quoteResource->load($firstQuote, 'test_order_with_simple_product_without_address', 'reserved_order_id');
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php
index 4879ff39b709e..00b960d66cfc6 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php
@@ -43,7 +43,7 @@ class PlaceOrderTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -83,11 +83,12 @@ public function testPlaceOrder()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testPlaceOrderIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$maskedQuoteId = '';
$query = $this->getQuery($maskedQuoteId);
@@ -110,11 +111,12 @@ public function testPlaceOrderIfCartIdIsEmpty()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage Guest email for cart is missing.
*/
public function testPlaceOrderWithNoEmail()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Guest email for cart is missing.');
+
$reservedOrderId = 'test_quote';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
$query = $this->getQuery($maskedQuoteId);
@@ -193,7 +195,7 @@ public function testPlaceOrderWithNoBillingAddress()
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
$query = $this->getQuery($maskedQuoteId);
- self::expectExceptionMessageRegExp(
+ self::expectExceptionMessageMatches(
'/Unable to place order: Please check the billing address information*/'
);
$this->graphQlMutation($query);
@@ -268,7 +270,7 @@ public function testPlaceOrderOfCustomerCart()
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
$query = $this->getQuery($maskedQuoteId);
- self::expectExceptionMessageRegExp('/The current user cannot perform operations on cart*/');
+ self::expectExceptionMessageMatches('/The current user cannot perform operations on cart*/');
$this->graphQlMutation($query);
}
@@ -292,7 +294,7 @@ private function getQuery(string $maskedQuoteId): string
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->registry->unregister('isSecureArea');
$this->registry->register('isSecureArea', true);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php
index e94a70cbd929f..e51909b8346c2 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveCouponFromCartTest.php
@@ -25,7 +25,7 @@ class RemoveCouponFromCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -46,15 +46,16 @@ public function testRemoveCouponFromCart()
$response = $this->graphQlMutation($query);
self::assertArrayHasKey('removeCouponFromCart', $response);
- self::assertNull($response['removeCouponFromCart']['cart']['applied_coupon']['code']);
+ self::assertNull($response['removeCouponFromCart']['cart']['applied_coupon']);
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testRemoveCouponFromCartIfCartIdIsEmpty()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$maskedQuoteId = '';
$query = $this->getQuery($maskedQuoteId);
@@ -62,11 +63,12 @@ public function testRemoveCouponFromCartIfCartIdIsEmpty()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testRemoveCouponFromNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = $this->getQuery($maskedQuoteId);
@@ -75,11 +77,12 @@ public function testRemoveCouponFromNonExistentCart()
/**
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
- * @expectedException Exception
- * @expectedExceptionMessage Cart does not contain products
*/
public function testRemoveCouponFromEmptyCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Cart does not contain products');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId);
@@ -99,7 +102,7 @@ public function testRemoveCouponFromCartIfCouponWasNotSet()
$response = $this->graphQlMutation($query);
self::assertArrayHasKey('removeCouponFromCart', $response);
- self::assertNull($response['removeCouponFromCart']['cart']['applied_coupon']['code']);
+ self::assertNull($response['removeCouponFromCart']['cart']['applied_coupon']);
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php
index 7970e4b15bc32..f5f6d0bdea099 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/RemoveItemFromCartTest.php
@@ -27,7 +27,7 @@ class RemoveItemFromCartTest extends GraphQlAbstract
*/
private $getQuoteItemIdByReservedQuoteIdAndSku;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -55,11 +55,12 @@ public function testRemoveItemFromCart()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testRemoveItemFromNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$query = $this->getQuery('non_existent_masked_id', 1);
$this->graphQlMutation($query);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php
index ea77ad35d2693..d6780b311aff6 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php
@@ -21,7 +21,7 @@ class SetBillingAddressOnCartTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -230,11 +230,12 @@ public function testSetBillingAddressToCustomerCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testSetBillingAddressFromAddressBook()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = <<getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -91,11 +91,12 @@ public function incorrectEmailDataProvider(): array
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testSetGuestEmailOnNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$email = 'some@user.com';
@@ -104,11 +105,12 @@ public function testSetGuestEmailOnNonExistentCart()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Required parameter "cart_id" is missing
*/
public function testSetGuestEmailWithEmptyCartId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Required parameter "cart_id" is missing');
+
$maskedQuoteId = '';
$email = 'some@user.com';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflinePaymentMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflinePaymentMethodsOnCartTest.php
index 7a92ef8df201d..901aaf6fda609 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflinePaymentMethodsOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflinePaymentMethodsOnCartTest.php
@@ -28,7 +28,7 @@ class SetOfflinePaymentMethodsOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php
index 921335e9e2082..609e11cdb9857 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php
@@ -24,7 +24,7 @@ class SetOfflineShippingMethodsOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodAndPlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodAndPlaceOrderTest.php
index e506c7c784f3f..dbc10700794fa 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodAndPlaceOrderTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodAndPlaceOrderTest.php
@@ -45,7 +45,7 @@ class SetPaymentMethodAndPlaceOrderTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -82,11 +82,12 @@ public function testSetPaymentOnCartWithSimpleProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The shipping address is missing. Set the address and try again.
*/
public function testSetPaymentOnCartWithSimpleProductAndWithoutAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The shipping address is missing. Set the address and try again.');
+
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -121,11 +122,12 @@ public function testSetPaymentOnCartWithVirtualProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetNonExistentPaymentMethod()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = 'noway';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -134,11 +136,12 @@ public function testSetNonExistentPaymentMethod()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testSetPaymentOnNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
@@ -162,11 +165,12 @@ public function testSetPaymentOnNonExistentCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage Guest email for cart is missing.
*/
public function testPlaceOrderWithNoEmail()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Guest email for cart is missing.');
+
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = $this->getQuery($maskedQuoteId, $methodCode);
@@ -201,11 +205,12 @@ public function testSetPaymentMethodToCustomerCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetDisabledPaymentOnCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -241,7 +246,7 @@ private function getQuery(
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->registry->unregister('isSecureArea');
$this->registry->register('isSecureArea', true);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php
index 7c02589261a4a..c40a2b9426fe0 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php
@@ -28,7 +28,7 @@ class SetPaymentMethodOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -59,11 +59,12 @@ public function testSetPaymentOnCartWithSimpleProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The shipping address is missing. Set the address and try again.
*/
public function testSetPaymentOnCartWithSimpleProductAndWithoutAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The shipping address is missing. Set the address and try again.');
+
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -96,11 +97,12 @@ public function testSetPaymentOnCartWithVirtualProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetNonExistentPaymentMethod()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = 'noway';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -109,11 +111,12 @@ public function testSetNonExistentPaymentMethod()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testSetPaymentOnNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$methodCode = Checkmo::PAYMENT_METHOD_CHECKMO_CODE;
@@ -225,11 +228,12 @@ public function testReSetPayment()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetDisabledPaymentOnCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPurchaseOrderPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPurchaseOrderPaymentMethodOnCartTest.php
index 067c65fe85b6c..2c93a27012a01 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPurchaseOrderPaymentMethodOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPurchaseOrderPaymentMethodOnCartTest.php
@@ -26,7 +26,7 @@ class SetPurchaseOrderPaymentMethodOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -88,11 +88,12 @@ public function testSetPurchaseOrderPaymentMethodOnCartWithSimpleProduct()
* @magentoConfigFixture default_store payment/checkmo/active 1
* @magentoConfigFixture default_store payment/purchaseorder/active 1
*
- * @expectedException Exception
- * @expectedExceptionMessage Purchase order number is a required field.
*/
public function testSetPurchaseOrderPaymentMethodOnCartWithoutPurchaseOrderNumber()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Purchase order number is a required field.');
+
$methodCode = Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
@@ -121,11 +122,12 @@ public function testSetPurchaseOrderPaymentMethodOnCartWithoutPurchaseOrderNumbe
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetDisabledPurchaseOrderPaymentMethodOnCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+
$methodCode = Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
$purchaseOrderNumber = '123456';
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php
index 53a20b775530b..b4136d06bf67c 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php
@@ -21,7 +21,7 @@ class SetShippingAddressOnCartTest extends GraphQlAbstract
*/
private $getMaskedQuoteIdByReservedOrderId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -93,11 +93,12 @@ public function testSetNewShippingAddressOnCartWithSimpleProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_virtual_product.php
*
- * @expectedException \Exception
- * @expectedExceptionMessage The Cart includes virtual product(s) only, so a shipping address is not used.
*/
public function testSetNewShippingAddressOnCartWithVirtualProduct()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The Cart includes virtual product(s) only, so a shipping address is not used.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('You cannot specify multiple shipping addresses.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$maskedQuoteId = 'non_existent_masked_id';
$query = <<getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -89,11 +89,12 @@ public function testSetShippingMethodOnCartWithSimpleProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_virtual_product.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The shipping address is missing. Set the address and try again.
*/
public function testSetShippingMethodOnCartWithSimpleProductAndWithoutAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The shipping address is missing. Set the address and try again.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$carrierCode = 'flatrate';
$methodCode = 'flatrate';
@@ -243,11 +244,12 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
- * @expectedException Exception
- * @expectedExceptionMessage You cannot specify multiple shipping methods.
*/
public function testSetMultipleShippingMethods()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('You cannot specify multiple shipping methods.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$query = <<expectException(\Exception::class);
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$carrierCode = 'flatrate';
$methodCode = 'flatrate';
@@ -310,11 +313,12 @@ public function testSetShippingMethodToCustomerCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/quote_with_address.php
*
- * @expectedException Exception
- * @expectedExceptionMessage The shipping method can't be set for an empty cart. Add an item to cart and try again.
*/
public function testSetShippingMethodOnAnEmptyCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The shipping method can\'t be set for an empty cart. Add an item to cart and try again.');
+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
$carrierCode = 'flatrate';
$methodCode = 'flatrate';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php
index 761993d983db8..a17bc1aa3821a 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php
@@ -39,7 +39,7 @@ class UpdateCartItemsTest extends GraphQlAbstract
*/
private $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->quoteResource = $objectManager->get(QuoteResource::class);
@@ -114,11 +114,12 @@ public function testRemoveCartItemIfQuantityIsZero()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testUpdateItemInNonExistentCart()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Could not find a cart with ID "non_existent_masked_id"');
+
$query = $this->getQuery('non_existent_masked_id', 1, 2);
$this->graphQlMutation($query);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/RelatedProduct/GetRelatedProductsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/RelatedProduct/GetRelatedProductsTest.php
index dff1301e12f11..c2f94128ef8ec 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/RelatedProduct/GetRelatedProductsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/RelatedProduct/GetRelatedProductsTest.php
@@ -41,7 +41,7 @@ public function testQueryRelatedProducts()
self::assertArrayHasKey('products', $response);
self::assertArrayHasKey('items', $response['products']);
- self::assertEquals(1, count($response['products']['items']));
+ self::assertCount(1, $response['products']['items']);
self::assertArrayHasKey(0, $response['products']['items']);
self::assertArrayHasKey('related_products', $response['products']['items'][0]);
$relatedProducts = $response['products']['items'][0]['related_products'];
@@ -76,7 +76,7 @@ public function testQueryCrossSellProducts()
self::assertArrayHasKey('products', $response);
self::assertArrayHasKey('items', $response['products']);
- self::assertEquals(1, count($response['products']['items']));
+ self::assertCount(1, $response['products']['items']);
self::assertArrayHasKey(0, $response['products']['items']);
self::assertArrayHasKey('crosssell_products', $response['products']['items'][0]);
$crossSellProducts = $response['products']['items'][0]['crosssell_products'];
@@ -119,7 +119,7 @@ public function testQueryUpSellProducts()
self::assertArrayHasKey('products', $response);
self::assertArrayHasKey('items', $response['products']);
- self::assertEquals(1, count($response['products']['items']));
+ self::assertCount(1, $response['products']['items']);
self::assertArrayHasKey(0, $response['products']['items']);
self::assertArrayHasKey('upsell_products', $response['products']['items'][0]);
$upSellProducts = $response['products']['items'][0]['upsell_products'];
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/OrdersTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/OrdersTest.php
index 5d1f5847e8419..f6406dee2a468 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/OrdersTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/OrdersTest.php
@@ -22,7 +22,7 @@ class OrdersTest extends GraphQlAbstract
*/
private $customerTokenService;
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class);
@@ -101,11 +101,12 @@ public function testOrdersQuery()
}
/**
- * @expectedException Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testOrdersQueryNotAuthorized()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$query = <<customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderMultipleProductsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderMultipleProductsTest.php
index 0dec95ed44c51..98340a0cb0463 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderMultipleProductsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderMultipleProductsTest.php
@@ -41,7 +41,7 @@ class ReorderMultipleProductsTest extends GraphQlAbstract
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderOverlayProductTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderOverlayProductTest.php
index 53c6bd4cfb212..4abd8cb5cd8d6 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderOverlayProductTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderOverlayProductTest.php
@@ -41,7 +41,7 @@ class ReorderOverlayProductTest extends GraphQlAbstract
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderTest.php
index 1a2fa55126267..7bece410a06f8 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderTest.php
@@ -42,7 +42,7 @@ class ReorderTest extends GraphQlAbstract
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class);
@@ -85,11 +85,12 @@ public function testReorderMutation()
/**
* @magentoApiDataFixture Magento/Sales/_files/customer_order_item_with_product_and_custom_options.php
- * @expectedException \Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testReorderWithoutAuthorisedCustomer()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$query = $this->getQuery(self::ORDER_NUMBER);
$this->graphQlMutation($query);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/SendFriend/SendFriendTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/SendFriend/SendFriendTest.php
index 93001dd396cdc..337068710c31b 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/SendFriend/SendFriendTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/SendFriend/SendFriendTest.php
@@ -36,7 +36,7 @@ class SendFriendTest extends GraphQlAbstract
*/
private $customerTokenService;
- protected function setUp()
+ protected function setUp(): void
{
$this->sendFriendFactory = Bootstrap::getObjectManager()->get(SendFriendFactory::class);
$this->productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
@@ -69,11 +69,12 @@ public function testSendFriendGuestEnable()
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoConfigFixture default_store sendfriend/email/enabled 1
* @magentoConfigFixture default_store sendfriend/email/allow_guest 0
- * @expectedException \Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testSendFriendGuestDisableAsGuest()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$productId = (int)$this->productRepository->get('simple_product')->getId();
$recipients = '{
name: "Recipient Name 1"
@@ -93,11 +94,12 @@ public function testSendFriendGuestDisableAsGuest()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoConfigFixture default_store sendfriend/email/enabled 0
- * @expectedException \Exception
- * @expectedExceptionMessage "Email to a Friend" is not enabled.
*/
public function testSendFriendDisableAsCustomer()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('"Email to a Friend" is not enabled.');
+
$productId = (int)$this->productRepository->get('simple_product')->getId();
$recipients = '{
name: "Recipient Name 1"
@@ -116,11 +118,12 @@ public function testSendFriendDisableAsCustomer()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoConfigFixture default_store sendfriend/email/enabled 1
- * @expectedException \Exception
- * @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
*/
public function testSendWithoutExistProduct()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The product that was requested doesn\'t exist. Verify the product and try again.');
+
$productId = 2018;
$recipients = '{
name: "Recipient Name 1"
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php
index 076c7bece5ff7..48619d1392309 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php
@@ -23,7 +23,7 @@ class StoreConfigResolverTest extends GraphQlAbstract
/** @var ObjectManager */
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSearchTest.php
index 8ba8b534cfe5c..21c392b69ca54 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSearchTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSearchTest.php
@@ -156,7 +156,7 @@ private function getExpectedFiltersDataSet()
private function assertFilters($response, $expectedFilters, $message = '')
{
$this->assertArrayHasKey('filters', $response['products'], 'Product has filters');
- $this->assertTrue(is_array(($response['products']['filters'])), 'Product filters is array');
+ $this->assertIsArray(($response['products']['filters']), 'Product filters is array');
$this->assertTrue(count($response['products']['filters']) > 0, 'Product filters is not empty');
foreach ($expectedFilters as $expectedFilter) {
$found = false;
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php
index c356012c71f47..1514613987b40 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Swatches/ProductSwatchDataTest.php
@@ -25,7 +25,7 @@ class ProductSwatchDataTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->swatchMediaHelper = $objectManager->get(SwatchesMedia::class);
@@ -42,13 +42,13 @@ public function testTextSwatchDataValues()
{
products(filter: {sku: {eq: "$productSku"}}) {
items {
- ... on ConfigurableProduct{
+ ... on ConfigurableProduct{
configurable_options{
values {
swatch_data{
value
}
- }
+ }
}
}
}
@@ -86,7 +86,7 @@ public function testVisualSwatchDataValues()
{
products(filter: {sku: {eq: "$productSku"}}) {
items {
- ... on ConfigurableProduct{
+ ... on ConfigurableProduct{
configurable_options{
values {
swatch_data{
@@ -95,7 +95,7 @@ public function testVisualSwatchDataValues()
thumbnail
}
}
- }
+ }
}
}
}
@@ -115,7 +115,7 @@ public function testVisualSwatchDataValues()
$option = $product['configurable_options'][0];
$this->assertArrayHasKey('values', $option);
$this->assertEquals($color, $option['values'][0]['swatch_data']['value']);
- $this->assertContains(
+ $this->assertStringContainsString(
$option['values'][1]['swatch_data']['value'],
$this->swatchMediaHelper->getSwatchAttributeImage(Swatch::SWATCH_IMAGE_NAME, $imageName)
);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php
index 461b5673235dd..b2d25c7418866 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Tax/ProductViewTest.php
@@ -48,7 +48,7 @@ class ProductViewTest extends GraphQlAbstract
*/
private $storeManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
@@ -89,7 +89,7 @@ protected function setUp()
$scopeConfig->clean();
}
- public function tearDown()
+ protected function tearDown(): void
{
/** @var \Magento\Config\Model\ResourceModel\Config $config */
$config = $this->objectManager->get(\Magento\Config\Model\ResourceModel\Config::class);
@@ -209,7 +209,7 @@ public function testQueryAllFieldsSimpleProduct()
$product = $this->productRepository->get($productSku, false, null, true);
$this->assertArrayHasKey('products', $response);
$this->assertArrayHasKey('items', $response['products']);
- $this->assertEquals(1, count($response['products']['items']));
+ $this->assertCount(1, $response['products']['items']);
$this->assertArrayHasKey(0, $response['products']['items']);
$this->assertBaseFields($product, $response['products']['items'][0]);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php
index c85f63c083700..ab3fed044ea97 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php
@@ -36,11 +36,12 @@ public function testMutation()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Mutation requests allowed only for POST requests
*/
public function testMutationIsNotAllowedViaGetRequest()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Mutation requests allowed only for POST requests');
+
$id = 3;
$query = <<customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php
index 5e6415f82b25a..12aa4444ef728 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/UrlRewrite/UrlResolverTest.php
@@ -18,7 +18,7 @@ class UrlResolverTest extends GraphQlAbstract
/** @var ObjectManager */
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Usps/SetUspsShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Usps/SetUspsShippingMethodsOnCartTest.php
index 80e66370e0fef..eaa6cd9ada6a9 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Usps/SetUspsShippingMethodsOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Usps/SetUspsShippingMethodsOnCartTest.php
@@ -65,7 +65,7 @@ class SetUspsShippingMethodsOnCartTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/VariablesSupportQueryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/VariablesSupportQueryTest.php
index 3221026871bc8..05e1548e73e18 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/VariablesSupportQueryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/VariablesSupportQueryTest.php
@@ -18,7 +18,7 @@ class VariablesSupportQueryTest extends GraphQlAbstract
*/
private $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
}
@@ -70,7 +70,7 @@ public function testQueryObjectVariablesSupport()
self::assertArrayHasKey('products', $response);
self::assertArrayHasKey('items', $response['products']);
- self::assertEquals(1, count($response['products']['items']));
+ self::assertCount(1, $response['products']['items']);
self::assertArrayHasKey(0, $response['products']['items']);
self::assertEquals($product->getSku(), $response['products']['items'][0]['sku']);
self::assertEquals(
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Vault/CustomerPaymentTokensTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Vault/CustomerPaymentTokensTest.php
index 45c82906d255d..0643529a27b5a 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Vault/CustomerPaymentTokensTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Vault/CustomerPaymentTokensTest.php
@@ -39,7 +39,7 @@ class CustomerPaymentTokensTest extends GraphQlAbstract
*/
private $tokenResource;
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -49,7 +49,7 @@ protected function setUp()
$this->tokenCollectionFactory = Bootstrap::getObjectManager()->get(CollectionFactory::class);
}
- protected function tearDown()
+ protected function tearDown(): void
{
parent::tearDown();
@@ -84,7 +84,7 @@ public function testGetCustomerPaymentTokens()
QUERY;
$response = $this->graphQlQuery($query, [], '', $this->getCustomerAuthHeaders($currentEmail, $currentPassword));
- $this->assertEquals(2, count($response['customerPaymentTokens']['items']));
+ $this->assertCount(2, $response['customerPaymentTokens']['items']);
$this->assertArrayHasKey('public_hash', $response['customerPaymentTokens']['items'][0]);
$this->assertArrayHasKey('details', $response['customerPaymentTokens']['items'][0]);
$this->assertArrayHasKey('payment_method_code', $response['customerPaymentTokens']['items'][0]);
@@ -94,11 +94,12 @@ public function testGetCustomerPaymentTokens()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage GraphQL response contains errors: The current customer isn't authorized.
*/
public function testGetCustomerPaymentTokensIfUserIsNotAuthorized()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('GraphQL response contains errors: The current customer isn\'t authorized.');
+
$query = <<assertTrue($response['deletePaymentToken']['result']);
- $this->assertEquals(1, count($response['deletePaymentToken']['customerPaymentTokens']['items']));
+ $this->assertCount(1, $response['deletePaymentToken']['customerPaymentTokens']['items']);
$token = $response['deletePaymentToken']['customerPaymentTokens']['items'][0];
$this->assertArrayHasKey('public_hash', $token);
@@ -162,11 +163,12 @@ public function testDeletePaymentToken()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage GraphQL response contains errors: The current customer isn't authorized.
*/
public function testDeletePaymentTokenIfUserIsNotAuthorized()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('GraphQL response contains errors: The current customer isn\'t authorized.');
+
$query = <<expectException(\Exception::class);
+ $this->expectExceptionMessage('GraphQL response contains errors: Could not find a token using public hash: ksdfk392ks');
+
$currentEmail = 'customer@example.com';
$currentPassword = 'password';
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Weee/StoreConfigFPTTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Weee/StoreConfigFPTTest.php
index 451ea78ee308d..e513cf4606743 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Weee/StoreConfigFPTTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Weee/StoreConfigFPTTest.php
@@ -26,7 +26,7 @@ class StoreConfigFPTTest extends GraphQlAbstract
/**
* @inheritdoc
*/
- protected function setUp() :void
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistTest.php
index fbd9c53faf7f5..2208f904320d9 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistTest.php
@@ -25,7 +25,7 @@ class CustomerWishlistTest extends GraphQlAbstract
*/
private $wishlistCollectionFactory;
- protected function setUp()
+ protected function setUp(): void
{
$this->customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class);
$this->wishlistCollectionFactory = Bootstrap::getObjectManager()->get(CollectionFactory::class);
@@ -100,11 +100,12 @@ public function testCustomerAlwaysHasWishlist(): void
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The current customer isn't authorized.
*/
public function testGuestCannotGetWishlist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current customer isn\'t authorized.');
+
$query =
<<customerTokenService = Bootstrap::getObjectManager()->get(CustomerTokenServiceInterface::class);
$this->wishlistFactory = Bootstrap::getObjectManager()->get(WishlistFactory::class);
@@ -94,11 +94,12 @@ public function testGetCustomerWishlist(): void
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage The current user cannot perform operations on wishlist
*/
public function testGetGuestWishlist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The current user cannot perform operations on wishlist');
+
$query =
<<objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php
index 9b453af91d464..11e07d081636e 100644
--- a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkRepositoryTest.php
@@ -19,7 +19,7 @@ class ProductLinkRepositoryTest extends \Magento\TestFramework\TestCase\WebapiAb
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkTypeListTest.php b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkTypeListTest.php
index 15591cccd013d..0115da216292d 100644
--- a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkTypeListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductLinkTypeListTest.php
@@ -34,7 +34,7 @@ public function testGetItems()
* Validate that product type links provided by Magento_GroupedProduct module are present
*/
$expectedItems = ['name' => 'associated', 'code' => Link::LINK_TYPE_GROUPED];
- $this->assertContains($expectedItems, $actual);
+ $this->assertContainsEquals($expectedItems, $actual);
}
public function testGetItemAttributes()
diff --git a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductRepositoryInterfaceTest.php
index 8cccfbe1905a5..2696414f29ebb 100644
--- a/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductRepositoryInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductRepositoryInterfaceTest.php
@@ -152,7 +152,7 @@ public function testProductLinks()
$response = $this->getProduct("group_product_500");
$this->assertArrayHasKey('product_links', $response);
$links = $response['product_links'];
- $this->assertEquals(1, count($links));
+ $this->assertCount(1, $links);
$this->assertEquals($productLinkData, $links[0]);
// update link information for Group Product
@@ -178,7 +178,7 @@ public function testProductLinks()
$this->assertArrayHasKey('product_links', $response);
$links = $response['product_links'];
- $this->assertEquals(2, count($links));
+ $this->assertCount(2, $links);
$this->assertEquals($productLinkData1, $links[1]);
$this->assertEquals($productLinkData2, $links[0]);
diff --git a/dev/tests/api-functional/testsuite/Magento/Integration/Model/AdminTokenServiceTest.php b/dev/tests/api-functional/testsuite/Magento/Integration/Model/AdminTokenServiceTest.php
index 4b09361fe023b..a392520928183 100644
--- a/dev/tests/api-functional/testsuite/Magento/Integration/Model/AdminTokenServiceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Integration/Model/AdminTokenServiceTest.php
@@ -47,7 +47,7 @@ class AdminTokenServiceTest extends WebapiAbstract
/**
* Setup AdminTokenService
*/
- public function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly();
$this->tokenService = Bootstrap::getObjectManager()->get(\Magento\Integration\Model\AdminTokenService::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/Integration/Model/CustomerTokenServiceTest.php b/dev/tests/api-functional/testsuite/Magento/Integration/Model/CustomerTokenServiceTest.php
index 05e97a307fec1..91a044f189b4c 100644
--- a/dev/tests/api-functional/testsuite/Magento/Integration/Model/CustomerTokenServiceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Integration/Model/CustomerTokenServiceTest.php
@@ -56,7 +56,7 @@ class CustomerTokenServiceTest extends WebapiAbstract
/**
* Setup CustomerTokenService
*/
- public function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly();
$this->tokenService = Bootstrap::getObjectManager()->get(
diff --git a/dev/tests/api-functional/testsuite/Magento/Integration/Model/IntegrationTest.php b/dev/tests/api-functional/testsuite/Magento/Integration/Model/IntegrationTest.php
index f4ae31c74249b..489e7d2517527 100644
--- a/dev/tests/api-functional/testsuite/Magento/Integration/Model/IntegrationTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Integration/Model/IntegrationTest.php
@@ -13,7 +13,7 @@ class IntegrationTest extends \Magento\TestFramework\TestCase\WebapiAbstract
/** @var \Magento\Integration\Model\Integration */
protected $integration;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
/** @var $integrationService \Magento\Integration\Api\IntegrationServiceInterface */
@@ -29,7 +29,7 @@ protected function setUp()
parent::setUp();
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->integration = null;
OauthHelper::clearApiAccessCredentials();
diff --git a/dev/tests/api-functional/testsuite/Magento/LoginAsCustomerWebapi/Api/LoginAsCustomerWebapiCreateCustomerAccessTokenTest.php b/dev/tests/api-functional/testsuite/Magento/LoginAsCustomerWebapi/Api/LoginAsCustomerWebapiCreateCustomerAccessTokenTest.php
index caf639a678052..3c64d24d813a3 100644
--- a/dev/tests/api-functional/testsuite/Magento/LoginAsCustomerWebapi/Api/LoginAsCustomerWebapiCreateCustomerAccessTokenTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/LoginAsCustomerWebapi/Api/LoginAsCustomerWebapiCreateCustomerAccessTokenTest.php
@@ -30,7 +30,7 @@ class LoginAsCustomerWebapiCreateCustomerAccessTokenTest extends WebapiAbstract
/**
* @inheritdoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly();
$tokenCollectionFactory = Bootstrap::getObjectManager()->get(CollectionFactory::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/Multishipping/Api/CartRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Multishipping/Api/CartRepositoryTest.php
index 46844438fdd97..b45f8b6bd2596 100644
--- a/dev/tests/api-functional/testsuite/Magento/Multishipping/Api/CartRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Multishipping/Api/CartRepositoryTest.php
@@ -44,7 +44,7 @@ class CartRepositoryTest extends WebapiAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->filterBuilder = $this->objectManager->create(FilterBuilder::class);
@@ -55,7 +55,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
try {
/** @var CartRepositoryInterface $quoteRepository */
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/BillingAddressManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/BillingAddressManagementTest.php
index 65ae1e38ec700..c91735174652c 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/BillingAddressManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/BillingAddressManagementTest.php
@@ -20,7 +20,7 @@ class BillingAddressManagementTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php
index b52c4fb6f0b78..7900ae45e2f3d 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartAddingItemsTest.php
@@ -19,7 +19,7 @@ class CartAddingItemsTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartItemRepositoryTest.php
index 15e10196f878d..bf5421b5ca2be 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartItemRepositoryTest.php
@@ -22,7 +22,7 @@ class CartItemRepositoryTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartManagementTest.php
index 08821b08ede5e..4313a5e713ee4 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartManagementTest.php
@@ -11,8 +11,7 @@
use Magento\TestFramework\TestCase\WebapiAbstract;
/**
- * Class CartManagementTest
- * @package Magento\Quote\Api
+ * Quote Cart Management API test
* @magentoAppIsolation enabled
*/
class CartManagementTest extends WebapiAbstract
@@ -29,14 +28,14 @@ class CartManagementTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$appConfig = $this->objectManager->get(Config::class);
$appConfig->clean();
}
- public function tearDown()
+ protected function tearDown(): void
{
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
@@ -182,10 +181,11 @@ public function testAssignCustomer()
/**
* @magentoApiDataFixture Magento/Sales/_files/quote.php
- * @expectedException \Exception
*/
public function testAssignCustomerThrowsExceptionIfThereIsNoCustomerWithGivenId()
{
+ $this->expectException(\Exception::class);
+
/** @var $quote \Magento\Quote\Model\Quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class)->load('test01', 'reserved_order_id');
$cartId = $quote->getId();
@@ -212,10 +212,11 @@ public function testAssignCustomerThrowsExceptionIfThereIsNoCustomerWithGivenId(
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
*/
public function testAssignCustomerThrowsExceptionIfThereIsNoCartWithGivenId()
{
+ $this->expectException(\Exception::class);
+
$cartId = 9999;
$customerId = 1;
$serviceInfo = [
@@ -240,11 +241,12 @@ public function testAssignCustomerThrowsExceptionIfThereIsNoCartWithGivenId()
/**
* @magentoApiDataFixture Magento/Sales/_files/quote_with_customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage The customer can't be assigned to the cart because the cart isn't anonymous.
*/
public function testAssignCustomerThrowsExceptionIfTargetCartIsNotAnonymous()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The customer can\'t be assigned to the cart because the cart isn\'t anonymous.');
+
/** @var $customer \Magento\Customer\Model\Customer */
$customer = $this->objectManager->create(\Magento\Customer\Model\Customer::class)->load(1);
$customerId = $customer->getId();
@@ -275,11 +277,14 @@ public function testAssignCustomerThrowsExceptionIfTargetCartIsNotAnonymous()
/**
* @magentoApiDataFixture Magento/Sales/_files/quote.php
* @magentoApiDataFixture Magento/Customer/_files/customer_non_default_website_id.php
- * @expectedException \Exception
- * @expectedExceptionMessage The customer can't be assigned to the cart. The cart belongs to a different store.
*/
public function testAssignCustomerThrowsExceptionIfCartIsAssignedToDifferentStore()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage(
+ 'The customer can\'t be assigned to the cart. The cart belongs to a different store.'
+ );
+
$repository = $this->objectManager->create(\Magento\Customer\Api\CustomerRepositoryInterface::class);
/** @var $customer \Magento\Customer\Api\Data\CustomerInterface */
$customer = $repository->getById(1);
@@ -459,9 +464,9 @@ public function testGetCartForCustomer()
$this->assertEquals($cart->getItemsCount(), $cartData['items_count']);
$this->assertEquals($cart->getItemsQty(), $cartData['items_qty']);
- $this->assertContains('customer', $cartData);
- $this->assertEquals(false, $cartData['customer_is_guest']);
- $this->assertContains('currency', $cartData);
+ $this->assertArrayHasKey('customer', $cartData);
+ $this->assertFalse($cartData['customer_is_guest']);
+ $this->assertArrayHasKey('currency', $cartData);
$this->assertEquals($cart->getGlobalCurrencyCode(), $cartData['currency']['global_currency_code']);
$this->assertEquals($cart->getBaseCurrencyCode(), $cartData['currency']['base_currency_code']);
$this->assertEquals($cart->getQuoteCurrencyCode(), $cartData['currency']['quote_currency_code']);
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartRepositoryTest.php
index 5a894758dc9ed..d3f7d8fcbb923 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartRepositoryTest.php
@@ -45,7 +45,7 @@ class CartRepositoryTest extends WebapiAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->filterBuilder = $this->objectManager->create(
@@ -59,7 +59,7 @@ protected function setUp()
);
}
- protected function tearDown()
+ protected function tearDown(): void
{
try {
/** @var CartRepositoryInterface $quoteRepository */
@@ -130,9 +130,9 @@ public function testGetCart()
$this->assertEquals($cart->getItemsCount(), $cartData['items_count']);
$this->assertEquals($cart->getItemsQty(), $cartData['items_qty']);
//following checks will be uncommented when all cart related services are ready
- $this->assertContains('customer', $cartData);
- $this->assertEquals(true, $cartData['customer_is_guest']);
- $this->assertContains('currency', $cartData);
+ $this->assertArrayHasKey('customer', $cartData);
+ $this->assertTrue($cartData['customer_is_guest']);
+ $this->assertArrayHasKey('currency', $cartData);
$this->assertEquals($cart->getGlobalCurrencyCode(), $cartData['currency']['global_currency_code']);
$this->assertEquals($cart->getBaseCurrencyCode(), $cartData['currency']['base_currency_code']);
$this->assertEquals($cart->getQuoteCurrencyCode(), $cartData['currency']['quote_currency_code']);
@@ -146,11 +146,12 @@ public function testGetCart()
/**
* Tests exception when cartId is not provided.
*
- * @expectedException \Exception
- * @expectedExceptionMessage No such entity with
*/
public function testGetCartThrowsExceptionIfThereIsNoCartWithProvidedId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('No such entity with');
+
$cartId = 9999;
$serviceInfo = [
@@ -232,15 +233,16 @@ public function testGetList()
$this->assertEquals($cart->getUpdatedAt(), $cartData['updated_at']);
$this->assertEquals($cart->getIsActive(), $cartData['is_active']);
- $this->assertContains('customer_is_guest', $cartData);
+ $this->assertArrayHasKey('customer_is_guest', $cartData);
$this->assertEquals(1, $cartData['customer_is_guest']);
}
/**
- * @expectedException \Exception
*/
public function testGetListThrowsExceptionIfProvidedSearchFieldIsInvalid()
{
+ $this->expectException(\Exception::class);
+
$serviceInfo = [
'soap' => [
'service' => 'quoteCartRepositoryV1',
@@ -267,13 +269,14 @@ public function testGetListThrowsExceptionIfProvidedSearchFieldIsInvalid()
/**
* Saving quote - negative case, attempt to change customer id in the active quote for the user with Customer role.
*
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid state change requested
* @dataProvider customerIdDataProvider
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_shipping_method.php
*/
public function testSaveQuoteException($customerId)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid state change requested');
+
$token = $this->getToken();
/** @var Quote $quote */
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartTotalRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartTotalRepositoryTest.php
index a3ded4f5f125c..1b219d0e11141 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartTotalRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CartTotalRepositoryTest.php
@@ -32,7 +32,7 @@ class CartTotalRepositoryTest extends WebapiAbstract
*/
private $filterBuilder;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->searchCriteriaBuilder = $this->objectManager->create(
@@ -74,11 +74,12 @@ public function testGetTotals()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage No such entity
*/
public function testGetTotalsWithAbsentQuote()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('No such entity');
+
$cartId = 9999999999;
$requestData = ['cartId' => $cartId];
$this->_webApiCall($this->getServiceInfoForTotalsService($cartId), $requestData);
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CouponManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CouponManagementTest.php
index 1fb8fc43b0db6..c3a177eafe21e 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CouponManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CouponManagementTest.php
@@ -23,7 +23,7 @@ class CouponManagementTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -82,11 +82,12 @@ public function testDelete()
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
- * @expectedException \Exception
- * @expectedExceptionMessage The coupon code isn't valid. Verify the code and try again.
*/
public function testSetCouponThrowsExceptionIfCouponDoesNotExist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The coupon code isn\'t valid. Verify the code and try again.');
+
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
$quote->load('test_order_1', 'reserved_order_id');
@@ -217,11 +218,12 @@ public function testDeleteMyCoupon()
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
- * @expectedException \Exception
- * @expectedExceptionMessage The coupon code isn't valid. Verify the code and try again.
*/
public function testSetMyCouponThrowsExceptionIfCouponDoesNotExist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The coupon code isn\'t valid. Verify the code and try again.');
+
$this->_markTestAsRestOnly();
// get customer ID token
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestBillingAddressManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestBillingAddressManagementTest.php
index 0f1b54fe343a2..0199f12f0ffd5 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestBillingAddressManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestBillingAddressManagementTest.php
@@ -20,7 +20,7 @@ class GuestBillingAddressManagementTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartAddingItemsTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartAddingItemsTest.php
index 2067393b0bc2e..66f3c5d7874c5 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartAddingItemsTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartAddingItemsTest.php
@@ -23,7 +23,7 @@ class GuestCartAddingItemsTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php
index ddd986bdafc60..373ad64ba39d4 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php
@@ -28,7 +28,7 @@ class GuestCartItemRepositoryTest extends WebapiAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartManagementTest.php
index 120781e674d47..ce9e4ee941785 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartManagementTest.php
@@ -21,7 +21,7 @@ class GuestCartManagementTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -46,7 +46,7 @@ public function testCreate()
$this->createdQuotes[] = $quoteId;
}
- public function tearDown()
+ protected function tearDown(): void
{
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
@@ -123,10 +123,11 @@ public function testAssignCustomer()
/**
* @magentoApiDataFixture Magento/Sales/_files/quote.php
- * @expectedException \Exception
*/
public function testAssignCustomerThrowsExceptionIfThereIsNoCustomerWithGivenId()
{
+ $this->expectException(\Exception::class);
+
/** @var $quote \Magento\Quote\Model\Quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class)->load('test01', 'reserved_order_id');
$cartId = $quote->getId();
@@ -153,10 +154,11 @@ public function testAssignCustomerThrowsExceptionIfThereIsNoCustomerWithGivenId(
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
*/
public function testAssignCustomerThrowsExceptionIfThereIsNoCartWithGivenId()
{
+ $this->expectException(\Exception::class);
+
$cartId = 9999;
$customerId = 1;
$serviceInfo = [
@@ -181,11 +183,12 @@ public function testAssignCustomerThrowsExceptionIfThereIsNoCartWithGivenId()
/**
* @magentoApiDataFixture Magento/Sales/_files/quote_with_customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage The customer can't be assigned to the cart because the cart isn't anonymous.
*/
public function testAssignCustomerThrowsExceptionIfTargetCartIsNotAnonymous()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The customer can\'t be assigned to the cart because the cart isn\'t anonymous.');
+
/** @var $customer \Magento\Customer\Model\Customer */
$customer = $this->objectManager->create(\Magento\Customer\Model\Customer::class)->load(1);
$customerId = $customer->getId();
@@ -332,11 +335,12 @@ public function testPlaceOrder()
/**
* @magentoApiDataFixture Magento/Sales/_files/quote.php
* @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Exception
- * @expectedExceptionMessage You don't have the correct permissions to assign the customer to the cart.
*/
public function testAssignCustomerByGuestUser()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('You don\'t have the correct permissions to assign the customer to the cart.');
+
/** @var $quote \Magento\Quote\Model\Quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class)->load('test01', 'reserved_order_id');
$cartId = $quote->getId();
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartRepositoryTest.php
index 4c67c3cc31b13..f71db359682ae 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartRepositoryTest.php
@@ -15,12 +15,12 @@ class GuestCartRepositoryTest extends WebapiAbstract
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
- protected function tearDown()
+ protected function tearDown(): void
{
try {
$cart = $this->getCart('test01');
@@ -91,9 +91,9 @@ public function testGetCart()
$this->assertEquals($cart->getItemsCount(), $cartData['items_count']);
$this->assertEquals($cart->getItemsQty(), $cartData['items_qty']);
//following checks will be uncommented when all cart related services are ready
- $this->assertContains('customer', $cartData);
- $this->assertEquals(true, $cartData['customer_is_guest']);
- $this->assertContains('currency', $cartData);
+ $this->assertArrayHasKey('customer', $cartData);
+ $this->assertTrue($cartData['customer_is_guest']);
+ $this->assertArrayHasKey('currency', $cartData);
$this->assertEquals($cart->getGlobalCurrencyCode(), $cartData['currency']['global_currency_code']);
$this->assertEquals($cart->getBaseCurrencyCode(), $cartData['currency']['base_currency_code']);
$this->assertEquals($cart->getQuoteCurrencyCode(), $cartData['currency']['quote_currency_code']);
@@ -105,11 +105,12 @@ public function testGetCart()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage No such entity with
*/
public function testGetCartThrowsExceptionIfThereIsNoCartWithProvidedId()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('No such entity with');
+
$cartId = 9999;
$serviceInfo = [
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartTotalRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartTotalRepositoryTest.php
index 28195cca679f8..943e34d280bf2 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartTotalRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartTotalRepositoryTest.php
@@ -30,7 +30,7 @@ class GuestCartTotalRepositoryTest extends WebapiAbstract
*/
private $filterBuilder;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->searchCriteriaBuilder = $this->objectManager->create(
@@ -108,11 +108,12 @@ public function testGetTotals()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage No such entity
*/
public function testGetTotalsWithAbsentQuote()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('No such entity');
+
$cartId = 'unknownCart';
$requestData = ['cartId' => $cartId];
$this->_webApiCall($this->getServiceInfoForTotalsService($cartId), $requestData);
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCouponManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCouponManagementTest.php
index 9815cf888ff95..4573181e28220 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCouponManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCouponManagementTest.php
@@ -20,12 +20,12 @@ class GuestCouponManagementTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
- public function tearDown()
+ protected function tearDown(): void
{
$createdQuotes = ['test_order_1', 'test01'];
/** @var \Magento\Quote\Model\Quote $quote */
@@ -104,11 +104,12 @@ public function testDelete()
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
- * @expectedException \Exception
- * @expectedExceptionMessage The coupon code isn't valid. Verify the code and try again.
*/
public function testSetCouponThrowsExceptionIfCouponDoesNotExist()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The coupon code isn\'t valid. Verify the code and try again.');
+
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
$quote->load('test_order_1', 'reserved_order_id');
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestPaymentMethodManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestPaymentMethodManagementTest.php
index e8fa3a6dabce3..fa5737a58a1aa 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestPaymentMethodManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestPaymentMethodManagementTest.php
@@ -16,12 +16,12 @@ class GuestPaymentMethodManagementTest extends \Magento\TestFramework\TestCase\W
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->deleteCart('test_order_1');
$this->deleteCart('test_order_1_with_payment');
@@ -155,11 +155,12 @@ public function testSetPaymentWithSimpleProduct()
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
- * @expectedException \Exception
- * @expectedExceptionMessage The shipping address is missing. Set the address and try again.
*/
public function testSetPaymentWithSimpleProductWithoutAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The shipping address is missing. Set the address and try again.');
+
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
$quote->load('test_order_with_simple_product_without_address', 'reserved_order_id');
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShipmentEstimationTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShipmentEstimationTest.php
index 6acab2cc295b4..3ebe513d4b83b 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShipmentEstimationTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShipmentEstimationTest.php
@@ -20,7 +20,7 @@ class GuestShipmentEstimationTest extends WebapiAbstract
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -100,7 +100,7 @@ public function testEstimateByExtendedAddress()
$result = $this->_webApiCall($serviceInfo, $requestData);
$this->assertNotEmpty($result);
- $this->assertEquals(1, count($result));
+ $this->assertCount(1, $result);
foreach ($result as $rate) {
$this->assertEquals("flatrate", $rate['carrier_code']);
$this->assertEquals(0, $rate['amount']);
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShippingMethodManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShippingMethodManagementTest.php
index 6c9ef655362bc..740385f44207d 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShippingMethodManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShippingMethodManagementTest.php
@@ -30,7 +30,7 @@ class GuestShippingMethodManagementTest extends WebapiAbstract
*/
protected $totalsCollector;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/PaymentMethodManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/PaymentMethodManagementTest.php
index 64d5290d5c511..ac2384fe0e6b8 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/PaymentMethodManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/PaymentMethodManagementTest.php
@@ -16,7 +16,7 @@ class PaymentMethodManagementTest extends \Magento\TestFramework\TestCase\Webapi
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -121,11 +121,12 @@ public function testSetPaymentWithSimpleProduct()
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
- * @expectedException \Exception
- * @expectedExceptionMessage The shipping address is missing. Set the address and try again.
*/
public function testSetPaymentWithSimpleProductWithoutAddress()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The shipping address is missing. Set the address and try again.');
+
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
$quote->load('test_order_with_simple_product_without_address', 'reserved_order_id');
diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/ShippingMethodManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/ShippingMethodManagementTest.php
index debf51c310c21..6c5f697cb774c 100644
--- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/ShippingMethodManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/ShippingMethodManagementTest.php
@@ -30,7 +30,7 @@ class ShippingMethodManagementTest extends WebapiAbstract
*/
protected $totalsCollector;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditMemoCreateRefundTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditMemoCreateRefundTest.php
index 8262a7e41543e..81bfa8fa78581 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditMemoCreateRefundTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditMemoCreateRefundTest.php
@@ -25,7 +25,7 @@ class CreditMemoCreateRefundTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoAddCommentTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoAddCommentTest.php
index c14a82e3c3668..26b6665f6db43 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoAddCommentTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoAddCommentTest.php
@@ -38,7 +38,7 @@ class CreditmemoAddCommentTest extends WebapiAbstract
*
* @return void
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCancelTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCancelTest.php
index d0be501931f77..ef8efdab29bf1 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCancelTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCancelTest.php
@@ -20,11 +20,12 @@ class CreditmemoCancelTest extends WebapiAbstract
/**
* @magentoApiDataFixture Magento/Sales/_files/creditmemo_with_list.php
- * @expectedException \Exception
- * @expectedExceptionMessage You can not cancel Credit Memo
*/
public function testCreditmemoCancel()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('You can not cancel Credit Memo');
+
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Sales\Model\ResourceModel\Order\Creditmemo\Collection $creditmemoCollection */
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCreateTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCreateTest.php
index 45bae261bb617..492d263181557 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCreateTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCreateTest.php
@@ -24,7 +24,7 @@ class CreditmemoCreateTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoGetTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoGetTest.php
index 6137446f0492c..f149cf5f2ac06 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoGetTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoGetTest.php
@@ -69,7 +69,7 @@ class CreditmemoGetTest extends WebapiAbstract
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php
index a9389a7cb8b9d..a15e656afc472 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php
@@ -37,7 +37,7 @@ class CreditmemoListTest extends WebapiAbstract
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceCaptureTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceCaptureTest.php
index c72242098b23e..3b413d8498e48 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceCaptureTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceCaptureTest.php
@@ -19,10 +19,11 @@ class InvoiceCaptureTest extends WebapiAbstract
/**
* @magentoApiDataFixture Magento/Sales/_files/invoice.php
- * @expectedException \Exception
*/
public function testInvoiceCapture()
{
+ $this->expectException(\Exception::class);
+
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Sales\Model\Order\Invoice $invoice */
$invoice = $objectManager->get(\Magento\Sales\Model\Order\Invoice::class)->loadByIncrementId('100000001');
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceCreateTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceCreateTest.php
index 0b206638f5d73..d0bd40c07dd48 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceCreateTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceCreateTest.php
@@ -23,7 +23,7 @@ class InvoiceCreateTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php
index b8f7b19974dff..761a212f727db 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php
@@ -24,7 +24,7 @@ class InvoiceListTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceVoidTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceVoidTest.php
index 6b41173daa9bf..d24001896accd 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceVoidTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceVoidTest.php
@@ -19,10 +19,11 @@ class InvoiceVoidTest extends WebapiAbstract
/**
* @magentoApiDataFixture Magento/Sales/_files/invoice.php
- * @expectedException \Exception
*/
public function testInvoiceVoid()
{
+ $this->expectException(\Exception::class);
+
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Sales\Model\Order\Invoice $invoice */
$invoice = $objectManager->get(\Magento\Sales\Model\Order\Invoice::class)->loadByIncrementId('100000001');
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php
index bb8e246b573eb..d189738ce8612 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php
@@ -27,7 +27,7 @@ class OrderCancelTest extends WebapiAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCreateTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCreateTest.php
index a907faac98b72..5ca74da7dbff3 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCreateTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCreateTest.php
@@ -26,7 +26,7 @@ class OrderCreateTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetStatusTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetStatusTest.php
index 451dc160feb81..7dc5905141018 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetStatusTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetStatusTest.php
@@ -26,7 +26,7 @@ class OrderGetStatusTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php
index db96728e206be..021698f874e55 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php
@@ -132,7 +132,7 @@ public function testOrderGetExtensionAttributes(): void
$appliedTaxes = $result['extension_attributes']['item_applied_taxes'];
self::assertEquals($expectedTax['type'], $appliedTaxes[0]['type']);
self::assertNotEmpty($appliedTaxes[0]['applied_taxes']);
- self::assertEquals(true, $result['extension_attributes']['converting_from_quote']);
+ self::assertTrue($result['extension_attributes']['converting_from_quote']);
self::assertArrayHasKey('payment_additional_info', $result['extension_attributes']);
self::assertNotEmpty($result['extension_attributes']['payment_additional_info']);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderInvoiceCreateTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderInvoiceCreateTest.php
index f6194db6d8ebb..8089f640c4cdb 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderInvoiceCreateTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderInvoiceCreateTest.php
@@ -23,7 +23,7 @@ class OrderInvoiceCreateTest extends \Magento\TestFramework\TestCase\WebapiAbstr
*/
private $invoiceRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -94,14 +94,18 @@ public function testInvoiceCreate()
/**
* Tests that MAGETWO-95346 was fixed for bundled products
*
- * @expectedException \Exception
* @codingStandardsIgnoreStart
- * @expectedExceptionMessageRegExp /Invoice Document Validation Error\(s\):(?:\n|\\n)The invoice can't be created without products. Add products and try again./
* @codingStandardsIgnoreEnd
* @magentoApiDataFixture Magento/Sales/_files/order_with_bundle.php
*/
public function testOrderWithBundleInvoicedWithInvalidQuantitiesReturnsError()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessageMatches(
+ '/Invoice Document Validation Error\\(s\\):(?:\\n|\\\\n)'
+ . 'The invoice can\'t be created without products. Add products and try again./'
+ );
+
/** @var \Magento\Sales\Model\Order $existingOrder */
$existingOrder = $this->objectManager->create(\Magento\Sales\Model\Order::class)
->loadByIncrementId('100000001');
@@ -140,14 +144,18 @@ public function testOrderWithBundleInvoicedWithInvalidQuantitiesReturnsError()
/**
* Tests that MAGETWO-95346 was fixed for configurable products
*
- * @expectedException \Exception
* @codingStandardsIgnoreStart
- * @expectedExceptionMessageRegExp /Invoice Document Validation Error\(s\):(?:\n|\\n)The invoice can't be created without products. Add products and try again./
* @codingStandardsIgnoreEnd
* @magentoApiDataFixture Magento/Sales/_files/order_configurable_product.php
*/
public function testOrderWithConfigurableProductInvoicedWithInvalidQuantitiesReturnsError()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessageMatches(
+ '/Invoice Document Validation Error\\(s\\):(?:\\n|\\\\n)'
+ . 'The invoice can\'t be created without products. Add products and try again./'
+ );
+
/** @var \Magento\Sales\Model\Order $existingOrder */
$existingOrder = $this->objectManager->create(\Magento\Sales\Model\Order::class)
->loadByIncrementId('100000001');
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetListTest.php
index b96ad58a3077c..81ff953c73804 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetListTest.php
@@ -21,7 +21,7 @@ class OrderItemGetListTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -78,10 +78,10 @@ public function testGetList()
$response = $this->_webApiCall($serviceInfo, $requestData);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertArrayHasKey('items', $response);
$this->assertCount(3, $response['items']);
- $this->assertTrue(is_array($response['items'][0]));
+ $this->assertIsArray($response['items'][0]);
$rowTotals = [];
foreach ($response['items'] as $item) {
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetTest.php
index 9ba648c73276b..25795f2cdd747 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetTest.php
@@ -21,7 +21,7 @@ class OrderItemGetTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -51,7 +51,7 @@ public function testGet()
$response = $this->_webApiCall($serviceInfo, ['id' => $orderItem->getId()]);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertOrderItem($orderItem, $response);
//check that nullable fields were marked as optional and were not sent
@@ -103,7 +103,7 @@ public function testGetOrderWithDiscount()
$response = $this->_webApiCall($serviceInfo, ['id' => $orderItem->getId()]);
- $this->assertTrue(is_array($response));
+ $this->assertIsArray($response);
$this->assertEquals(8.00, $response['row_total']);
$this->assertEquals(8.00, $response['base_row_total']);
$this->assertEquals(9.00, $response['row_total_incl_tax']);
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php
index 506f82eab7ae2..605e616ed3a64 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php
@@ -24,7 +24,7 @@ class OrderListTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -89,7 +89,7 @@ public function testOrderListExtensionAttributes()
$appliedTaxes = $result['items'][0]['extension_attributes']['item_applied_taxes'];
$this->assertEquals($expectedTax['type'], $appliedTaxes[0]['type']);
$this->assertNotEmpty($appliedTaxes[0]['applied_taxes']);
- $this->assertEquals(true, $result['items'][0]['extension_attributes']['converting_from_quote']);
+ $this->assertTrue($result['items'][0]['extension_attributes']['converting_from_quote']);
$this->assertArrayHasKey('payment_additional_info', $result['items'][0]['extension_attributes']);
$this->assertNotEmpty($result['items'][0]['extension_attributes']['payment_additional_info']);
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderStatusHistoryAddTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderStatusHistoryAddTest.php
index 9e3bd4ca48478..aebd2ed41b3a8 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderStatusHistoryAddTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderStatusHistoryAddTest.php
@@ -27,7 +27,7 @@ class OrderStatusHistoryAddTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderUpdateTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderUpdateTest.php
index d4bfbfc177390..57c5f1e161c6c 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderUpdateTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderUpdateTest.php
@@ -32,7 +32,7 @@ class OrderUpdateTest extends WebapiAbstract
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/RefundOrderTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/RefundOrderTest.php
index 92942d7acc6f2..17e82c1b32224 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/RefundOrderTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/RefundOrderTest.php
@@ -26,7 +26,7 @@ class RefundOrderTest extends \Magento\TestFramework\TestCase\WebapiAbstract
*/
private $creditmemoRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php
index 049f49c93c7cd..2d8c308389452 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php
@@ -37,7 +37,7 @@ class ShipOrderTest extends \Magento\TestFramework\TestCase\WebapiAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->shipmentRepository = $this->objectManager->get(ShipmentRepositoryInterface::class);
@@ -143,14 +143,17 @@ public function testShipOrder()
/**
* Tests that not providing a tracking number produces the correct error. See MAGETWO-95429
- * @expectedException \Exception
* @codingStandardsIgnoreStart
- * @expectedExceptionMessageRegExp /Shipment Document Validation Error\(s\):(?:\n|\\n)Please enter a tracking number./
* @codingStandardsIgnoreEnd
* @magentoApiDataFixture Magento/Sales/_files/order_new.php
*/
public function testShipOrderWithoutTrackingNumberReturnsError()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessageMatches(
+ '/Shipment Document Validation Error\\(s\\):(?:\\n|\\\\n)Please enter a tracking number./'
+ );
+
$this->_markTestAsRestOnly('SOAP requires an tracking number to be provided so this case is not possible.');
/** @var Order $existingOrder */
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddCommentTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddCommentTest.php
index b5a82c9b7297c..95a2d49db1e57 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddCommentTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddCommentTest.php
@@ -33,7 +33,7 @@ class ShipmentAddCommentTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddTrackTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddTrackTest.php
index 639adb8da4624..d3f6d215c6342 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddTrackTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddTrackTest.php
@@ -15,7 +15,7 @@
use Magento\TestFramework\TestCase\WebapiAbstract;
/**
- * Class ShipmentAddTrackTest
+ * Sales Shipment Track Repository API test
*/
class ShipmentAddTrackTest extends WebapiAbstract
{
@@ -42,7 +42,7 @@ class ShipmentAddTrackTest extends WebapiAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
@@ -115,7 +115,7 @@ public function testShipmentTrackWithFailedOrderId()
$exceptionMessage = $errorObj['message'];
}
- $this->assertContains(
+ $this->assertStringContainsString(
$exceptionMessage,
'Could not save the shipment tracking.',
'SoapFault or CouldNotSaveException does not contain exception message.'
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentCreateTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentCreateTest.php
index d8b3c5cac52aa..08b3c4548e08f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentCreateTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentCreateTest.php
@@ -24,7 +24,7 @@ class ShipmentCreateTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentGetTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentGetTest.php
index 2b7e76aee0751..e8235711ccd9f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentGetTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentGetTest.php
@@ -23,7 +23,7 @@ class ShipmentGetTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentLabelGetTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentLabelGetTest.php
index b496f08cc3e36..1cbca75ac6961 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentLabelGetTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentLabelGetTest.php
@@ -21,7 +21,7 @@ class ShipmentLabelGetTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php
index 1f5c7415ace3d..cfd503d4209f4 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php
@@ -23,7 +23,7 @@ class ShipmentListTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentRemoveTrackTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentRemoveTrackTest.php
index e4435af1818c7..d9ffa7ce7f326 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentRemoveTrackTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentRemoveTrackTest.php
@@ -43,7 +43,7 @@ class ShipmentRemoveTrackTest extends WebapiAbstract
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php
index 9924d88cc15e2..8e6bfffea4a5f 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php
@@ -36,7 +36,7 @@ class TransactionTest extends WebapiAbstract
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/SalesInventory/Api/Service/V1/ReturnItemsAfterRefundOrderTest.php b/dev/tests/api-functional/testsuite/Magento/SalesInventory/Api/Service/V1/ReturnItemsAfterRefundOrderTest.php
index 809226dca2156..b9fecb7743413 100644
--- a/dev/tests/api-functional/testsuite/Magento/SalesInventory/Api/Service/V1/ReturnItemsAfterRefundOrderTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/SalesInventory/Api/Service/V1/ReturnItemsAfterRefundOrderTest.php
@@ -18,7 +18,7 @@ class ReturnItemsAfterRefundOrderTest extends \Magento\TestFramework\TestCase\We
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/CouponManagementTest.php b/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/CouponManagementTest.php
index 5483080cffb58..3a0013d943861 100644
--- a/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/CouponManagementTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/CouponManagementTest.php
@@ -37,10 +37,10 @@ public function testManagement($count, $length, $format, $regex)
$ruleId = $salesRule->getRuleId();
$result = $this->generate($ruleId, $count, $length, $format);
- $this->assertTrue(is_array($result));
+ $this->assertIsArray($result);
$this->assertTrue(count($result) == $count);
foreach ($result as $code) {
- $this->assertRegExp($regex, $code);
+ $this->assertMatchesRegularExpression($regex, $code);
}
$couponList = $this->getList($ruleId);
diff --git a/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/CouponRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/CouponRepositoryTest.php
index 4d8c8fcc10101..b25f9a21c26e4 100644
--- a/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/CouponRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/CouponRepositoryTest.php
@@ -20,7 +20,7 @@ class CouponRepositoryTest extends WebapiAbstract
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -80,7 +80,7 @@ public function testCrud()
$this->assertEquals($inputData, $result);
//test delete
- $this->assertEquals(true, $this->deleteCoupon($couponId));
+ $this->assertTrue($this->deleteCoupon($couponId));
}
// verify (and remove) the fields that are set by the Sales Rule
diff --git a/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/RuleRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/RuleRepositoryTest.php
index de2332499c7cd..0618638d82ea1 100644
--- a/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/RuleRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/SalesRule/Api/RuleRepositoryTest.php
@@ -20,7 +20,7 @@ class RuleRepositoryTest extends WebapiAbstract
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -124,7 +124,7 @@ public function testCrud()
$this->assertEquals($inputData, $result);
//test delete
- $this->assertEquals(true, $this->deleteRule($ruleId));
+ $this->assertTrue($this->deleteRule($ruleId));
}
public function verifyGetList($ruleId)
diff --git a/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php b/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php
index f6167a06c6436..6c8d3f90cf65c 100644
--- a/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php
@@ -24,7 +24,7 @@ class SearchTest extends WebapiAbstract
*/
private $product;
- protected function setUp()
+ protected function setUp(): void
{
$productSku = 'simple';
@@ -63,7 +63,7 @@ public function testNonExistentProductSearch()
self::assertArrayHasKey('search_criteria', $response);
self::assertArrayHasKey('items', $response);
- self::assertEquals(0, count($response['items']));
+ self::assertCount(0, $response['items']);
}
/**
diff --git a/dev/tests/api-functional/testsuite/Magento/Store/Api/StoreConfigManagerTest.php b/dev/tests/api-functional/testsuite/Magento/Store/Api/StoreConfigManagerTest.php
index 46ee325094f18..0a2ecaaed8b5d 100644
--- a/dev/tests/api-functional/testsuite/Magento/Store/Api/StoreConfigManagerTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Store/Api/StoreConfigManagerTest.php
@@ -39,7 +39,7 @@ public function testGetStoreConfigs()
];
$storeConfigs = $this->_webApiCall($serviceInfo, $requestData);
$this->assertNotNull($storeConfigs);
- $this->assertEquals(1, count($storeConfigs));
+ $this->assertCount(1, $storeConfigs);
$expectedKeys = [
'id',
'code',
diff --git a/dev/tests/api-functional/testsuite/Magento/Swatches/Api/ProductAttributeOptionManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Swatches/Api/ProductAttributeOptionManagementInterfaceTest.php
index 5cbaa76631c23..39ca42b57511e 100644
--- a/dev/tests/api-functional/testsuite/Magento/Swatches/Api/ProductAttributeOptionManagementInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Swatches/Api/ProductAttributeOptionManagementInterfaceTest.php
@@ -35,7 +35,7 @@ class ProductAttributeOptionManagementInterfaceTest extends WebapiAbstract
* @magentoApiDataFixture Magento/Catalog/Model/Product/Attribute/_files/select_attribute.php
* @param array $data
* @param array $payload
- * @param string $expectedSwatchType
+ * @param int $expectedSwatchType
* @param string $expectedLabel
* @param string $expectedValue
*
@@ -44,7 +44,7 @@ class ProductAttributeOptionManagementInterfaceTest extends WebapiAbstract
public function testAdd(
array $data,
array $payload,
- string $expectedSwatchType,
+ int $expectedSwatchType,
string $expectedLabel,
string $expectedValue
) {
diff --git a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxClassRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxClassRepositoryTest.php
index 2b8e82e30b084..14e75bcb15af3 100644
--- a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxClassRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxClassRepositoryTest.php
@@ -49,7 +49,7 @@ class TaxClassRepositoryTest extends WebapiAbstract
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$this->searchCriteriaBuilder = Bootstrap::getObjectManager()->create(
\Magento\Framework\Api\SearchCriteriaBuilder::class
diff --git a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRateRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRateRepositoryTest.php
index 3b379fc7e0eb0..a51ea45b15881 100644
--- a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRateRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRateRepositoryTest.php
@@ -56,7 +56,7 @@ class TaxRateRepositoryTest extends WebapiAbstract
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->taxRateService = $objectManager->get(\Magento\Tax\Api\TaxRateRepositoryInterface::class);
@@ -75,7 +75,7 @@ public function setUp()
$this->getFixtureTaxRules();
}
- public function tearDown()
+ protected function tearDown(): void
{
$taxRules = $this->getFixtureTaxRules();
if (count($taxRules)) {
@@ -126,7 +126,7 @@ public function testCreateTaxRateExistingCode()
$this->_webApiCall($serviceInfo, $data);
$this->fail('Expected exception was not raised');
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
'SoapFault does not contain expected message.'
@@ -164,7 +164,7 @@ public function testCreateTaxRateWithoutValue()
$this->_webApiCall($serviceInfo, $data);
$this->fail('Expected exception was not raised');
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
'SOAP-ERROR: Encoding: object has no \'rate\' property',
$e->getMessage(),
'SoapFault does not contain expected message.'
@@ -369,7 +369,7 @@ public function testUpdateTaxRateNotExisting()
} catch (\Exception $e) {
$expectedMessage = 'No such entity with %fieldName = %fieldValue';
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
@@ -426,7 +426,7 @@ public function testGetTaxRateNotExist()
} catch (\Exception $e) {
$expectedMessage = 'No such entity with %fieldName = %fieldValue';
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
@@ -493,7 +493,7 @@ public function testCannotDeleteTaxRate()
} catch (\Exception $e) {
$expectedMessage = "The tax rate can't be removed because it exists in a tax rule.";
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
diff --git a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRuleRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRuleRepositoryInterfaceTest.php
index 2174dcde6afec..8742d2924aec1 100644
--- a/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRuleRepositoryInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Tax/Api/TaxRuleRepositoryInterfaceTest.php
@@ -14,8 +14,7 @@
use Magento\Webapi\Model\Rest\Config as HttpConstants;
/**
- * Class TaxRuleRepositoryInterfaceTest
- * @package Magento\Tax\Api
+ * Tax Rule Repository API test
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class TaxRuleRepositoryInterfaceTest extends WebapiAbstract
@@ -51,7 +50,7 @@ class TaxRuleRepositoryInterfaceTest extends WebapiAbstract
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$this->searchCriteriaBuilder = Bootstrap::getObjectManager()->create(
\Magento\Framework\Api\SearchCriteriaBuilder::class
@@ -84,7 +83,7 @@ public function setUp()
$this->getFixtureTaxRules();
}
- public function tearDown()
+ protected function tearDown(): void
{
$taxRules = $this->getFixtureTaxRules();
if (count($taxRules)) {
@@ -195,9 +194,15 @@ public function testCreateTaxRuleInvalidTaxClassIds()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail('Did not throw expected InputException');
} catch (\SoapFault $e) {
- $this->assertContains('No such entity with customer_tax_class_ids = %fieldValue', $e->getMessage());
+ $this->assertStringContainsString(
+ 'No such entity with customer_tax_class_ids = %fieldValue',
+ $e->getMessage()
+ );
} catch (\Exception $e) {
- $this->assertContains('No such entity with customer_tax_class_ids = %fieldValue', $e->getMessage());
+ $this->assertStringContainsString(
+ 'No such entity with customer_tax_class_ids = %fieldValue',
+ $e->getMessage()
+ );
}
}
@@ -232,7 +237,7 @@ public function testCreateTaxRuleExistingCode()
$this->_webApiCall($serviceInfo, $requestData);
$this->fail('Expected exception was not raised');
} catch (\SoapFault $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
'SoapFault does not contain expected message.'
@@ -430,7 +435,7 @@ public function testGetTaxRuleNotExist()
} catch (\Exception $e) {
$expectedMessage = 'No such entity with %fieldName = %fieldValue';
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
@@ -542,7 +547,7 @@ public function testUpdateTaxRuleNotExisting()
} catch (\Exception $e) {
$expectedMessage = 'No such entity with %fieldName = %fieldValue';
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Exception does not contain expected message."
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php
index 27031d35a9e3a..1254b6107d02b 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Authentication/RestTest.php
@@ -30,7 +30,7 @@ class RestTest extends \Magento\TestFramework\TestCase\WebapiAbstract
/** @var string */
protected static $_verifier;
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly();
parent::setUp();
@@ -52,7 +52,7 @@ public static function consumerFixture($date = null)
self::$_token = $consumerCredentials['token'];
}
- protected function tearDown()
+ protected function tearDown(): void
{
parent::tearDown();
$this->_oAuthClients = [];
@@ -84,11 +84,12 @@ public function testGetRequestToken()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage 401 Unauthorized
*/
public function testGetRequestTokenExpiredConsumer()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('401 Unauthorized');
+
$this::consumerFixture('2012-01-01 00:00:00');
$this::$_consumer->setUpdatedAt('2012-01-01 00:00:00');
$this::$_consumer->save();
@@ -98,21 +99,23 @@ public function testGetRequestTokenExpiredConsumer()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage 401 Unauthorized
*/
public function testGetRequestTokenInvalidConsumerKey()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('401 Unauthorized');
+
$oAuthClient = $this->_getOauthClient('invalid_key', self::$_consumerSecret);
$oAuthClient->requestRequestToken();
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage 401 Unauthorized
*/
public function testGetRequestTokenInvalidConsumerSecret()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('401 Unauthorized');
+
$oAuthClient = $this->_getOauthClient(self::$_consumerKey, 'invalid_secret');
$oAuthClient->requestRequestToken();
}
@@ -142,11 +145,12 @@ public function testGetAccessToken()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage 401 Unauthorized
*/
public function testGetAccessTokenInvalidVerifier()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('401 Unauthorized');
+
$oAuthClient = $this->_getOauthClient(self::$_consumerKey, self::$_consumerSecret);
$requestToken = $oAuthClient->requestRequestToken();
$oAuthClient->requestAccessToken(
@@ -157,11 +161,12 @@ public function testGetAccessTokenInvalidVerifier()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage 401 Unauthorized
*/
public function testGetAccessTokenConsumerMismatch()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('401 Unauthorized');
+
$oAuthClientA = $this->_getOauthClient(self::$_consumerKey, self::$_consumerSecret);
$requestTokenA = $oAuthClientA->requestRequestToken();
$oauthVerifierA = self::$_verifier;
@@ -178,11 +183,12 @@ public function testGetAccessTokenConsumerMismatch()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage 400 Bad Request
*/
public function testAccessApiInvalidAccessToken()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('400 Bad Request');
+
$oAuthClient = $this->_getOauthClient(self::$_consumerKey, self::$_consumerSecret);
$requestToken = $oAuthClient->requestRequestToken();
$accessToken = $oAuthClient->requestAccessToken(
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/CustomAttributeTypeWsdlGenerationTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/CustomAttributeTypeWsdlGenerationTest.php
index cf8d5789a8e9d..bbed50f30bd6e 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/CustomAttributeTypeWsdlGenerationTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/CustomAttributeTypeWsdlGenerationTest.php
@@ -22,7 +22,7 @@ class CustomAttributeTypeWsdlGenerationTest extends \Magento\TestFramework\TestC
/** @var string */
protected $_soapUrl;
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsSoapOnly("WSDL generation tests are intended to be executed for SOAP adapter only.");
$this->_storeCode = Bootstrap::getObjectManager()->get(\Magento\Store\Model\StoreManagerInterface::class)
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/DataObjectSerialization/ServiceSerializationTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/DataObjectSerialization/ServiceSerializationTest.php
index d7845993bc8b1..e95e1b4b7108d 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/DataObjectSerialization/ServiceSerializationTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/DataObjectSerialization/ServiceSerializationTest.php
@@ -17,7 +17,7 @@ class ServiceSerializationTest extends \Magento\TestFramework\TestCase\WebapiAbs
*/
protected $_restResourcePath;
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly();
$this->_version = 'V1';
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/DeserializationTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/DeserializationTest.php
index 1e870204f00c1..9689e28dfe73e 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/DeserializationTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/DeserializationTest.php
@@ -20,7 +20,7 @@ class DeserializationTest extends \Magento\TestFramework\TestCase\WebapiAbstract
*/
protected $_restResourcePath;
- protected function setUp()
+ protected function setUp(): void
{
$this->_version = 'V1';
$this->_restResourcePath = "/{$this->_version}/TestModule5/";
@@ -44,7 +44,7 @@ public function testPostRequestWithEmptyBody()
$this->_webApiCall($serviceInfo, RestClient::EMPTY_REQUEST_BODY);
} catch (\Exception $e) {
$this->assertEquals(\Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST, $e->getCode());
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Response does not contain expected message."
@@ -71,7 +71,7 @@ public function testPutRequestWithEmptyBody()
$this->_webApiCall($serviceInfo, RestClient::EMPTY_REQUEST_BODY);
} catch (\Exception $e) {
$this->assertEquals(\Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST, $e->getCode());
- $this->assertContains(
+ $this->assertStringContainsString(
$expectedMessage,
$e->getMessage(),
"Response does not contain expected message."
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/JoinDirectivesTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/JoinDirectivesTest.php
index 8beb14e81be71..4d89e3a0b582a 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/JoinDirectivesTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/JoinDirectivesTest.php
@@ -36,7 +36,7 @@ class JoinDirectivesTest extends \Magento\TestFramework\TestCase\WebapiAbstract
*/
private $user;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->searchBuilder = $objectManager->create(\Magento\Framework\Api\SearchCriteriaBuilder::class);
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php
index 99e1152747ba0..ae74c5c5dd28e 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php
@@ -29,7 +29,7 @@ class JsonGenerationFromDataObjectTest extends \Magento\TestFramework\TestCase\W
*/
protected $productMetadata;
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly("JSON generation tests are intended to be executed for REST adapter only.");
@@ -77,11 +77,12 @@ public function testSingleServiceRetrieval()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Specified request cannot be processed.
*/
public function testInvalidRestUrlNoServices()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Specified request cannot be processed.');
+
$resourcePath = '';
$serviceInfo = [
@@ -95,11 +96,12 @@ public function testInvalidRestUrlNoServices()
}
/**
- * @expectedException \Exception
- * @expectedExceptionMessage Incorrect format of request URI or Requested services are missing.
*/
public function testInvalidRestUrlInvalidServiceName()
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Incorrect format of request URI or Requested services are missing.');
+
$this->isSingleService = false;
$resourcePath = '/schema?services=invalidServiceName';
@@ -121,7 +123,7 @@ private function assertRecursiveArray($expected, $actual, $checkVal)
foreach ($expected as $expKey => $expVal) {
$this->assertArrayHasKey($expKey, $actual, 'Schema does not contain \'' . $expKey . '\' section.');
if (is_array($expVal)) {
- $this->assertTrue(is_array($actual[$expKey]));
+ $this->assertIsArray($actual[$expKey]);
$this->assertRecursiveArray($expVal, $actual[$expKey], $checkVal);
} elseif ($checkVal) {
$this->assertEquals($expVal, $actual[$expKey], '\'' . $expKey . '\' section content is invalid.');
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/PartialResponseTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/PartialResponseTest.php
index 1c0e0a30c2460..fe6a20d7f6c15 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/PartialResponseTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/PartialResponseTest.php
@@ -18,7 +18,7 @@ class PartialResponseTest extends \Magento\TestFramework\TestCase\WebapiAbstract
/** @var string */
protected $customerData;
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly('Partial response functionality available in REST mode only.');
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/BaseService.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/BaseService.php
index 8d59598d7ccc7..efd7d0b7c8f4d 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/BaseService.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/BaseService.php
@@ -43,7 +43,7 @@ protected function _assertRestUnauthorizedException($serviceInfo, $requestData =
try {
$this->_webApiCall($serviceInfo, $requestData);
} catch (\Exception $e) {
- $this->assertContains(
+ $this->assertStringContainsString(
'{"message":"The consumer isn\'t authorized to access %resources.',
$e->getMessage(),
sprintf(
@@ -111,7 +111,7 @@ protected function _assertSoapException($serviceInfo, $requestData = null, $expe
}
if ($expectedMessage) {
- $this->assertContains($expectedMessage, $e->getMessage());
+ $this->assertStringContainsString($expectedMessage, $e->getMessage());
}
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/GettersTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/GettersTest.php
index 2f08a5598d5c6..a9dfee337297d 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/GettersTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/GettersTest.php
@@ -24,7 +24,7 @@ class GettersTest extends \Magento\Webapi\Routing\BaseService
*/
protected $_soapService = 'testModule5AllSoapAndRest';
- protected function setUp()
+ protected function setUp(): void
{
$this->_version = 'V1';
$this->_soapService = "testModule5AllSoapAndRest{$this->_version}";
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/NoWebApiXmlTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/NoWebApiXmlTest.php
index 519e522dfdb67..6c605fbcf3c15 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/NoWebApiXmlTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/NoWebApiXmlTest.php
@@ -20,7 +20,7 @@ class NoWebApiXmlTest extends \Magento\Webapi\Routing\BaseService
*/
private $_restResourcePath;
- protected function setUp()
+ protected function setUp(): void
{
$this->_version = 'V1';
$this->_restResourcePath = "/{$this->_version}/testModule2NoWebApiXml/";
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/RequestIdOverrideTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/RequestIdOverrideTest.php
index 1f868c0f617c4..49456f1398a57 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/RequestIdOverrideTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/RequestIdOverrideTest.php
@@ -35,7 +35,7 @@ class RequestIdOverrideTest extends \Magento\Webapi\Routing\BaseService
*/
protected $_soapService = 'testModule5AllSoapAndRest';
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly('Request Id overriding is a REST based feature.');
$this->_version = 'V1';
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/RestErrorHandlingTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/RestErrorHandlingTest.php
index 62400b1f30ce5..f1bcea1c3ebc7 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/RestErrorHandlingTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/RestErrorHandlingTest.php
@@ -18,7 +18,7 @@ class RestErrorHandlingTest extends \Magento\TestFramework\TestCase\WebapiAbstra
*/
protected $mode;
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsRestOnly();
$this->mode = Bootstrap::getObjectManager()->get(\Magento\Framework\App\State::class)->getMode();
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV1Test.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV1Test.php
index 56124718aa8f3..6ade0678b5538 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV1Test.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV1Test.php
@@ -38,7 +38,7 @@ class ServiceVersionV1Test extends \Magento\Webapi\Routing\BaseService
/** @var ItemFactory */
protected $itemFactory;
- protected function setUp()
+ protected function setUp(): void
{
$this->_version = 'V1';
$this->_soapService = 'testModule1AllSoapAndRestV1';
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV2Test.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV2Test.php
index a40e48b0e72b8..acf2f3a95c5ce 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV2Test.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/ServiceVersionV2Test.php
@@ -7,7 +7,7 @@
class ServiceVersionV2Test extends \Magento\Webapi\Routing\BaseService
{
- protected function setUp()
+ protected function setUp(): void
{
$this->_version = 'V2';
$this->_soapService = 'testModule1AllSoapAndRestV2';
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/SoapErrorHandlingTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/SoapErrorHandlingTest.php
index 61ba247645b31..8f38eeb9bad1e 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/SoapErrorHandlingTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/SoapErrorHandlingTest.php
@@ -13,7 +13,7 @@
*/
class SoapErrorHandlingTest extends \Magento\TestFramework\TestCase\WebapiAbstract
{
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsSoapOnly();
parent::setUp();
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/SubsetTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/SubsetTest.php
index 9f2d7a920679e..f05f44eb7a3d5 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/SubsetTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/Routing/SubsetTest.php
@@ -29,7 +29,7 @@ class SubsetTest extends \Magento\Webapi\Routing\BaseService
/**
* @Override
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->_version = 'V1';
$this->_restResourcePath = "/{$this->_version}/testModule2SubsetRest/";
diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/WsdlGenerationFromDataObjectTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/WsdlGenerationFromDataObjectTest.php
index 86f27908a96d5..dadc2caef7a13 100644
--- a/dev/tests/api-functional/testsuite/Magento/Webapi/WsdlGenerationFromDataObjectTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Webapi/WsdlGenerationFromDataObjectTest.php
@@ -25,7 +25,7 @@ class WsdlGenerationFromDataObjectTest extends \Magento\TestFramework\TestCase\W
/** @var bool */
protected $isSingleService;
- protected function setUp()
+ protected function setUp(): void
{
$this->_markTestAsSoapOnly("WSDL generation tests are intended to be executed for SOAP adapter only.");
$this->_storeCode = Bootstrap::getObjectManager()->get(\Magento\Store\Model\StoreManagerInterface::class)
@@ -71,20 +71,20 @@ public function testNoAuthorizedServices()
curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);
$responseContent = curl_exec($connection);
$this->assertEquals(curl_getinfo($connection, CURLINFO_HTTP_CODE), 401);
- $this->assertContains("The consumer isn't authorized to access %resources.", $responseContent);
+ $this->assertStringContainsString("The consumer isn't authorized to access %resources.", $responseContent);
}
public function testInvalidWsdlUrlNoServices()
{
$responseContent = $this->_getWsdlContent($this->_getBaseWsdlUrl());
- $this->assertContains("Requested services are missing.", $responseContent);
+ $this->assertStringContainsString("Requested services are missing.", $responseContent);
}
public function testInvalidWsdlUrlInvalidParameter()
{
$wsdlUrl = $this->_getBaseWsdlUrl() . '&invalid';
$responseContent = $this->_getWsdlContent($wsdlUrl);
- $this->assertContains("Not allowed parameters", $responseContent);
+ $this->assertStringContainsString("Not allowed parameters", $responseContent);
}
/**
@@ -145,7 +145,7 @@ protected function _checkTypesDeclaration($wsdlContent)
TYPES_SECTION_DECLARATION;
// @codingStandardsIgnoreEnd
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($typesSectionDeclaration),
$wsdlContent,
'Types section declaration is invalid'
@@ -168,7 +168,7 @@ protected function _checkElementsDeclaration($wsdlContent)
REQUEST_ELEMENT;
}
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($requestElement),
$wsdlContent,
'Request element declaration in types section is invalid'
@@ -183,7 +183,7 @@ protected function _checkElementsDeclaration($wsdlContent)
RESPONSE_ELEMENT;
}
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($responseElement),
$wsdlContent,
'Response element declaration in types section is invalid'
@@ -247,7 +247,7 @@ protected function _checkComplexTypesDeclaration($wsdlContent)
REQUEST_TYPE;
}
// @codingStandardsIgnoreEnd
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($requestType),
$wsdlContent,
'Request type declaration in types section is invalid'
@@ -304,7 +304,7 @@ protected function _checkComplexTypesDeclaration($wsdlContent)
RESPONSE_TYPE;
}
// @codingStandardsIgnoreEnd
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($responseType),
$wsdlContent,
'Response type declaration in types section is invalid'
@@ -472,7 +472,7 @@ protected function _checkReferencedTypeDeclaration($wsdlContent)
RESPONSE_TYPE;
}
// @codingStandardsIgnoreEnd
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($referencedType),
$wsdlContent,
'Declaration of complex type generated from Data Object, which is referenced in response, is invalid'
@@ -495,7 +495,7 @@ protected function _checkPortTypeDeclaration($wsdlContent)
FIRST_PORT_TYPE;
}
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($firstPortType),
$wsdlContent,
'Port type declaration is missing or invalid'
@@ -505,7 +505,7 @@ protected function _checkPortTypeDeclaration($wsdlContent)
$secondPortType = <<< SECOND_PORT_TYPE
SECOND_PORT_TYPE;
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($secondPortType),
$wsdlContent,
'Port type declaration is missing or invalid'
@@ -539,7 +539,7 @@ protected function _checkPortTypeDeclaration($wsdlContent)
OPERATION_DECLARATION;
}
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($operationDeclaration),
$wsdlContent,
'Operation in port type is invalid'
@@ -564,7 +564,7 @@ protected function _checkBindingDeclaration($wsdlContent)
FIRST_BINDING;
}
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($firstBinding),
$wsdlContent,
'Binding declaration is missing or invalid'
@@ -575,7 +575,7 @@ protected function _checkBindingDeclaration($wsdlContent)
SECOND_BINDING;
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($secondBinding),
$wsdlContent,
'Binding declaration is missing or invalid'
@@ -629,7 +629,7 @@ protected function _checkBindingDeclaration($wsdlContent)
OPERATION_DECLARATION;
}
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($operationDeclaration),
$wsdlContent,
'Operation in binding is invalid'
@@ -662,7 +662,7 @@ protected function _checkServiceDeclaration($wsdlContent)
FIRST_SERVICE_DECLARATION;
}
// @codingStandardsIgnoreEnd
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($firstServiceDeclaration),
$wsdlContent,
'First service section is invalid'
@@ -678,7 +678,7 @@ protected function _checkServiceDeclaration($wsdlContent)
SECOND_SERVICE_DECLARATION;
// @codingStandardsIgnoreEnd
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($secondServiceDeclaration),
$wsdlContent,
'Second service section is invalid'
@@ -701,7 +701,7 @@ protected function _checkMessagesDeclaration($wsdlContent)
MESSAGES_DECLARATION;
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($itemMessagesDeclaration),
$wsdlContent,
'Messages section for "item" operation is invalid'
@@ -714,7 +714,7 @@ protected function _checkMessagesDeclaration($wsdlContent)
MESSAGES_DECLARATION;
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($itemsMessagesDeclaration),
$wsdlContent,
'Messages section for "items" operation is invalid'
@@ -742,7 +742,7 @@ protected function _checkFaultsPortTypeSection($wsdlContent)
$faultsInPortType = <<< FAULT_IN_PORT_TYPE
FAULT_IN_PORT_TYPE;
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($faultsInPortType),
$wsdlContent,
'SOAP Fault section in port type section is invalid'
@@ -757,7 +757,7 @@ protected function _checkFaultsBindingSection($wsdlContent)
$faultsInBinding = <<< FAULT_IN_BINDING
FAULT_IN_BINDING;
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($faultsInBinding),
$wsdlContent,
'SOAP Fault section in binding section is invalid'
@@ -774,7 +774,7 @@ protected function _checkFaultsMessagesSection($wsdlContent)
GENERIC_FAULT_IN_MESSAGES;
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($genericFaultMessage),
$wsdlContent,
'Generic SOAP Fault declaration in messages section is invalid'
@@ -787,7 +787,7 @@ protected function _checkFaultsMessagesSection($wsdlContent)
*/
protected function _checkFaultsComplexTypeSection($wsdlContent)
{
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString(''),
$wsdlContent,
'Default SOAP Fault complex type element declaration is invalid'
@@ -824,7 +824,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
GENERIC_FAULT_COMPLEX_TYPE;
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($genericFaultType),
$wsdlContent,
'Default SOAP Fault complex types declaration is invalid'
@@ -852,7 +852,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
PARAM_COMPLEX_TYPE;
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($detailsParameterType),
$wsdlContent,
'Details parameter complex types declaration is invalid.'
@@ -907,7 +907,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
WRAPPED_ERROR_COMPLEX_TYPE;
}
// @codingStandardsIgnoreEnd
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($detailsWrappedErrorType),
$wsdlContent,
'Details wrapped error complex types declaration is invalid.'
@@ -930,7 +930,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
PARAMETERS_COMPLEX_TYPE;
// @codingStandardsIgnoreEnd
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($detailsParametersType),
$wsdlContent,
'Details parameters (array of parameters) complex types declaration is invalid.'
@@ -974,7 +974,7 @@ protected function _checkFaultsComplexTypeSection($wsdlContent)
}
// @codingStandardsIgnoreEnd
- $this->assertContains(
+ $this->assertStringContainsString(
$this->_convertXmlToString($detailsWrappedErrorsType),
$wsdlContent,
'Details wrapped errors (array of wrapped errors) complex types declaration is invalid.'
diff --git a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncBulkScheduleTest.php b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncBulkScheduleTest.php
index ea492098ed1f5..6073a03aba8b8 100644
--- a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncBulkScheduleTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncBulkScheduleTest.php
@@ -74,7 +74,7 @@ class AsyncBulkScheduleTest extends WebapiAbstract
*/
private $registry;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt";
@@ -194,11 +194,12 @@ public function testAsyncScheduleBulkWrongEntity($products)
* @param string $sku
* @param string|null $storeCode
* @dataProvider productGetDataProvider
- * @expectedException \Exception
- * @expectedExceptionMessage Specified request cannot be processed.
*/
public function testGETRequestToAsyncBulk($sku, $storeCode = null)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Specified request cannot be processed.');
+
$this->_markTestAsRestOnly();
$serviceInfo = [
'rest' => [
@@ -216,7 +217,7 @@ public function testGETRequestToAsyncBulk($sku, $storeCode = null)
$this->assertNull($response);
}
- public function tearDown()
+ protected function tearDown(): void
{
$this->clearProducts();
$this->publisherConsumerController->stopConsumers();
diff --git a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleCustomRouteTest.php b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleCustomRouteTest.php
index 4a56c4e0e6f77..08894a1ee8793 100644
--- a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleCustomRouteTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleCustomRouteTest.php
@@ -69,7 +69,7 @@ class AsyncScheduleCustomRouteTest extends WebapiAbstract
*/
private $registry;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt";
@@ -129,7 +129,7 @@ public function testAsyncScheduleBulkByCustomRoute($product)
}
}
- public function tearDown()
+ protected function tearDown(): void
{
$this->clearProducts();
$this->publisherConsumerController->stopConsumers();
diff --git a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleMultiStoreTest.php b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleMultiStoreTest.php
index 37cb2317b5b65..3f5d4c70a30ce 100644
--- a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleMultiStoreTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleMultiStoreTest.php
@@ -86,7 +86,7 @@ class AsyncScheduleMultiStoreTest extends WebapiAbstract
*/
private $registry;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt";
@@ -225,7 +225,7 @@ private function asyncScheduleAndTest($product, $storeCode = null)
}
}
- public function tearDown()
+ protected function tearDown(): void
{
$this->clearProducts();
$this->publisherConsumerController->stopConsumers();
@@ -355,7 +355,7 @@ public function assertProductCreation($product)
* Remove test store
* //phpcs:disable
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
//phpcs:enable
diff --git a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleTest.php b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleTest.php
index b7dc1919382ef..0999992cfc85b 100644
--- a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/AsyncScheduleTest.php
@@ -72,7 +72,7 @@ class AsyncScheduleTest extends WebapiAbstract
*/
private $registry;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->logFilePath = TESTS_TEMP_DIR . "/MessageQueueTestLog.txt";
@@ -132,7 +132,7 @@ public function testAsyncScheduleBulk($product)
}
}
- public function tearDown()
+ protected function tearDown(): void
{
$this->clearProducts();
$this->publisherConsumerController->stopConsumers();
@@ -176,11 +176,12 @@ private function clearProducts()
* @param string $sku
* @param string|null $storeCode
* @dataProvider productGetDataProvider
- * @expectedException \Exception
- * @expectedExceptionMessage Specified request cannot be processed.
*/
public function testGETRequestToAsync($sku, $storeCode = null)
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Specified request cannot be processed.');
+
$this->_markTestAsRestOnly();
$serviceInfo = [
'rest' => [
diff --git a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/OrderRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/OrderRepositoryInterfaceTest.php
index bc7940ca35f35..672f35614cb68 100644
--- a/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/OrderRepositoryInterfaceTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/WebapiAsync/Model/OrderRepositoryInterfaceTest.php
@@ -36,7 +36,7 @@ class OrderRepositoryInterfaceTest extends WebapiAbstract
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->objectManager = Bootstrap::getObjectManager();
@@ -70,7 +70,7 @@ protected function setUp()
/**
* @inheritDoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->publisherConsumerController->stopConsumers();
parent::tearDown();
diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json
index 233fd58c1dce9..c3ac9079c8e40 100644
--- a/dev/tests/functional/composer.json
+++ b/dev/tests/functional/composer.json
@@ -3,7 +3,7 @@
"sort-packages": true
},
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/mtf": "1.0.0-rc64",
"allure-framework/allure-phpunit": "~1.2.0",
"doctrine/annotations": "1.4.*",
@@ -16,7 +16,12 @@
},
"autoload": {
"psr-4": {
- "Magento\\": ["lib/Magento/", "testsuites/Magento", "generated/Magento/", "tests/app/Magento/"],
+ "Magento\\": [
+ "lib/Magento/",
+ "testsuites/Magento",
+ "generated/Magento/",
+ "tests/app/Magento/"
+ ],
"Test\\": "generated/Test/"
}
}
diff --git a/dev/tests/functional/tests/app/Magento/AdvancedPricingImportExport/Test/TestCase/ExportAdvancedPricingTest.php b/dev/tests/functional/tests/app/Magento/AdvancedPricingImportExport/Test/TestCase/ExportAdvancedPricingTest.php
index c2c684c89d06b..2e4ffed6ab717 100644
--- a/dev/tests/functional/tests/app/Magento/AdvancedPricingImportExport/Test/TestCase/ExportAdvancedPricingTest.php
+++ b/dev/tests/functional/tests/app/Magento/AdvancedPricingImportExport/Test/TestCase/ExportAdvancedPricingTest.php
@@ -251,7 +251,7 @@ public function prepareProducts(array $products, Website $website = null)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->configData) {
$this->stepFactory->create(
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ConfigureSecureUrlsTest.php b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ConfigureSecureUrlsTest.php
index f8eafea130ee4..1c008f72d9008 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ConfigureSecureUrlsTest.php
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ConfigureSecureUrlsTest.php
@@ -145,7 +145,7 @@ public function test($configData)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->configurationAdminPage->open();
$this->configurationAdminPage->getForm()
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ExpireSessionTest.php b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ExpireSessionTest.php
index c0c94aa54c531..f4f3eb7a91f5e 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ExpireSessionTest.php
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ExpireSessionTest.php
@@ -91,7 +91,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/LoginAfterJSMinificationTest.php b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/LoginAfterJSMinificationTest.php
index 4a6202f815b92..855ff6e3709df 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/LoginAfterJSMinificationTest.php
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/LoginAfterJSMinificationTest.php
@@ -82,7 +82,7 @@ public function test(
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaEditCustomerTest.php b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaEditCustomerTest.php
index 594b2861c28df..91e6fa60dd524 100644
--- a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaEditCustomerTest.php
+++ b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaEditCustomerTest.php
@@ -147,7 +147,7 @@ private function customerEdit(Customer $customer, $attempts)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaLockoutCustomerTest.php b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaLockoutCustomerTest.php
index 85c4e17ae5966..cf6b2071086dc 100644
--- a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaLockoutCustomerTest.php
+++ b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaLockoutCustomerTest.php
@@ -165,7 +165,7 @@ private function customerLogin(FixtureInterface $customer, Login $loginForm, $at
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnAdminLoginTest.php b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnAdminLoginTest.php
index 9c7ef29a226b9..7af4c56f03494 100644
--- a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnAdminLoginTest.php
+++ b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnAdminLoginTest.php
@@ -116,7 +116,7 @@ public function test(User $customAdmin, $configData)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->systemConfigEditPage->open();
$this->systemConfigEditPage->getForm()
diff --git a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnContactUsTest.php b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnContactUsTest.php
index 0de71c3a416c8..7a4d64f3d21ab 100644
--- a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnContactUsTest.php
+++ b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnContactUsTest.php
@@ -102,7 +102,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnStoreFrontLoginTest.php b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnStoreFrontLoginTest.php
index 646dce202d188..a75b516cc5664 100644
--- a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnStoreFrontLoginTest.php
+++ b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnStoreFrontLoginTest.php
@@ -125,7 +125,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnStoreFrontRegisterTest.php b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnStoreFrontRegisterTest.php
index 5dbb859f1e3ac..10d3695ad81a0 100644
--- a/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnStoreFrontRegisterTest.php
+++ b/dev/tests/functional/tests/app/Magento/Captcha/Test/TestCase/CaptchaOnStoreFrontRegisterTest.php
@@ -101,7 +101,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityFlatDataTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityFlatDataTest.php
index 9de01a87986f8..89f662858a1a8 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityFlatDataTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityFlatDataTest.php
@@ -120,7 +120,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateInactiveCategoryEntityFlatDataTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateInactiveCategoryEntityFlatDataTest.php
index 7d5744b62b0f6..8abc16ac1f5bf 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateInactiveCategoryEntityFlatDataTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateInactiveCategoryEntityFlatDataTest.php
@@ -120,7 +120,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest.php
index c40387aba4603..c0531727e037b 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest.php
@@ -72,7 +72,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->cmsIndex->open();
$this->cmsIndex->getLinksBlock()->openLink("Compare Products");
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateFlatCatalogProductTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateFlatCatalogProductTest.php
index 8f11f31a6dff7..49113af767f38 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateFlatCatalogProductTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateFlatCatalogProductTest.php
@@ -112,7 +112,7 @@ public function test($configData, $productsCount)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityByAttributeMaskSkuTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityByAttributeMaskSkuTest.php
index ccbe65abe2e32..c77f023e9753c 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityByAttributeMaskSkuTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityByAttributeMaskSkuTest.php
@@ -124,7 +124,7 @@ private function prepareSkuByMask(CatalogProductSimple $product)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php
index 4d866f716d70c..883de507f57cc 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php
@@ -103,7 +103,7 @@ public function testCreate(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DeleteCompareProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DeleteCompareProductsTest.php
index 6ed1b220cf40d..fe22f32eb1134 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DeleteCompareProductsTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DeleteCompareProductsTest.php
@@ -86,7 +86,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if (count($this->products) > 1) {
$this->cmsIndex->open();
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest.php
index f7c3de8530c9f..1eb3107aef83b 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ManageProductsStockTest.php
@@ -91,7 +91,7 @@ public function test(CatalogProductSimple $product, $skipAddingToCart = null, $c
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.php
index 2831b2b6eaa24..12aeaacf94393 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/MassProductUpdateTest.php
@@ -155,7 +155,7 @@ private function prepareUpdatedProducts(array $products, CatalogProductSimple $p
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php
index 6b65b57046869..99d57a6d99bad 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php
@@ -153,7 +153,7 @@ protected function getCategory(CatalogProductSimple $initialProduct, CatalogProd
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->configData) {
$this->objectManager->create(
diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php
index 6c752188f2688..fd25edef32fcb 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php
@@ -71,7 +71,7 @@ public function __inject(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php
index fba5a2b062343..f7385d2331ba1 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php
@@ -218,7 +218,7 @@ protected function addToCart(array $products, $isValidationFailed)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
// Workaround until MTA-3879 is delivered.
if ($this->configData == 'enable_https_frontend_admin_with_url') {
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.php
index 6f5512b2e8293..0ee22474f435e 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutOfflinePaymentMethodsTest.php
@@ -77,7 +77,7 @@ public function test()
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->envWhitelist->removeHost('example.com');
}
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php
index 36b4f4b3eb39b..5bccfcd47939a 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/UpdateProductFromMiniShoppingCartEntityTest.php
@@ -180,7 +180,7 @@ protected function addToCart(FixtureInterface $product)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->envWhitelist->removeHost('example.com');
}
diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php
index 49e686979f016..e97ce25cd745b 100644
--- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php
@@ -99,7 +99,7 @@ public function __inject(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
foreach ($this->storeName as $store) {
if (in_array($store, $this->skippedStores)) {
diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php
index cc6fbdad0856f..b56a9f4d7705a 100644
--- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php
@@ -108,7 +108,7 @@ public function test(array $data, $fixtureType, $configData = '')
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->configData) {
$this->objectManager->create(
diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateDuplicateUrlCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateDuplicateUrlCmsPageEntityTest.php
index dceba037f0e6a..bb1aa1d3e328d 100644
--- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateDuplicateUrlCmsPageEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateDuplicateUrlCmsPageEntityTest.php
@@ -117,7 +117,7 @@ public function test(array $data, $fixtureType, $configData = '')
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->configData) {
$this->objectManager->create(
diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php
index 75e718d2f53d8..f44e77523cc24 100644
--- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php
@@ -141,7 +141,7 @@ public function test(UrlRewrite $urlRewrite, UrlRewrite $cmsPageRewrite)
*
* @return void|null
*/
- public function tearDown()
+ public function tearDown(): void
{
if (in_array($this->storeName, $this->skippedStores)) {
return;
diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/AbstractCurrencySymbolEntityTest.php b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/AbstractCurrencySymbolEntityTest.php
index 2ee53897c0267..40193508fc767 100644
--- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/AbstractCurrencySymbolEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/AbstractCurrencySymbolEntityTest.php
@@ -107,7 +107,7 @@ protected function importCurrencyRate($configData)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->getInstance()->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/EditCurrencyCustomWebsiteTest.php b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/EditCurrencyCustomWebsiteTest.php
index d5a71c3bf4693..d893c1bca9e6d 100644
--- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/EditCurrencyCustomWebsiteTest.php
+++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/EditCurrencyCustomWebsiteTest.php
@@ -116,7 +116,7 @@ public function test($configData, array $product, Store $store, array $currencie
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/AbstractApplyVatIdTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/AbstractApplyVatIdTest.php
index 2d2392f3328fe..1a2492ebc4588 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/AbstractApplyVatIdTest.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/AbstractApplyVatIdTest.php
@@ -117,7 +117,7 @@ protected function prepareVatConfig(ConfigData $vatConfig, $customerGroup)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php
index ccc6da81038f8..1e09c85080d57 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php
@@ -297,7 +297,7 @@ protected function changeAdminLocaleRollback()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
foreach ($this->steps as $key => $stepData) {
if (method_exists($this, $key . 'Rollback')) {
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/PasswordAutocompleteOffTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/PasswordAutocompleteOffTest.php
index c0efb879c3a5a..5b3a264170786 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/PasswordAutocompleteOffTest.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/PasswordAutocompleteOffTest.php
@@ -78,7 +78,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php
index 7834c7335cff6..ead0991388003 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php
@@ -88,7 +88,7 @@ public function test(Customer $customer)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->logoutCustomerOnFrontendStep->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php
index 4ba3a47344092..76b7c05910722 100644
--- a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php
+++ b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php
@@ -91,7 +91,7 @@ public function test(CurrencyRate $currencyRate, ConfigData $config, $product, a
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php
index de71cdff7ae4c..3225871ab4ab6 100644
--- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php
@@ -119,7 +119,7 @@ public function test(DownloadableProduct $product, Category $category)
*
* @return void
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->envWhitelist->removeHost('example.com');
}
diff --git a/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/CreateCatalogRulesIndexerTest.php b/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/CreateCatalogRulesIndexerTest.php
index cb57a4d885331..e7b2b8abb2c33 100644
--- a/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/CreateCatalogRulesIndexerTest.php
+++ b/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/CreateCatalogRulesIndexerTest.php
@@ -281,7 +281,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.php b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.php
index 58345254b1a00..ea69fac43a066 100644
--- a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.php
+++ b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.php
@@ -83,7 +83,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.xml b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.xml
index 48129ef287498..fa285a13655d1 100644
--- a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.xml
+++ b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/TestCase/FilterProductListTest.xml
@@ -94,17 +94,16 @@
- test_type:mysql_search
layered_navigation_manual_range_10
true
default_anchor_subcategory
- catalogProductSimple::product_10_dollar, catalogProductSimple::product_20_dollar, configurableProduct::filterable_two_options_with_zero_price
+ configurableProduct::filterable_two_options_with_zero_price, catalogProductSimple::product_20_dollar, catalogProductSimple::product_10_dollar
-
-
- Price
- `^.+10\.00 - .+19\.99 2$`m
- - product_0, product_2
+ - product_2, product_0
diff --git a/dev/tests/functional/tests/app/Magento/Msrp/Test/TestCase/ApplyMapTest.php b/dev/tests/functional/tests/app/Magento/Msrp/Test/TestCase/ApplyMapTest.php
index 5d547a745dcdf..9f6f2189cf9ba 100644
--- a/dev/tests/functional/tests/app/Magento/Msrp/Test/TestCase/ApplyMapTest.php
+++ b/dev/tests/functional/tests/app/Magento/Msrp/Test/TestCase/ApplyMapTest.php
@@ -49,7 +49,7 @@ public function test($product)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/CacheStatusOnScheduledIndexingTest.php b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/CacheStatusOnScheduledIndexingTest.php
index a3aba4c5cd3dc..2d46fca677746 100644
--- a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/CacheStatusOnScheduledIndexingTest.php
+++ b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/CacheStatusOnScheduledIndexingTest.php
@@ -128,7 +128,7 @@ public function test(Category $initialCategory, Category $category)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->indexManagement->open();
$this->indexManagement->getMainBlock()->massaction([], 'Update on Save', false, 'Select All');
diff --git a/dev/tests/functional/tests/app/Magento/Persistent/Test/TestCase/CheckoutWithPersistentShoppingCartTest.php b/dev/tests/functional/tests/app/Magento/Persistent/Test/TestCase/CheckoutWithPersistentShoppingCartTest.php
index 49d4dfe7c2430..8921fa43fb3f1 100644
--- a/dev/tests/functional/tests/app/Magento/Persistent/Test/TestCase/CheckoutWithPersistentShoppingCartTest.php
+++ b/dev/tests/functional/tests/app/Magento/Persistent/Test/TestCase/CheckoutWithPersistentShoppingCartTest.php
@@ -171,7 +171,7 @@ public function test($configData, CatalogProductSimple $product, Customer $custo
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/AddProductVideoTest.php b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/AddProductVideoTest.php
index 2969cc261b00d..6fa1e07622509 100644
--- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/AddProductVideoTest.php
+++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/AddProductVideoTest.php
@@ -109,7 +109,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->configData) {
$this->objectManager->create(
diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/DeleteProductVideoTest.php b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/DeleteProductVideoTest.php
index 680859e7e8ce7..7daa50b9dec33 100644
--- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/DeleteProductVideoTest.php
+++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/DeleteProductVideoTest.php
@@ -116,7 +116,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->configData) {
$this->objectManager->create(
diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/UpdateProductVideoTest.php b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/UpdateProductVideoTest.php
index eb1fe3b576ec8..1aeb12ab70b39 100644
--- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/UpdateProductVideoTest.php
+++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/TestCase/UpdateProductVideoTest.php
@@ -120,7 +120,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->configData) {
$this->objectManager->create(
diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.php
index 1a4cb787bf1c7..d53134289b813 100644
--- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ProductsInCartReportEntityTest.php
@@ -116,7 +116,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ReviewReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ReviewReportEntityTest.php
index 8f281ed74f5f1..c0c17c497b1f2 100644
--- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ReviewReportEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ReviewReportEntityTest.php
@@ -169,7 +169,7 @@ private function loginCustomer(Customer $customer)
*
* return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->customerAccountLogout->open();
}
diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php
index 8ed45d1e67f6e..0571a6dbb0533 100644
--- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php
@@ -215,7 +215,7 @@ protected function processOrder($orderSteps, OrderInjectable $order)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$deleteTaxRule = $this->objectManager->create(\Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep::class);
$deleteTaxRule->run();
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductRatingEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductRatingEntityTest.php
index 320da6c1bfdbb..10e84604957de 100644
--- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductRatingEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductRatingEntityTest.php
@@ -117,7 +117,7 @@ public function testCreateProductRatingEntityTest(Rating $productRating)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if (!($this->productRating instanceof Rating)) {
return;
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php
index d55ec7226f78f..593f14b023ef3 100644
--- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php
@@ -129,7 +129,7 @@ public function test(Review $review)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->ratingIndex->open();
if ($this->review instanceof Review) {
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php
index b8a4034fffe49..057efd63a3ebc 100644
--- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php
@@ -116,7 +116,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->review instanceof Review) {
$ratings = $this->review->getRatings();
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php
index 543d090dff4db..840f1fb501e35 100644
--- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/ManageProductReviewFromCustomerPageTest.php
@@ -201,7 +201,7 @@ protected function login(Customer $customer)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->ratingIndex->open();
if ($this->reviewInitial instanceof Review) {
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/MassActionsProductReviewEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/MassActionsProductReviewEntityTest.php
index da5e7101e4b33..b567149cd1005 100644
--- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/MassActionsProductReviewEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/MassActionsProductReviewEntityTest.php
@@ -111,7 +111,7 @@ public function test($gridActions, $gridStatus)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->ratingIndex->open();
if ($this->review instanceof Review) {
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php
index 075912bf24df3..fe772accc5fd2 100644
--- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php
@@ -169,7 +169,7 @@ protected function createReview($review, $rating)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if (!$this->reviewInitial instanceof Review) {
return;
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityTest.php
index 9af76451d8ae0..a721f8e422465 100644
--- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityTest.php
@@ -124,7 +124,7 @@ public function test(Review $reviewInitial, Review $review)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->ratingIndex->open();
if ($this->review instanceof Review) {
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AssignCustomOrderStatusTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AssignCustomOrderStatusTest.php
index fd65d6ff164d7..156fc2e52417a 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AssignCustomOrderStatusTest.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AssignCustomOrderStatusTest.php
@@ -162,7 +162,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->order) {
$this->orderIndex->open()->getSalesOrderGrid()->massaction([['id' => $this->order->getId()]], 'Cancel');
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CancelCreatedOrderTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CancelCreatedOrderTest.php
index 20fe0c8f55ccb..36cb45ce90bcf 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CancelCreatedOrderTest.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CancelCreatedOrderTest.php
@@ -101,7 +101,7 @@ public function test(OrderInjectable $order, TestStepFactory $stepFactory, $conf
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderFromEditCustomerPageTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderFromEditCustomerPageTest.php
index c6067437fee4a..50e31ab2a5807 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderFromEditCustomerPageTest.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderFromEditCustomerPageTest.php
@@ -319,7 +319,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyComparedProductsOnOrderPageTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyComparedProductsOnOrderPageTest.php
index cf93da5e9f6fb..1489482d87917 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyComparedProductsOnOrderPageTest.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveRecentlyComparedProductsOnOrderPageTest.php
@@ -146,7 +146,7 @@ public function __inject(
$this->catalogProductCompare = $catalogProductCompare;
}
- public function setUp()
+ public function setUp(): void
{
$this->config->setConfig('reports/options/enabled', 1);
parent::setUp();
@@ -187,7 +187,7 @@ public function test(Customer $customer, $products, $productsIsConfigured = fals
return ['products' => $products, 'productsIsConfigured' => $productsIsConfigured];
}
- public function tearDown()
+ public function tearDown(): void
{
$this->config->setConfig('reports/options/enabled', 0);
parent::tearDown();
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php
index 91b4f711700b5..1d04e68ad439d 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php
@@ -163,7 +163,7 @@ public function test(Customer $customer, $product)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->customerAccountLogout->open();
}
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.php
index 9eb13734531d9..478561c2f46f9 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.php
@@ -79,7 +79,7 @@ public function test()
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->envWhitelist->removeHost('example.com');
$this->browser->closeWindow();
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UpdateCustomOrderStatusTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UpdateCustomOrderStatusTest.php
index be53aa9ab1471..ea92e2f167c83 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UpdateCustomOrderStatusTest.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/UpdateCustomOrderStatusTest.php
@@ -152,7 +152,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->order->hasData('id')) {
$this->orderIndex->open()->getSalesOrderGrid()->massaction([['id' => $this->order->getId()]], 'Cancel');
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ApplySeveralSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ApplySeveralSalesRuleEntityTest.php
index 6d6861c60d1d8..134189073d168 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ApplySeveralSalesRuleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ApplySeveralSalesRuleEntityTest.php
@@ -79,7 +79,7 @@ public function testApplySeveralSalesRules(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\SalesRule\Test\TestStep\DeleteAllSalesRuleStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php
index cffb18f0a9552..409dab770faa8 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php
@@ -184,7 +184,7 @@ protected function prepareCondition(CatalogProductSimple $productSimple, $condit
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$filter = [
'name' => $this->salesRuleName,
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ShoppingCartWithFreeShippingAndFlatRateTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ShoppingCartWithFreeShippingAndFlatRateTest.php
index 73eb6f7b291f4..edbe5e05fdd2d 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ShoppingCartWithFreeShippingAndFlatRateTest.php
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ShoppingCartWithFreeShippingAndFlatRateTest.php
@@ -150,7 +150,7 @@ public function testRuleWithFreeShippingAndFlatRate(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->testStepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ShoppingCartWithFreeShippingTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ShoppingCartWithFreeShippingTest.php
index aa6b89ece8e5c..c3276214838e1 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ShoppingCartWithFreeShippingTest.php
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ShoppingCartWithFreeShippingTest.php
@@ -70,7 +70,7 @@ public function testRuleWithFreeShippingByWeight(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->testStepFactory->create(\Magento\SalesRule\Test\TestStep\DeleteAllSalesRuleStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php
index 5f9f3e0756659..8d195973c5892 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/UpdateSalesRuleEntityTest.php
@@ -131,7 +131,7 @@ public function testUpdateSalesRule(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$filter = [
'name' => $this->salesRuleName,
diff --git a/dev/tests/functional/tests/app/Magento/Search/Test/TestCase/AdvancedSearchWithAttributeTest.php b/dev/tests/functional/tests/app/Magento/Search/Test/TestCase/AdvancedSearchWithAttributeTest.php
index 01d01b83aa37f..1c3d6a330a4a6 100644
--- a/dev/tests/functional/tests/app/Magento/Search/Test/TestCase/AdvancedSearchWithAttributeTest.php
+++ b/dev/tests/functional/tests/app/Magento/Search/Test/TestCase/AdvancedSearchWithAttributeTest.php
@@ -378,7 +378,7 @@ public function test(
*
* @return void
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->productAttributePage->open();
$this->productAttributePage->getGrid()->searchAndOpen(['attribute_code' => $this->attributeForSearch['name']]);
diff --git a/dev/tests/functional/tests/app/Magento/Search/Test/TestCase/CreateMultipleSynonymGroupsTest.php b/dev/tests/functional/tests/app/Magento/Search/Test/TestCase/CreateMultipleSynonymGroupsTest.php
index f101b510a6e02..15bb2be1ddf4d 100644
--- a/dev/tests/functional/tests/app/Magento/Search/Test/TestCase/CreateMultipleSynonymGroupsTest.php
+++ b/dev/tests/functional/tests/app/Magento/Search/Test/TestCase/CreateMultipleSynonymGroupsTest.php
@@ -66,7 +66,7 @@ public function test(array $synonymGroups)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\Search\Test\TestStep\DeleteAllSynonymGroupsStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.php
index 778b04047952d..dd349188ad860 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.php
@@ -128,7 +128,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.php
index 5a62b0d599ca4..646f133fde831 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.php
@@ -127,7 +127,7 @@ public function testLockAdminUser(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewUserTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewUserTest.php
index 908f07456e0d8..b16f73f357536 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewUserTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewUserTest.php
@@ -124,7 +124,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingIntegrationTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingIntegrationTest.php
index 6927fa900cbdf..0554c82a919ac 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingIntegrationTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingIntegrationTest.php
@@ -134,7 +134,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingRoleTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingRoleTest.php
index 5ea41f9c117b9..fc18b91d62e30 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingRoleTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingRoleTest.php
@@ -130,7 +130,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.php
index 5e588d73fce64..f9e023833c3c9 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.php
@@ -123,7 +123,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.php
index d86346ae9a08b..2221d04563a80 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.php
@@ -140,7 +140,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.php
index fd2cf1a84806e..db10bc9ac5d53 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.php
@@ -101,7 +101,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/RegisterCustomerEntityWithDifferentPasswordClassesTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/RegisterCustomerEntityWithDifferentPasswordClassesTest.php
index 731aa77703e4e..5217d291ca176 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/RegisterCustomerEntityWithDifferentPasswordClassesTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/RegisterCustomerEntityWithDifferentPasswordClassesTest.php
@@ -96,7 +96,7 @@ public function test(Customer $customer, ConfigData $config)
*
* @return void
*/
- protected function tearDown()
+ protected function tearDown(): void
{
//Set default required character classes for the password
$this->objectManager->create(
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.php
index 9d8b994e82231..30afc7e47964c 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.php
@@ -81,7 +81,7 @@ public function test(Customer $initialCustomer, Customer $customer)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.php
index aa4617d62fb03..968f88a5abfc8 100644
--- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.php
+++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.php
@@ -84,7 +84,7 @@ public function test(Customer $initialCustomer, Customer $customer, $check)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php
index e25dfd59402b4..b3da5ed6f6605 100644
--- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php
@@ -131,7 +131,7 @@ public function testGenerateSitemap(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->configData !== null) {
$this->stepFactory->create(
diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/AccessAdminWithStoreCodeInUrlTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/AccessAdminWithStoreCodeInUrlTest.php
index 540d848ff742b..ce66f68664a32 100644
--- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/AccessAdminWithStoreCodeInUrlTest.php
+++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/AccessAdminWithStoreCodeInUrlTest.php
@@ -72,7 +72,7 @@ public function test($configData)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->stepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.php
index 659d35b1d40de..a9849476e1628 100644
--- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.php
@@ -106,7 +106,7 @@ public function test(Store $storeInitial, Store $store)
/**
* {@inheritdoc}
*/
- protected function tearDown()
+ protected function tearDown(): void
{
if ($this->storeInitial->getCode() == 'default') {
$this->restoreDefaultStoreViewStep->run();
diff --git a/dev/tests/functional/tests/app/Magento/Swagger/Test/TestCase/SwaggerUiForRestApiTest.php b/dev/tests/functional/tests/app/Magento/Swagger/Test/TestCase/SwaggerUiForRestApiTest.php
index c9ee4de641b14..73c9cb541c3ac 100644
--- a/dev/tests/functional/tests/app/Magento/Swagger/Test/TestCase/SwaggerUiForRestApiTest.php
+++ b/dev/tests/functional/tests/app/Magento/Swagger/Test/TestCase/SwaggerUiForRestApiTest.php
@@ -89,7 +89,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
foreach ($this->endpoints as $endpoint) {
$this->swaggerPage->closeEndpointContent($this->serviceName, $endpoint);
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.php
index c4d40ccb72eb7..fdc70d9779aaf 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.php
@@ -192,7 +192,7 @@ private function updateCustomer($customerGroup)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
parent::tearDown();
$this->objectManager->create(\Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep::class)->run();
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php
index a44fd4036db4e..f31480d4e32fe 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.php
@@ -80,7 +80,7 @@ public function testCreateTaxRule(TaxRule $taxRule)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep::class, [])->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php
index 40d3401a207a4..e1b63b6696116 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxWithCrossBorderTest.php
@@ -138,7 +138,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if (isset($this->salesRule)) {
$this->objectManager->create(\Magento\SalesRule\Test\TestStep\DeleteAllSalesRuleStep::class)->run();
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php
index acbc8707cfeef..c72c124b97b42 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.php
@@ -101,7 +101,7 @@ public function testUpdateTaxRule(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep::class, [])->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.php
index 81d9fe8393aee..3fadbca1e1bcf 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.php
@@ -132,7 +132,7 @@ public function testDeleteAdminUserEntity(
*
* return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->dashboard->getAdminPanelHeader()->logOut();
}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php
index 2a1c9feb440b9..009a4fb88f849 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php
@@ -131,7 +131,7 @@ public function testDeleteAdminUserRole(
*
* return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->dashboard->getAdminPanelHeader()->logOut();
}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UnlockAdminUserTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UnlockAdminUserTest.php
index 6a43be4afd422..2edf28db23aac 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UnlockAdminUserTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UnlockAdminUserTest.php
@@ -138,7 +138,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->testStepFactory->create(
\Magento\Config\Test\TestStep\SetupConfigurationStep::class,
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php
index dab4cec22c86d..d5181d26f1e26 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php
@@ -184,7 +184,7 @@ protected function mergeUsers(User $initialUser, User $user)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->dashboard->getAdminPanelHeader()->isVisible()) {
$this->dashboard->getAdminPanelHeader()->logOut();
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php
index c7031e9fccbeb..6bf4fd1998039 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php
@@ -121,7 +121,7 @@ public function testUpdateAdminUserRolesEntity(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
sleep(3);
$modalMessage = $this->dashboard->getModalMessage();
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdatePasswordUserEntityPciRequirementsTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdatePasswordUserEntityPciRequirementsTest.php
index b837bcbf2c53a..0d4457a72f32d 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdatePasswordUserEntityPciRequirementsTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdatePasswordUserEntityPciRequirementsTest.php
@@ -122,7 +122,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->dashboard->getAdminPanelHeader()->isVisible()) {
$this->dashboard->getAdminPanelHeader()->logOut();
diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.php b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.php
index 331d30885eb59..814d3831f0b75 100644
--- a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/UpdateCustomVariableEntityTest.php
@@ -137,7 +137,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
if ($this->store !== null) {
$storeIndex = $this->objectManager->create(\Magento\Backend\Test\Page\Adminhtml\StoreIndex::class);
diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php
index 6fda738c6fdc4..5355eddd425e8 100644
--- a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php
+++ b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php
@@ -126,7 +126,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep::class)->run();
$this->objectManager->create(
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php
index d24ac5f915e52..42a12555b1ab7 100644
--- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php
@@ -82,7 +82,7 @@ public function __inject(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\Widget\Test\TestStep\DeleteAllWidgetsStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.php b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.php
index e598f8da66f40..feb42e31c9785 100644
--- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.php
@@ -78,7 +78,7 @@ private function adjustCacheSettings()
*
* return void
*/
- public function tearDown()
+ public function tearDown(): void
{
parent::tearDown();
if (!empty($this->caches)) {
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetsEntityTest.php b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetsEntityTest.php
index 48d4472d99b22..101f922440739 100644
--- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetsEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetsEntityTest.php
@@ -50,7 +50,7 @@ public function test(array $widgets, FixtureFactory $fixtureFactory)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->objectManager->create(\Magento\Widget\Test\TestStep\DeleteAllWidgetsStep::class)->run();
}
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php
index c12b2d0991224..4bc44bcd9d6f2 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php
@@ -80,7 +80,7 @@ public function test(Customer $customer, $product, $configure = true)
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->envWhitelist->removeHost('example.com');
}
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php
index 27c60281660bb..227cb79273e7b 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php
@@ -99,7 +99,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->envWhitelist->removeHost('example.com');
}
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php
index 1bba73cdf5e9f..b39969cb385d8 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php
@@ -93,7 +93,7 @@ public function test(
*
* @return void
*/
- public function tearDown()
+ public function tearDown(): void
{
$this->envWhitelist->removeHost('example.com');
}
diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig/composer.json b/dev/tests/integration/_files/Magento/TestModuleCspConfig/composer.json
index f4d4075fe3377..6faae682beedf 100644
--- a/dev/tests/integration/_files/Magento/TestModuleCspConfig/composer.json
+++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig/composer.json
@@ -1,21 +1,21 @@
{
- "name": "magento/module-csp-config",
- "description": "test csp module",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
- "magento/framework": "*",
- "magento/module-integration": "*"
- },
- "type": "magento2-module",
- "extra": {
- "map": [
- [
- "*",
- "Magento/TestModuleCspConfig"
- ]
- ]
- }
+ "name": "magento/module-csp-config",
+ "description": "test csp module",
+ "config": {
+ "sort-packages": true
+ },
+ "require": {
+ "php": "~7.3.0||~7.4.0",
+ "magento/framework": "*",
+ "magento/module-integration": "*"
+ },
+ "type": "magento2-module",
+ "extra": {
+ "map": [
+ [
+ "*",
+ "Magento/TestModuleCspConfig"
+ ]
+ ]
+ }
}
diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig2/composer.json b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/composer.json
index ebf1d57fe6593..0980df2635592 100644
--- a/dev/tests/integration/_files/Magento/TestModuleCspConfig2/composer.json
+++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/composer.json
@@ -1,21 +1,21 @@
{
- "name": "magento/module-csp-config2",
- "description": "test csp module 2",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
- "magento/framework": "*",
- "magento/module-integration": "*"
- },
- "type": "magento2-module",
- "extra": {
- "map": [
- [
- "*",
- "Magento/TestModuleCspConfig2"
- ]
- ]
- }
+ "name": "magento/module-csp-config2",
+ "description": "test csp module 2",
+ "config": {
+ "sort-packages": true
+ },
+ "require": {
+ "php": "~7.3.0||~7.4.0",
+ "magento/framework": "*",
+ "magento/module-integration": "*"
+ },
+ "type": "magento2-module",
+ "extra": {
+ "map": [
+ [
+ "*",
+ "Magento/TestModuleCspConfig2"
+ ]
+ ]
+ }
}
diff --git a/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfigOverride/composer.json b/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfigOverride/composer.json
index 4c124d7c1d7bc..e6695566bed28 100644
--- a/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfigOverride/composer.json
+++ b/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfigOverride/composer.json
@@ -2,7 +2,7 @@
"name": "magento/module-test-module-message-queue-config-override",
"description": "test module for message queue configuration",
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/module-integration": "*"
},
diff --git a/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfiguration/composer.json b/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfiguration/composer.json
index eb168da3add15..aeb5c68f40978 100644
--- a/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfiguration/composer.json
+++ b/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfiguration/composer.json
@@ -2,7 +2,7 @@
"name": "magento/module-test-module-message-queue-configuration",
"description": "test module for message queue configuration",
"require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
+ "php": "~7.3.0||~7.4.0",
"magento/framework": "*",
"magento/module-integration": "*"
},
diff --git a/dev/tests/integration/_files/Magento/TestModuleSample/composer.json b/dev/tests/integration/_files/Magento/TestModuleSample/composer.json
index 29e9663e49a66..9e174fa49e563 100644
--- a/dev/tests/integration/_files/Magento/TestModuleSample/composer.json
+++ b/dev/tests/integration/_files/Magento/TestModuleSample/composer.json
@@ -1,21 +1,21 @@
{
- "name": "magento/module-sample-test",
- "description": "test sample module",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~7.1.3||~7.2.0||~7.3.0",
- "magento/framework": "*",
- "magento/module-integration": "*"
- },
- "type": "magento2-module",
- "extra": {
- "map": [
- [
- "*",
- "Magento/TestModuleSample"
- ]
- ]
- }
+ "name": "magento/module-sample-test",
+ "description": "test sample module",
+ "config": {
+ "sort-packages": true
+ },
+ "require": {
+ "php": "~7.3.0||~7.4.0",
+ "magento/framework": "*",
+ "magento/module-integration": "*"
+ },
+ "type": "magento2-module",
+ "extra": {
+ "map": [
+ [
+ "*",
+ "Magento/TestModuleSample"
+ ]
+ ]
+ }
}
diff --git a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php
index 5b9e4386b7015..f569c515821c4 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php
@@ -10,78 +10,81 @@
class Listener implements \PHPUnit\Framework\TestListener
{
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
+ public function addError(\PHPUnit\Framework\Test $test, \Throwable $t, float $time): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, $time)
- {
+ public function addFailure(
+ \PHPUnit\Framework\Test $test,
+ \PHPUnit\Framework\AssertionFailedError $e,
+ float $time
+ ): void {
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
+ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Throwable $t, float $time): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
+ public function addRiskyTest(\PHPUnit\Framework\Test $test, \Throwable $t, float $time): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
+ public function addSkippedTest(\PHPUnit\Framework\Test $test, \Throwable $t, float $time): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
- public function startTestSuite(\PHPUnit\Framework\TestSuite $suite)
+ public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
- public function endTestSuite(\PHPUnit\Framework\TestSuite $suite)
+ public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
- public function startTest(\PHPUnit\Framework\Test $test)
+ public function startTest(\PHPUnit\Framework\Test $test): void
{
$this->logger = Helper\Bootstrap::getObjectManager()->get(\Magento\TestFramework\ErrorLog\Logger::class);
$this->logger->clearMessages();
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function endTest(\PHPUnit\Framework\Test $test, $time)
+ public function endTest(\PHPUnit\Framework\Test $test, float $time): void
{
if ($test instanceof \PHPUnit\Framework\TestCase) {
$messages = $this->logger->getMessages();
@@ -100,9 +103,9 @@ public function endTest(\PHPUnit\Framework\Test $test, $time)
}
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
- public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Warning $e, $time)
+ public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Warning $e, float $time): void
{
}
}
diff --git a/dev/tests/integration/framework/Magento/TestFramework/Event/PhpUnit.php b/dev/tests/integration/framework/Magento/TestFramework/Event/PhpUnit.php
index 6e56cecd1c42f..ed0b7c5c05a7b 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/Event/PhpUnit.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/Event/PhpUnit.php
@@ -34,8 +34,6 @@ public static function setDefaultEventManager(\Magento\TestFramework\EventManage
}
/**
- * Constructor
- *
* @param \Magento\TestFramework\EventManager $eventManager
* @throws \Magento\Framework\Exception\LocalizedException
*/
@@ -48,54 +46,57 @@ public function __construct(\Magento\TestFramework\EventManager $eventManager =
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
+ public function addError(\PHPUnit\Framework\Test $test, \Throwable $t, float $time): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, $time)
- {
+ public function addFailure(
+ \PHPUnit\Framework\Test $test,
+ \PHPUnit\Framework\AssertionFailedError $e,
+ float $time
+ ): void {
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
+ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Throwable $t, float $time): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
+ public function addRiskyTest(\PHPUnit\Framework\Test $test, \Throwable $t, float $time): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
+ public function addSkippedTest(\PHPUnit\Framework\Test $test, \Throwable $t, float $time): void
{
}
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
- public function startTestSuite(\PHPUnit\Framework\TestSuite $suite)
+ public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void
{
/* PHPUnit runs tests with data provider in own test suite for each test, so just skip such test suites */
if ($suite instanceof \PHPUnit\Framework\DataProviderTestSuite) {
@@ -105,9 +106,9 @@ public function startTestSuite(\PHPUnit\Framework\TestSuite $suite)
}
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
- public function endTestSuite(\PHPUnit\Framework\TestSuite $suite)
+ public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void
{
if ($suite instanceof \PHPUnit\Framework\DataProviderTestSuite) {
return;
@@ -116,9 +117,9 @@ public function endTestSuite(\PHPUnit\Framework\TestSuite $suite)
}
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
- public function startTest(\PHPUnit\Framework\Test $test)
+ public function startTest(\PHPUnit\Framework\Test $test): void
{
if (!$test instanceof \PHPUnit\Framework\TestCase || $test instanceof \PHPUnit\Framework\Warning) {
return;
@@ -127,10 +128,10 @@ public function startTest(\PHPUnit\Framework\Test $test)
}
/**
- * {@inheritdoc}
+ * @inheritDoc
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function endTest(\PHPUnit\Framework\Test $test, $time)
+ public function endTest(\PHPUnit\Framework\Test $test, float $time): void
{
if (!$test instanceof \PHPUnit\Framework\TestCase || $test instanceof \PHPUnit\Framework\Warning) {
return;
@@ -139,9 +140,9 @@ public function endTest(\PHPUnit\Framework\Test $test, $time)
}
/**
- * {@inheritdoc}
+ * @inheritDoc
*/
- public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Warning $e, $time)
+ public function addWarning(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Warning $e, float $time): void
{
}
}
diff --git a/dev/tests/integration/framework/Magento/TestFramework/Indexer/TestCase.php b/dev/tests/integration/framework/Magento/TestFramework/Indexer/TestCase.php
index 7d55a5827a788..b9a481e97c9a3 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/Indexer/TestCase.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/Indexer/TestCase.php
@@ -7,7 +7,7 @@
class TestCase extends \PHPUnit\Framework\TestCase
{
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
$db = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getBootstrap()
->getApplication()
diff --git a/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php b/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php
index 6936f15cdec5c..7319575426812 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php
@@ -5,7 +5,7 @@
*/
namespace Magento\TestFramework\Listener;
-class ExtededTestdox extends \PHPUnit_Util_Printer implements \PHPUnit\Framework\TestListener
+class ExtededTestdox extends \PHPUnit\Util\Printer implements \PHPUnit\Framework\TestListener
{
/**
* @var \PHPUnit_Util_TestDox_NamePrettifier
@@ -76,7 +76,7 @@ public function __construct($out = null)
{
parent::__construct($out);
- $this->prettifier = new \PHPUnit_Util_TestDox_NamePrettifier();
+ $this->prettifier = new \PHPUnit\Util\TestDox\NamePrettifier();
$this->startRun();
}
@@ -103,7 +103,7 @@ public function flush()
public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
{
if ($test instanceof $this->testTypeOfInterest) {
- $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_ERROR;
+ $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_ERROR;
$this->failed++;
}
}
@@ -119,7 +119,7 @@ public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, $time)
{
if ($test instanceof $this->testTypeOfInterest) {
- $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE;
+ $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_FAILURE;
$this->failed++;
}
}
@@ -135,7 +135,7 @@ public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\Ass
public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
{
if ($test instanceof $this->testTypeOfInterest) {
- $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE;
+ $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_INCOMPLETE;
$this->incomplete++;
}
}
@@ -152,7 +152,7 @@ public function addIncompleteTest(\PHPUnit\Framework\Test $test, \Exception $e,
public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
{
if ($test instanceof $this->testTypeOfInterest) {
- $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED;
+ $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_SKIPPED;
$this->skipped++;
}
}
@@ -169,7 +169,7 @@ public function addSkippedTest(\PHPUnit\Framework\Test $test, \Exception $e, $ti
public function addRiskyTest(\PHPUnit\Framework\Test $test, \Exception $e, $time)
{
if ($test instanceof $this->testTypeOfInterest) {
- $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_RISKY;
+ $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_RISKY;
$this->risky++;
}
}
@@ -220,7 +220,7 @@ public function startTest(\PHPUnit\Framework\Test $test)
$this->write('.');
$this->currentTestMethodPrettified = $this->prettifier->prettifyTestMethod($test->getName(false));
- $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_PASSED;
+ $this->testStatus = \PHPUnit\Runner\BaseTestRunner::STATUS_PASSED;
}
}
@@ -237,13 +237,13 @@ public function endTest(\PHPUnit\Framework\Test $test, $time)
$this->tests[$this->currentTestMethodPrettified] = ['success' => 0, 'failure' => 0, 'time' => 0];
}
- if ($this->testStatus == \PHPUnit_Runner_BaseTestRunner::STATUS_PASSED) {
+ if ($this->testStatus == \PHPUnit\Runner\BaseTestRunner::STATUS_PASSED) {
$this->tests[$this->currentTestMethodPrettified]['success']++;
}
- if ($this->testStatus == \PHPUnit_Runner_BaseTestRunner::STATUS_ERROR) {
+ if ($this->testStatus == \PHPUnit\Runner\BaseTestRunner::STATUS_ERROR) {
$this->tests[$this->currentTestMethodPrettified]['failure']++;
}
- if ($this->testStatus == \PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE) {
+ if ($this->testStatus == \PHPUnit\Runner\BaseTestRunner::STATUS_FAILURE) {
$this->tests[$this->currentTestMethodPrettified]['failure']++;
}
$this->tests[$this->currentTestMethodPrettified]['time'] += $time;
diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php
index 920cde4b7df09..bf8ca0dc51b18 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php
@@ -53,7 +53,7 @@ abstract class AbstractBackendController extends \Magento\TestFramework\TestCase
*
* @throws \Magento\Framework\Exception\AuthenticationException
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -82,7 +82,7 @@ protected function _getAdminCredentials()
/**
* @inheritDoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_auth->getAuthStorage()->destroy(['send_expire_cookie' => false]);
$this->_auth = null;
diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php
index 92ac7ddd468ab..8e3af941a5dd8 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php
@@ -23,7 +23,7 @@ abstract class AbstractConfigFiles extends \PHPUnit\Framework\TestCase
protected $_reader;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
protected $_fileResolverMock;
@@ -37,7 +37,7 @@ abstract class AbstractConfigFiles extends \PHPUnit\Framework\TestCase
*/
protected $componentRegistrar;
- public function setUp()
+ protected function setUp(): void
{
$this->componentRegistrar = new ComponentRegistrar();
$this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -51,7 +51,7 @@ public function setUp()
$validateStateMock = $this->getMockBuilder(
\Magento\Framework\Config\ValidationStateInterface::class
)->disableOriginalConstructor()->getMock();
- $validateStateMock->expects($this->any())->method('isValidationRequired')->will($this->returnValue(true));
+ $validateStateMock->expects($this->any())->method('isValidationRequired')->willReturn(true);
$this->_reader = $this->_objectManager->create(
$this->_getReaderClassName(),
@@ -66,7 +66,7 @@ public function setUp()
}
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_objectManager->removeSharedInstance($this->_getReaderClassName());
}
@@ -102,7 +102,7 @@ public function testMergedConfig()
// have the file resolver return all relevant xml files
$this->_fileResolverMock->expects($this->any())
->method('get')
- ->will($this->returnValue($this->getXmlConfigFiles()));
+ ->willReturn($this->getXmlConfigFiles());
try {
// this will merge all xml files and validate them
diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php
index d2a6bb7da9abd..9ec18038c9810 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php
@@ -68,7 +68,7 @@ protected function _getBootstrap()
/**
* Bootstrap application before any test
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->_assertSessionErrors = false;
$this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -79,7 +79,7 @@ protected function setUp()
/**
* @inheritDoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_request = null;
$this->_response = null;
@@ -89,7 +89,7 @@ protected function tearDown()
/**
* Ensure that there were no error messages displayed on the admin panel
*/
- protected function assertPostConditions()
+ protected function assertPostConditions(): void
{
if ($this->_assertSessionErrors) {
// equalTo() is intentionally used instead of isEmpty() to provide the informative diff
@@ -112,7 +112,7 @@ public function dispatch($uri)
$request->setDispatched(false);
$request->setRequestUri($uri);
if ($request->isPost()
- && !array_key_exists('form_key', $request->getPost())
+ && !property_exists($request->getPost(), 'form_key')
) {
/** @var FormKey $formKey */
$formKey = $this->_objectManager->get(FormKey::class);
@@ -164,7 +164,7 @@ public function getResponse()
public function assert404NotFound()
{
$this->assertEquals('noroute', $this->getRequest()->getControllerName());
- $this->assertContains('404 Not Found', $this->getResponse()->getBody());
+ $this->assertStringContainsString('404 Not Found', $this->getResponse()->getBody());
}
/**
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AdminConfigFixtureTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AdminConfigFixtureTest.php
index 7b25c694e45dc..25def03f9a0a1 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AdminConfigFixtureTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AdminConfigFixtureTest.php
@@ -12,11 +12,11 @@
class AdminConfigFixtureTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var \Magento\TestFramework\Annotation\AdminConfigFixture|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Annotation\AdminConfigFixture|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_object;
- protected function setUp()
+ protected function setUp(): void
{
$this->_object = $this->createPartialMock(
\Magento\TestFramework\Annotation\AdminConfigFixture::class,
@@ -35,8 +35,8 @@ public function testConfig()
'_getConfigValue'
)->with(
'any_config'
- )->will(
- $this->returnValue('some_value')
+ )->willReturn(
+ 'some_value'
);
$this->_object->expects($this->at(1))->method('_setConfigValue')->with('any_config', 'some_value');
$this->_object->startTest($this);
@@ -64,8 +64,8 @@ public function testInitStoreAfter()
'_getConfigValue'
)->with(
'any_config'
- )->will(
- $this->returnValue('some_value')
+ )->willReturn(
+ 'some_value'
);
$this->_object->expects($this->at(1))->method('_setConfigValue')->with('any_config', 'some_value');
$this->_object->initStoreAfter();
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AppAreaTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AppAreaTest.php
index c89df3417ed71..8d064576d671e 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AppAreaTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AppAreaTest.php
@@ -16,16 +16,16 @@ class AppAreaTest extends \PHPUnit\Framework\TestCase
protected $_object;
/**
- * @var \Magento\TestFramework\Application|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Application|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_applicationMock;
/**
- * @var \PHPUnit\Framework\TestCase|\PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\TestCase|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_testCaseMock;
- protected function setUp()
+ protected function setUp(): void
{
$this->_testCaseMock = $this->createMock(\PHPUnit\Framework\TestCase::class);
$this->_applicationMock = $this->createMock(\Magento\TestFramework\Application::class);
@@ -39,8 +39,8 @@ protected function setUp()
*/
public function testGetTestAppArea($annotations, $expectedArea)
{
- $this->_testCaseMock->expects($this->once())->method('getAnnotations')->will($this->returnValue($annotations));
- $this->_applicationMock->expects($this->any())->method('getArea')->will($this->returnValue(null));
+ $this->_testCaseMock->expects($this->once())->method('getAnnotations')->willReturn($annotations);
+ $this->_applicationMock->expects($this->any())->method('getArea')->willReturn(null);
$this->_applicationMock->expects($this->once())->method('reinitialize');
$this->_applicationMock->expects($this->once())->method('loadArea')->with($expectedArea);
$this->_object->startTest($this->_testCaseMock);
@@ -63,12 +63,13 @@ public function getTestAppAreaDataProvider()
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testGetTestAppAreaWithInvalidArea()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$annotations = ['method' => ['magentoAppArea' => ['some_invalid_area']]];
- $this->_testCaseMock->expects($this->once())->method('getAnnotations')->will($this->returnValue($annotations));
+ $this->_testCaseMock->expects($this->once())->method('getAnnotations')->willReturn($annotations);
$this->_object->startTest($this->_testCaseMock);
}
@@ -81,7 +82,7 @@ public function testGetTestAppAreaWithInvalidArea()
public function testStartTestWithDifferentAreaCodes(string $areaCode)
{
$annotations = ['method' => ['magentoAppArea' => [$areaCode]]];
- $this->_testCaseMock->expects($this->once())->method('getAnnotations')->will($this->returnValue($annotations));
+ $this->_testCaseMock->expects($this->once())->method('getAnnotations')->willReturn($annotations);
$this->_applicationMock->expects($this->any())->method('getArea')->willReturn(null);
$this->_applicationMock->expects($this->once())->method('reinitialize');
$this->_applicationMock->expects($this->once())->method('loadArea')->with($areaCode);
@@ -91,10 +92,10 @@ public function testStartTestWithDifferentAreaCodes(string $areaCode)
public function testStartTestPreventDoubleAreaLoadingAfterReinitialization()
{
$annotations = ['method' => ['magentoAppArea' => ['global']]];
- $this->_testCaseMock->expects($this->once())->method('getAnnotations')->will($this->returnValue($annotations));
- $this->_applicationMock->expects($this->at(0))->method('getArea')->will($this->returnValue('adminhtml'));
+ $this->_testCaseMock->expects($this->once())->method('getAnnotations')->willReturn($annotations);
+ $this->_applicationMock->expects($this->at(0))->method('getArea')->willReturn('adminhtml');
$this->_applicationMock->expects($this->once())->method('reinitialize');
- $this->_applicationMock->expects($this->at(2))->method('getArea')->will($this->returnValue('global'));
+ $this->_applicationMock->expects($this->at(2))->method('getArea')->willReturn('global');
$this->_applicationMock->expects($this->never())->method('loadArea');
$this->_object->startTest($this->_testCaseMock);
}
@@ -102,8 +103,8 @@ public function testStartTestPreventDoubleAreaLoadingAfterReinitialization()
public function testStartTestPreventDoubleAreaLoading()
{
$annotations = ['method' => ['magentoAppArea' => ['adminhtml']]];
- $this->_testCaseMock->expects($this->once())->method('getAnnotations')->will($this->returnValue($annotations));
- $this->_applicationMock->expects($this->once())->method('getArea')->will($this->returnValue('adminhtml'));
+ $this->_testCaseMock->expects($this->once())->method('getAnnotations')->willReturn($annotations);
+ $this->_applicationMock->expects($this->once())->method('getArea')->willReturn('adminhtml');
$this->_applicationMock->expects($this->never())->method('reinitialize');
$this->_applicationMock->expects($this->never())->method('loadArea');
$this->_object->startTest($this->_testCaseMock);
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AppIsolationTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AppIsolationTest.php
index 176e2999914d3..dead87011b892 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AppIsolationTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/AppIsolationTest.php
@@ -17,17 +17,17 @@ class AppIsolationTest extends \PHPUnit\Framework\TestCase
protected $_object;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
protected $_application;
- protected function setUp()
+ protected function setUp(): void
{
$this->_application = $this->createPartialMock(\Magento\TestFramework\Application::class, ['reinitialize']);
$this->_object = new \Magento\TestFramework\Annotation\AppIsolation($this->_application);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_application = null;
$this->_object = null;
@@ -41,20 +41,22 @@ public function testStartTestSuite()
/**
* @magentoAppIsolation invalid
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testEndTestIsolationInvalid()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$this->_object->endTest($this);
}
/**
* @magentoAppIsolation enabled
* @magentoAppIsolation disabled
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testEndTestIsolationAmbiguous()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$this->_object->endTest($this);
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ComponentRegistrarFixtureTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ComponentRegistrarFixtureTest.php
index b42546f8c3c28..e9337075cf811 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ComponentRegistrarFixtureTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ComponentRegistrarFixtureTest.php
@@ -21,7 +21,7 @@ class ComponentRegistrarFixtureTest extends \PHPUnit\Framework\TestCase
const THEME_NAME = 'frontend/Magento/theme';
const LANGUAGE_NAME = 'magento_language';
- protected function setUp()
+ protected function setUp(): void
{
$this->componentRegistrar = new ComponentRegistrar();
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ConfigFixtureTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ConfigFixtureTest.php
index 547a634cfa98d..04dfbcb0cf464 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ConfigFixtureTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/ConfigFixtureTest.php
@@ -12,11 +12,11 @@
class ConfigFixtureTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var \Magento\TestFramework\Annotation\ConfigFixture|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Annotation\ConfigFixture|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_object;
- protected function setUp()
+ protected function setUp(): void
{
$this->_object = $this->createPartialMock(
\Magento\TestFramework\Annotation\ConfigFixture::class,
@@ -35,8 +35,8 @@ public function testGlobalConfig()
'_getConfigValue'
)->with(
'web/unsecure/base_url'
- )->will(
- $this->returnValue('http://localhost/')
+ )->willReturn(
+ 'http://localhost/'
);
$this->_object->expects(
$this->at(1)
@@ -71,8 +71,8 @@ public function testCurrentStoreConfig()
)->with(
'dev/restrict/allow_ips',
''
- )->will(
- $this->returnValue('127.0.0.1')
+ )->willReturn(
+ '127.0.0.1'
);
$this->_object->expects(
$this->at(1)
@@ -109,8 +109,8 @@ public function testSpecificStoreConfig()
)->with(
'dev/restrict/allow_ips',
'admin'
- )->will(
- $this->returnValue('192.168.0.1')
+ )->willReturn(
+ '192.168.0.1'
);
$this->_object->expects(
$this->at(1)
@@ -154,8 +154,8 @@ public function testInitStoreAfter()
'_getConfigValue'
)->with(
'web/unsecure/base_url'
- )->will(
- $this->returnValue('http://localhost/')
+ )->willReturn(
+ 'http://localhost/'
);
$this->_object->expects(
$this->at(1)
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/DataFixtureTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/DataFixtureTest.php
index 00af4419e1142..1d5b5004a66fe 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/DataFixtureTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/DataFixtureTest.php
@@ -15,11 +15,11 @@
class DataFixtureTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var \Magento\TestFramework\Annotation\DataFixture|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Annotation\DataFixture|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_object;
- protected function setUp()
+ protected function setUp(): void
{
$this->_object = $this->getMockBuilder(\Magento\TestFramework\Annotation\DataFixture::class)
->setMethods(['_applyOneFixture'])
@@ -40,10 +40,11 @@ public static function sampleFixtureTwoRollback()
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testConstructorException()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
new \Magento\TestFramework\Annotation\DataFixture(__DIR__ . '/non_existing_fixture_dir');
}
@@ -99,10 +100,11 @@ public function testDisabledDbIsolation()
/**
* @magentoDataFixture fixture\path\must\not\contain\backslash.php
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testStartTestTransactionRequestInvalidPath()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$this->_object->startTestTransactionRequest($this, new \Magento\TestFramework\Event\Param\Transaction());
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/DbIsolationTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/DbIsolationTest.php
index 407210976a3f9..90950a6597bdc 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/DbIsolationTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Annotation/DbIsolationTest.php
@@ -17,7 +17,7 @@ class DbIsolationTest extends \PHPUnit\Framework\TestCase
*/
protected $_object;
- protected function setUp()
+ protected function setUp(): void
{
$this->_object = new \Magento\TestFramework\Annotation\DbIsolation();
}
@@ -63,20 +63,22 @@ public function testStartTestTransactionRequestMethodIsolationDisabled()
/**
* @magentoDbIsolation invalid
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testStartTestTransactionRequestInvalidAnnotation()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$this->_object->startTestTransactionRequest($this, new \Magento\TestFramework\Event\Param\Transaction());
}
/**
* @magentoDbIsolation enabled
* @magentoDbIsolation disabled
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testStartTestTransactionRequestAmbiguousAnnotation()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$this->_object->startTestTransactionRequest($this, new \Magento\TestFramework\Event\Param\Transaction());
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/App/ConfigTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/App/ConfigTest.php
index 1ac68f57a76c2..84f1dfef294d4 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/App/ConfigTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/App/ConfigTest.php
@@ -19,7 +19,7 @@ class ConfigTest extends \PHPUnit\Framework\TestCase
*/
private $model;
- public function setUp()
+ protected function setUp(): void
{
$scopeCodeResolver = $this->getMockBuilder(ScopeCodeResolver::class)
->disableOriginalConstructor()
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php
index e0bba5bcf222c..3dc4182e699a8 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ApplicationTest.php
@@ -37,11 +37,11 @@ class ApplicationTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
- /** @var Shell|\PHPUnit_Framework_MockObject_MockObject $shell */
+ /** @var Shell|\PHPUnit\Framework\MockObject\MockObject $shell */
$shell = $this->createMock(Shell::class);
- /** @var ClassLoaderWrapper|\PHPUnit_Framework_MockObject_MockObject $autoloadWrapper */
+ /** @var ClassLoaderWrapper|\PHPUnit\Framework\MockObject\MockObject $autoloadWrapper */
$autoloadWrapper = $this->getMockBuilder(ClassLoaderWrapper::class)
->disableOriginalConstructor()->getMock();
$this->tempDir = '/temp/dir';
@@ -68,7 +68,7 @@ public function testConstructor()
$this->assertEquals($this->tempDir, $this->subject->getTempDir(), 'Temp directory is not set in Application');
$initParams = $this->subject->getInitParams();
- $this->assertInternalType('array', $initParams, 'Wrong initialization parameters type');
+ $this->assertIsArray($initParams, 'Wrong initialization parameters type');
$this->assertArrayHasKey(
Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS,
$initParams,
@@ -121,10 +121,10 @@ public function testPartialLoadArea(string $areaCode)
->with($this->identicalTo($areaCode))
->willReturn($area);
- /** @var ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject $objectManager */
+ /** @var ObjectManagerInterface|\PHPUnit\Framework\MockObject\MockObject $objectManager */
$objectManager = $this->getMockBuilder(ObjectManagerInterface::class)
->disableOriginalConstructor()
- ->getMock();
+ ->getMockForAbstractClass();
$objectManager->expects($this->once())
->method('configure')
->with($this->identicalTo([]));
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/DocBlockTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/DocBlockTest.php
index 6b1d3260a3bfe..27c1d5a52fa85 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/DocBlockTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/DocBlockTest.php
@@ -17,17 +17,17 @@ class DocBlockTest extends \PHPUnit\Framework\TestCase
protected $_object;
/**
- * @var \Magento\TestFramework\Application|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Application|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_application;
- protected function setUp()
+ protected function setUp(): void
{
$this->_object = new \Magento\TestFramework\Bootstrap\DocBlock(__DIR__);
$this->_application = $this->createMock(\Magento\TestFramework\Application::class);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_object = null;
$this->_application = null;
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/MemoryTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/MemoryTest.php
index 057e783db36ae..989b247d3ec46 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/MemoryTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/MemoryTest.php
@@ -17,16 +17,16 @@ class MemoryTest extends \PHPUnit\Framework\TestCase
protected $_object;
/**
- * @var \Magento\TestFramework\MemoryLimit|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\MemoryLimit|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_memoryLimit;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
protected $_activationPolicy;
- protected function setUp()
+ protected function setUp(): void
{
$this->_memoryLimit = $this->createPartialMock(\Magento\TestFramework\MemoryLimit::class, ['printStats']);
$this->_activationPolicy = $this->createPartialMock(\stdClass::class, ['register_shutdown_function']);
@@ -36,7 +36,7 @@ protected function setUp()
);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_memoryLimit = null;
$this->_activationPolicy = null;
@@ -44,11 +44,12 @@ protected function tearDown()
}
/**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Activation policy is expected to be a callable.
*/
public function testConstructorException()
{
+ $this->expectException(\InvalidArgumentException::class);
+ $this->expectExceptionMessage('Activation policy is expected to be a callable.');
+
new \Magento\TestFramework\Bootstrap\Memory($this->_memoryLimit, 'non_existing_callable');
}
@@ -60,8 +61,8 @@ public function testDisplayStats()
$this->once()
)->method(
'printStats'
- )->will(
- $this->returnValue('Dummy Statistics')
+ )->willReturn(
+ 'Dummy Statistics'
);
$this->_object->displayStats();
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/ProfilerTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/ProfilerTest.php
index e4f843faf7745..d80f00dde2294 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/ProfilerTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/ProfilerTest.php
@@ -21,7 +21,7 @@ class ProfilerTest extends \PHPUnit\Framework\TestCase
*/
protected $_driver;
- protected function setUp()
+ protected function setUp(): void
{
$this->expectOutputString('');
$this->_driver =
@@ -29,7 +29,7 @@ protected function setUp()
$this->_object = new \Magento\TestFramework\Bootstrap\Profiler($this->_driver);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_driver = null;
$this->_object = null;
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/SettingsTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/SettingsTest.php
index 9964ec7f8c508..332fb7f26b1ce 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/SettingsTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/SettingsTest.php
@@ -34,7 +34,7 @@ public function __construct($name = null, array $data = [], $dataName = '')
$this->_fixtureDir = realpath(__DIR__ . '/_files') . '/';
}
- protected function setUp()
+ protected function setUp(): void
{
$this->_object = new \Magento\TestFramework\Bootstrap\Settings(
$this->_fixtureDir,
@@ -56,17 +56,18 @@ protected function setUp()
);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_object = null;
}
/**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Base path 'non_existing_dir' has to be an existing directory.
*/
public function testConstructorNonExistingBaseDir()
{
+ $this->expectException(\InvalidArgumentException::class);
+ $this->expectExceptionMessage('Base path \'non_existing_dir\' has to be an existing directory.');
+
new \Magento\TestFramework\Bootstrap\Settings('non_existing_dir', []);
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php
index 2f278febfd133..8fa516e478966 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php
@@ -12,7 +12,7 @@
class BootstrapTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var \Magento\TestFramework\Bootstrap|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Bootstrap|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_object;
@@ -26,37 +26,37 @@ class BootstrapTest extends \PHPUnit\Framework\TestCase
];
/**
- * @var \Magento\TestFramework\Bootstrap\Settings|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Bootstrap\Settings|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_settings;
/**
- * @var \Magento\TestFramework\Bootstrap\Environment|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Bootstrap\Environment|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_envBootstrap;
/**
- * @var \Magento\TestFramework\Bootstrap\DocBlock|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Bootstrap\DocBlock|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_docBlockBootstrap;
/**
- * @var \Magento\TestFramework\Bootstrap\Profiler|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Bootstrap\Profiler|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_profilerBootstrap;
/**
- * @var \Magento\TestFramework\Bootstrap\MemoryFactory|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Bootstrap\MemoryFactory|\PHPUnit\Framework\MockObject\MockObject
*/
protected $memoryFactory;
/**
- * @var \Magento\Framework\Shell|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\Framework\Shell|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_shell;
/**
- * @var \Magento\TestFramework\Application|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Application|\PHPUnit\Framework\MockObject\MockObject
*/
private $application;
@@ -65,7 +65,7 @@ class BootstrapTest extends \PHPUnit\Framework\TestCase
*/
protected $_integrationTestsDir;
- protected function setUp()
+ protected function setUp(): void
{
$this->_integrationTestsDir = realpath(__DIR__ . '/../../../../../../');
$this->_settings = $this->createMock(\Magento\TestFramework\Bootstrap\Settings::class);
@@ -98,7 +98,7 @@ protected function setUp()
);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_object = null;
$this->_settings = null;
@@ -131,7 +131,7 @@ public function testRunBootstrap()
];
$this->_settings->expects($this->any())
->method('get')
- ->will($this->returnValueMap($settingsMap));
+ ->willReturnMap($settingsMap);
$memoryBootstrap = $this->createPartialMock(
\Magento\TestFramework\Bootstrap\Memory::class,
['activateStatsDisplaying', 'activateLimitValidation']
@@ -141,7 +141,7 @@ public function testRunBootstrap()
$this->memoryFactory->expects($this->once())
->method('create')
->with($memUsageLimit, $memLeakLimit)
- ->will($this->returnValue($memoryBootstrap));
+ ->willReturn($memoryBootstrap);
$this->_docBlockBootstrap->expects($this->once())
->method('registerAnnotations')
@@ -163,7 +163,7 @@ public function testRunBootstrapProfilerEnabled()
$this->memoryFactory->expects($this->once())
->method('create')
->with(0, 0)
- ->will($this->returnValue($memoryBootstrap));
+ ->willReturn($memoryBootstrap);
$settingsMap = [
['TESTS_PROFILER_FILE', '', 'profiler.csv'],
@@ -172,7 +172,7 @@ public function testRunBootstrapProfilerEnabled()
];
$this->_settings->expects($this->any())
->method('getAsFile')
- ->will($this->returnValueMap($settingsMap));
+ ->willReturnMap($settingsMap);
$this->_profilerBootstrap
->expects($this->once())
->method('registerFileProfiler')
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/Adapter/TransactionInterfaceTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/Adapter/TransactionInterfaceTest.php
index ff06dd044a7d5..6faaecd267da0 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/Adapter/TransactionInterfaceTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/Adapter/TransactionInterfaceTest.php
@@ -23,7 +23,7 @@ public function testBeginTransparentTransaction($class)
{
$connectionMock = $this->_getConnectionMock($class);
$uniqid = uniqid();
- $connectionMock->expects($this->once())->method('beginTransaction')->will($this->returnValue($uniqid));
+ $connectionMock->expects($this->once())->method('beginTransaction')->willReturn($uniqid);
$this->assertSame(0, $connectionMock->getTransactionLevel());
$this->assertEquals($uniqid, $connectionMock->beginTransparentTransaction());
$this->assertSame(0, $connectionMock->getTransactionLevel());
@@ -37,7 +37,7 @@ public function testRollbackTransparentTransaction($class)
{
$connectionMock = $this->_getConnectionMock($class);
$uniqid = uniqid();
- $connectionMock->expects($this->once())->method('rollback')->will($this->returnValue($uniqid));
+ $connectionMock->expects($this->once())->method('rollback')->willReturn($uniqid);
$connectionMock->beginTransparentTransaction();
$this->assertEquals($uniqid, $connectionMock->rollbackTransparentTransaction());
$this->assertSame(0, $connectionMock->getTransactionLevel());
@@ -51,7 +51,7 @@ public function testCommitTransparentTransaction($class)
{
$connectionMock = $this->_getConnectionMock($class);
$uniqid = uniqid();
- $connectionMock->expects($this->once())->method('commit')->will($this->returnValue($uniqid));
+ $connectionMock->expects($this->once())->method('commit')->willReturn($uniqid);
$connectionMock->beginTransparentTransaction();
$this->assertEquals($uniqid, $connectionMock->commitTransparentTransaction());
$this->assertSame(0, $connectionMock->getTransactionLevel());
@@ -77,7 +77,7 @@ public function transparentTransactionDataProvider()
* Instantiate specified adapter class and block all methods that would try to execute real queries
*
* @param string $class
- * @return \Magento\TestFramework\Db\Adapter\TransactionInterface|\PHPUnit_Framework_MockObject_MockObject
+ * @return \Magento\TestFramework\Db\Adapter\TransactionInterface|\PHPUnit\Framework\MockObject\MockObject
*/
protected function _getConnectionMock($class)
{
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php
index b961169713c85..f6e1f89a87100 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php
@@ -8,11 +8,11 @@
class EntityTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var \Magento\Framework\Model\AbstractModel|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\Framework\Model\AbstractModel|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = $this->createPartialMock(
\Magento\Framework\Model\AbstractModel::class,
@@ -51,11 +51,12 @@ public function deleteModelSuccessfully()
}
/**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Class 'stdClass' is irrelevant to the tested model
*/
public function testConstructorIrrelevantModelClass()
{
+ $this->expectException(\InvalidArgumentException::class);
+ $this->expectExceptionMessage('Class \'stdClass\' is irrelevant to the tested model');
+
new \Magento\TestFramework\Entity($this->_model, [], 'stdClass');
}
@@ -83,24 +84,24 @@ public function testTestCrud($saveCallback, $expectedException = null)
->method('load');
$this->_model->expects($this->atLeastOnce())
->method('save')
- ->will($this->returnCallback([$this, $saveCallback]));
+ ->willReturnCallback([$this, $saveCallback]);
/* It's important that 'delete' should be always called to guarantee the cleanup */
$this->_model->expects(
$this->atLeastOnce()
)->method(
'delete'
- )->will(
- $this->returnCallback([$this, 'deleteModelSuccessfully'])
+ )->willReturnCallback(
+ [$this, 'deleteModelSuccessfully']
);
- $this->_model->expects($this->any())->method('getIdFieldName')->will($this->returnValue('id'));
+ $this->_model->expects($this->any())->method('getIdFieldName')->willReturn('id');
$test = $this->getMockBuilder(\Magento\TestFramework\Entity::class)
->setMethods(['_getEmptyModel'])
->setConstructorArgs([$this->_model, ['test' => 'test']])
->getMock();
- $test->expects($this->any())->method('_getEmptyModel')->will($this->returnValue($this->_model));
+ $test->expects($this->any())->method('_getEmptyModel')->willReturn($this->_model);
$test->testCrud();
}
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/MagentoTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/MagentoTest.php
index 41d54a39e272e..d176b09fe4d0e 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/MagentoTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/MagentoTest.php
@@ -17,11 +17,11 @@ class MagentoTest extends \PHPUnit\Framework\TestCase
protected $_object;
/**
- * @var \Magento\TestFramework\EventManager|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\EventManager|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_eventManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->_eventManager = $this->getMockBuilder(\Magento\TestFramework\EventManager::class)
->setMethods(['fireEvent'])
@@ -30,7 +30,7 @@ protected function setUp()
$this->_object = new \Magento\TestFramework\Event\Magento($this->_eventManager);
}
- protected function tearDown()
+ protected function tearDown(): void
{
\Magento\TestFramework\Event\Magento::setDefaultEventManager(null);
}
@@ -44,11 +44,12 @@ public function testConstructorDefaultEventManager()
/**
* @dataProvider constructorExceptionDataProvider
- * @expectedException \Magento\Framework\Exception\LocalizedException
* @param mixed $eventManager
*/
public function testConstructorException($eventManager)
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
new \Magento\TestFramework\Event\Magento($eventManager);
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/Param/TransactionTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/Param/TransactionTest.php
index e051d4ea14c37..2d546fd71b1cc 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/Param/TransactionTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/Param/TransactionTest.php
@@ -16,7 +16,7 @@ class TransactionTest extends \PHPUnit\Framework\TestCase
*/
protected $_object;
- protected function setUp()
+ protected function setUp(): void
{
$this->_object = new \Magento\TestFramework\Event\Param\Transaction();
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/PhpUnitTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/PhpUnitTest.php
index 67338a81f664c..c719a8aff1553 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/PhpUnitTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/PhpUnitTest.php
@@ -17,11 +17,11 @@ class PhpUnitTest extends \PHPUnit\Framework\TestCase
protected $_object;
/**
- * @var \Magento\TestFramework\EventManager|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\EventManager|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_eventManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->_eventManager = $this->getMockBuilder(\Magento\TestFramework\EventManager::class)
->setMethods(['fireEvent'])
@@ -30,7 +30,7 @@ protected function setUp()
$this->_object = new \Magento\TestFramework\Event\PhpUnit($this->_eventManager);
}
- protected function tearDown()
+ protected function tearDown(): void
{
\Magento\TestFramework\Event\PhpUnit::setDefaultEventManager(null);
}
@@ -43,10 +43,11 @@ public function testConstructorDefaultEventManager()
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testConstructorException()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
new \Magento\TestFramework\Event\Magento();
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/TransactionTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/TransactionTest.php
index feb1c0bf61c16..aa55940ce6cec 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/TransactionTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Event/TransactionTest.php
@@ -12,21 +12,21 @@
class TransactionTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var \Magento\TestFramework\Event\Transaction|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Event\Transaction|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_object;
/**
- * @var \Magento\TestFramework\EventManager|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\EventManager|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_eventManager;
/**
- * @var \Magento\TestFramework\Db\Adapter\TransactionInterface|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Db\Adapter\TransactionInterface|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_adapter;
- protected function setUp()
+ protected function setUp(): void
{
$this->_eventManager = $this->getMockBuilder(\Magento\TestFramework\EventManager::class)
->setMethods(['fireEvent'])
@@ -40,7 +40,7 @@ protected function setUp()
->setConstructorArgs([$this->_eventManager])
->getMock();
- $this->_object->expects($this->any())->method('_getConnection')->will($this->returnValue($this->_adapter));
+ $this->_object->expects($this->any())->method('_getConnection')->willReturn($this->_adapter);
}
/**
@@ -61,17 +61,17 @@ protected function _imitateTransactionStartRequest($eventName)
'fireEvent'
)->with(
$eventName
- )->will(
- $this->returnCallback($callback)
+ )->willReturnCallback(
+ $callback
);
}
/**
* Setup expectations for "transaction start" use case
*
- * @param \PHPUnit\Framework\MockObject\Matcher\Invocation $invocationMatcher
+ * @param \PHPUnit\Framework\MockObject\Rule\InvocationOrder $invocationMatcher
*/
- protected function _expectTransactionStart(\PHPUnit\Framework\MockObject\Matcher\Invocation $invocationMatcher)
+ protected function _expectTransactionStart(\PHPUnit\Framework\MockObject\Rule\InvocationOrder $invocationMatcher)
{
$this->_eventManager->expects($invocationMatcher)->method('fireEvent')->with('startTransaction');
$this->_adapter->expects($this->once())->method('beginTransaction');
@@ -95,17 +95,17 @@ protected function _imitateTransactionRollbackRequest($eventName)
'fireEvent'
)->with(
$eventName
- )->will(
- $this->returnCallback($callback)
+ )->willReturnCallback(
+ $callback
);
}
/**
* Setup expectations for "transaction rollback" use case
*
- * @param \PHPUnit\Framework\MockObject\Matcher\Invocation $invocationMatcher
+ * @param \PHPUnit\Framework\MockObject\Rule\InvocationOrder $invocationMatcher
*/
- protected function _expectTransactionRollback(\PHPUnit\Framework\MockObject\Matcher\Invocation $invocationMatcher)
+ protected function _expectTransactionRollback(\PHPUnit\Framework\MockObject\Rule\InvocationOrder $invocationMatcher)
{
$this->_eventManager->expects($invocationMatcher)->method('fireEvent')->with('rollbackTransaction');
$this->_adapter->expects($this->once())->method('rollback');
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EventManagerTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EventManagerTest.php
index 16e8f2d7fcaf6..7584912a12b98 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EventManagerTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EventManagerTest.php
@@ -17,16 +17,16 @@ class EventManagerTest extends \PHPUnit\Framework\TestCase
protected $_eventManager;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
protected $_subscriberOne;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
protected $_subscriberTwo;
- protected function setUp()
+ protected function setUp(): void
{
$this->_subscriberOne = $this->createPartialMock(\stdClass::class, ['testEvent']);
$this->_subscriberTwo = $this->createPartialMock(\stdClass::class, ['testEvent']);
@@ -46,11 +46,11 @@ public function testFireEvent($reverseOrder, $expectedSubscribers)
$callback = function () use (&$actualSubscribers) {
$actualSubscribers[] = 'subscriberOne';
};
- $this->_subscriberOne->expects($this->once())->method('testEvent')->will($this->returnCallback($callback));
+ $this->_subscriberOne->expects($this->once())->method('testEvent')->willReturnCallback($callback);
$callback = function () use (&$actualSubscribers) {
$actualSubscribers[] = 'subscriberTwo';
};
- $this->_subscriberTwo->expects($this->once())->method('testEvent')->will($this->returnCallback($callback));
+ $this->_subscriberTwo->expects($this->once())->method('testEvent')->willReturnCallback($callback);
$this->_eventManager->fireEvent('testEvent', [], $reverseOrder);
$this->assertEquals($expectedSubscribers, $actualSubscribers);
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php
index bd828ed856284..55a6616d46156 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/BootstrapTest.php
@@ -20,12 +20,12 @@ class BootstrapTest extends \PHPUnit\Framework\TestCase
protected $_object;
/**
- * @var \Magento\TestFramework\Bootstrap|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Bootstrap|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_bootstrap;
/**
- * @var \Magento\TestFramework\Application|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\TestFramework\Application|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_application;
@@ -41,7 +41,7 @@ class BootstrapTest extends \PHPUnit\Framework\TestCase
],
];
- protected function setUp()
+ protected function setUp(): void
{
$this->_application = $this->createPartialMock(
\Magento\TestFramework\Application::class,
@@ -55,13 +55,13 @@ protected function setUp()
$this->any()
)->method(
'getApplication'
- )->will(
- $this->returnValue($this->_application)
+ )->willReturn(
+ $this->_application
);
$this->_object = new \Magento\TestFramework\Helper\Bootstrap($this->_bootstrap);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_application = null;
$this->_bootstrap = null;
@@ -69,11 +69,12 @@ protected function tearDown()
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage Helper instance is not defined yet.
*/
public function testGetInstanceEmptyProhibited()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('Helper instance is not defined yet.');
+
\Magento\TestFramework\Helper\Bootstrap::getInstance();
}
@@ -93,11 +94,12 @@ public function testGetInstanceAllowed(\Magento\TestFramework\Helper\Bootstrap $
/**
* @depends testSetInstanceFirstAllowed
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage Helper instance cannot be redefined.
*/
public function testSetInstanceChangeProhibited()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('Helper instance cannot be redefined.');
+
\Magento\TestFramework\Helper\Bootstrap::setInstance($this->_object);
}
@@ -140,7 +142,7 @@ function () use (&$expectedCanTest) {
public function testGetAppTempDir()
{
- $this->_application->expects($this->once())->method('getTempDir')->will($this->returnValue(__DIR__));
+ $this->_application->expects($this->once())->method('getTempDir')->willReturn(__DIR__);
$this->assertEquals(__DIR__, $this->_object->getAppTempDir());
}
@@ -150,8 +152,8 @@ public function testGetAppInitParams()
$this->once()
)->method(
'getInitParams'
- )->will(
- $this->returnValue($this->_fixtureInitParams)
+ )->willReturn(
+ $this->_fixtureInitParams
);
$this->assertEquals($this->_fixtureInitParams, $this->_object->getAppInitParams());
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/MemoryTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/MemoryTest.php
index 04a82607668ec..f99fbc585dd84 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/MemoryTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/MemoryTest.php
@@ -8,11 +8,11 @@
class MemoryTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
private $_shell;
- protected function setUp()
+ protected function setUp(): void
{
$this->_shell = $this->createPartialMock(\Magento\Framework\Shell::class, ['execute']);
}
@@ -26,8 +26,8 @@ public function testGetRealMemoryUsageUnix()
'execute'
)->with(
$this->stringStartsWith('ps ')
- )->will(
- $this->returnValue('26321')
+ )->willReturn(
+ '26321'
);
$this->assertEquals(26952704, $object->getRealMemoryUsage());
}
@@ -49,8 +49,8 @@ public function testGetRealMemoryUsageWin()
'execute'
)->with(
$this->stringStartsWith('tasklist.exe ')
- )->will(
- $this->returnValue('"php.exe","12345","N/A","0","26,321 K"')
+ )->willReturn(
+ '"php.exe","12345","N/A","0","26,321 K"'
);
$object = new \Magento\TestFramework\Helper\Memory($this->_shell);
$this->assertEquals(26952704, $object->getRealMemoryUsage());
@@ -87,10 +87,11 @@ public function convertToBytesDataProvider()
/**
* @param string $number
* @dataProvider convertToBytesBadFormatDataProvider
- * @expectedException \InvalidArgumentException
*/
public function testConvertToBytesBadFormat($number)
{
+ $this->expectException(\InvalidArgumentException::class);
+
\Magento\TestFramework\Helper\Memory::convertToBytes($number);
}
@@ -132,18 +133,20 @@ public function convertToBytes64DataProvider()
}
/**
- * @expectedException \InvalidArgumentException
*/
public function testConvertToBytesInvalidArgument()
{
+ $this->expectException(\InvalidArgumentException::class);
+
\Magento\TestFramework\Helper\Memory::convertToBytes('3Z');
}
/**
- * @expectedException \OutOfBoundsException
*/
public function testConvertToBytesOutOfBounds()
{
+ $this->expectException(\OutOfBoundsException::class);
+
if (PHP_INT_SIZE > 4) {
$this->markTestSkipped('A 32-bit system is required to perform this test.');
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Isolation/AppConfigTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Isolation/AppConfigTest.php
index 8f4339c5d2157..f54050983121c 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Isolation/AppConfigTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Isolation/AppConfigTest.php
@@ -19,12 +19,12 @@ class AppConfigTest extends \PHPUnit\Framework\TestCase
*/
private $model;
- protected function setUp()
+ protected function setUp(): void
{
$this->model = new \Magento\TestFramework\Isolation\AppConfig();
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->model = null;
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Isolation/WorkingDirectoryTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Isolation/WorkingDirectoryTest.php
index 96ad0c5885ea6..30489f5ce5816 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Isolation/WorkingDirectoryTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Isolation/WorkingDirectoryTest.php
@@ -16,12 +16,12 @@ class WorkingDirectoryTest extends \PHPUnit\Framework\TestCase
*/
protected $_object;
- protected function setUp()
+ protected function setUp(): void
{
$this->_object = new \Magento\TestFramework\Isolation\WorkingDirectory();
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_object = null;
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/MemoryLimitTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/MemoryLimitTest.php
index 29b96cd989c69..b1bec8785490d 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/MemoryLimitTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/MemoryLimitTest.php
@@ -18,17 +18,17 @@ public function testPrintStats()
{
$object = $this->_createObject(0, 0);
$result = $object->printStats();
- $this->assertContains('Memory usage (OS):', $result);
- $this->assertContains('1.00M', $result);
- $this->assertContains('Estimated memory leak:', $result);
- $this->assertContains('reported by PHP', $result);
+ $this->assertStringContainsString('Memory usage (OS):', $result);
+ $this->assertStringContainsString('1.00M', $result);
+ $this->assertStringContainsString('Estimated memory leak:', $result);
+ $this->assertStringContainsString('reported by PHP', $result);
$this->assertStringEndsWith(PHP_EOL, $result);
$object = $this->_createObject('2M', 0);
- $this->assertContains('50.00% of configured 2.00M limit', $object->printStats());
+ $this->assertStringContainsString('50.00% of configured 2.00M limit', $object->printStats());
$object = $this->_createObject(0, '500K');
- $this->assertContains('% of configured 0.49M limit', $object->printStats());
+ $this->assertStringContainsString('% of configured 0.49M limit', $object->printStats());
}
public function testValidateUsage()
@@ -38,10 +38,11 @@ public function testValidateUsage()
}
/**
- * @expectedException \LogicException
*/
public function testValidateUsageException()
{
+ $this->expectException(\LogicException::class);
+
$object = $this->_createObject('500K', '2M');
$object->validateUsage();
}
@@ -54,7 +55,7 @@ public function testValidateUsageException()
protected function _createObject($memCap, $leakCap)
{
$helper = $this->createPartialMock(\Magento\TestFramework\Helper\Memory::class, ['getRealMemoryUsage']);
- $helper->expects($this->any())->method('getRealMemoryUsage')->will($this->returnValue(1024 * 1024));
+ $helper->expects($this->any())->method('getRealMemoryUsage')->willReturn(1024 * 1024);
return new \Magento\TestFramework\MemoryLimit($memCap, $leakCap, $helper);
}
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php
index 9c5ade986d2e6..7076ef9a98eb9 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ObjectManagerTest.php
@@ -142,7 +142,7 @@ public function testIsEmptyMappedTableNamesAfterClearCache()
}
/**
- * @return Config|\PHPUnit_Framework_MockObject_MockObject
+ * @return Config|\PHPUnit\Framework\MockObject\MockObject
*/
private function getObjectManagerConfigMock()
{
@@ -160,7 +160,7 @@ function ($className) {
}
/**
- * @return FactoryInterface|\PHPUnit_Framework_MockObject_MockObject
+ * @return FactoryInterface|\PHPUnit\Framework\MockObject\MockObject
*/
private function getObjectManagerFactoryMock()
{
@@ -182,7 +182,7 @@ function ($className) {
* Returns mock of instance.
*
* @param string $className
- * @return \PHPUnit_Framework_MockObject_MockObject
+ * @return \PHPUnit\Framework\MockObject\MockObject
*/
private function createInstanceMock($className)
{
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php
index 122e2f2839d01..0000699723e65 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php
@@ -16,7 +16,7 @@ class OutputBambooTest extends \PHPUnit\Framework\TestCase
*/
protected $_output;
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
stream_filter_register('dataCollectorFilter', \Magento\Test\Profiler\OutputBambooTestFilter::class);
}
@@ -24,7 +24,7 @@ public static function setUpBeforeClass()
/**
* Reset collected data and prescribe to pass stream data through the collector filter
*/
- protected function setUp()
+ protected function setUp(): void
{
\Magento\Test\Profiler\OutputBambooTestFilter::resetCollectedData();
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php
index 6b853aebd41fa..0765c6e8d56e1 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php
@@ -14,7 +14,7 @@ class RequestTest extends \PHPUnit\Framework\TestCase
*/
protected $_model = null;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = new \Magento\TestFramework\Request(
$this->createMock(\Magento\Framework\Stdlib\Cookie\CookieReaderInterface::class),
@@ -41,8 +41,8 @@ public function testSetGetServerValue()
);
$this->assertSame(['test' => 'value', 'null' => null], $this->_model->getServer()->toArray());
$this->assertEquals('value', $this->_model->getServer('test'));
- $this->assertSame(null, $this->_model->getServer('non-existing'));
+ $this->assertNull($this->_model->getServer('non-existing'));
$this->assertSame('default', $this->_model->getServer('non-existing', 'default'));
- $this->assertSame(null, $this->_model->getServer('null'));
+ $this->assertNull($this->_model->getServer('null'));
}
}
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php
index 564661b46c7b2..1c52451b6f593 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php
@@ -16,26 +16,26 @@ class ControllerAbstractTest extends \Magento\TestFramework\TestCase\AbstractCon
{
protected $_bootstrap;
- /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Message\Manager */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | \Magento\Framework\Message\Manager */
private $messageManager;
- /** @var \PHPUnit_Framework_MockObject_MockObject | InterpretationStrategyInterface */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | InterpretationStrategyInterface */
private $interpretationStrategyMock;
- /** @var \PHPUnit_Framework_MockObject_MockObject | CookieManagerInterface */
+ /** @var \PHPUnit\Framework\MockObject\MockObject | CookieManagerInterface */
private $cookieManagerMock;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Serialize\Serializer\Json
+ * @var \PHPUnit\Framework\MockObject\MockObject|\Magento\Framework\Serialize\Serializer\Json
*/
private $serializerMock;
- protected function setUp()
+ protected function setUp(): void
{
$testObjectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
$this->messageManager = $this->createMock(\Magento\Framework\Message\Manager::class);
- $this->cookieManagerMock = $this->createMock(CookieManagerInterface::class);
+ $this->cookieManagerMock = $this->getMockForAbstractClass(CookieManagerInterface::class);
$this->serializerMock = $this->getMockBuilder(\Magento\Framework\Serialize\Serializer\Json::class)
->disableOriginalConstructor()
->getMock();
@@ -44,7 +44,7 @@ function ($serializedData) {
return json_decode($serializedData, true);
}
);
- $this->interpretationStrategyMock = $this->createMock(InterpretationStrategyInterface::class);
+ $this->interpretationStrategyMock = $this->getMockForAbstractClass(InterpretationStrategyInterface::class);
$this->interpretationStrategyMock->expects($this->any())
->method('interpret')
->willReturnCallback(
@@ -59,8 +59,8 @@ function (MessageInterface $message) {
$this->createPartialMock(\Magento\TestFramework\ObjectManager::class, ['get', 'create']);
$this->_objectManager->expects($this->any())
->method('get')
- ->will(
- $this->returnValueMap(
+ ->willReturnMap(
+
[
[\Magento\Framework\App\RequestInterface::class, $request],
[\Magento\Framework\App\ResponseInterface::class, $response],
@@ -69,7 +69,7 @@ function (MessageInterface $message) {
[\Magento\Framework\Serialize\Serializer\Json::class, $this->serializerMock],
[InterpretationStrategyInterface::class, $this->interpretationStrategyMock],
]
- )
+
);
}
@@ -120,10 +120,11 @@ public function testAssert404NotFound()
}
/**
- * @expectedException \PHPUnit\Framework\AssertionFailedError
*/
public function testAssertRedirectFailure()
{
+ $this->expectException(\PHPUnit\Framework\AssertionFailedError::class);
+
$this->assertRedirect();
}
@@ -151,14 +152,14 @@ public function testAssertRedirect()
public function testAssertSessionMessagesSuccess(array $expectedMessages, $messageTypeFilter)
{
$this->addSessionMessages();
- /** @var \PHPUnit_Framework_MockObject_MockObject|\PHPUnit\Framework\Constraint\Constraint $constraint */
+ /** @var \PHPUnit\Framework\MockObject\MockObject|\PHPUnit\Framework\Constraint\Constraint $constraint */
$constraint =
$this->createPartialMock(\PHPUnit\Framework\Constraint\Constraint::class, ['toString', 'matches']);
$constraint->expects(
$this->once()
)->method('matches')
->with($expectedMessages)
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->assertSessionMessages($constraint, $messageTypeFilter);
}
@@ -209,7 +210,7 @@ public function testAssertSessionMessagesEmpty()
{
$messagesCollection = new \Magento\Framework\Message\Collection();
$this->messageManager->expects($this->any())->method('getMessages')
- ->will($this->returnValue($messagesCollection));
+ ->willReturn($messagesCollection);
$this->assertSessionMessages($this->isEmpty());
}
@@ -225,7 +226,7 @@ private function addSessionMessages()
->addMessage(new \Magento\Framework\Message\Notice('some_notice'))
->addMessage(new \Magento\Framework\Message\Success('success!'));
$this->messageManager->expects($this->any())->method('getMessages')
- ->will($this->returnValue($messagesCollection));
+ ->willReturn($messagesCollection);
$cookieMessages = [
[
diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Workaround/Cleanup/TestCasePropertiesTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Workaround/Cleanup/TestCasePropertiesTest.php
index 28f5fb1e95bcf..c9c120c317761 100644
--- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Workaround/Cleanup/TestCasePropertiesTest.php
+++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Workaround/Cleanup/TestCasePropertiesTest.php
@@ -15,17 +15,16 @@ class TestCasePropertiesTest extends \PHPUnit\Framework\TestCase
* @var array
*/
protected $_fixtureProperties = [
- ['name' => 'testPublic', 'is_static' => false],
- ['name' => '_testPrivate', 'is_static' => false],
- ['name' => '_testPropertyBoolean', 'is_static' => false],
- ['name' => '_testPropertyInteger', 'is_static' => false],
- ['name' => '_testPropertyFloat', 'is_static' => false],
- ['name' => '_testPropertyString', 'is_static' => false],
- ['name' => '_testPropertyArray', 'is_static' => false],
- ['name' => '_testPropertyObject', 'is_static' => false],
- ['name' => 'testPublicStatic', 'is_static' => true],
- ['name' => '_testProtectedStatic', 'is_static' => true],
- ['name' => '_testPrivateStatic', 'is_static' => true],
+ 'testPublic' => ['name' => 'testPublic', 'is_static' => false],
+ '_testPrivate' => ['name' => '_testPrivate', 'is_static' => false],
+ '_testPropertyBoolean' => ['name' => '_testPropertyBoolean', 'is_static' => false],
+ '_testPropertyInteger' => ['name' => '_testPropertyInteger', 'is_static' => false],
+ '_testPropertyFloat' => ['name' => '_testPropertyFloat', 'is_static' => false],
+ '_testPropertyString' => ['name' => '_testPropertyString', 'is_static' => false],
+ '_testPropertyArray' => ['name' => '_testPropertyArray', 'is_static' => false],
+ 'testPublicStatic' => ['name' => 'testPublicStatic', 'is_static' => true],
+ '_testProtectedStatic' => ['name' => '_testProtectedStatic', 'is_static' => true],
+ '_testPrivateStatic' => ['name' => '_testPrivateStatic', 'is_static' => true],
];
public function testEndTestSuiteDestruct()
@@ -39,26 +38,25 @@ public function testEndTestSuiteDestruct()
/** @var $testClass \Magento\Test\Workaround\Cleanup\TestCasePropertiesTest\DummyTestCase */
$testClass = $testSuite->testAt(0);
- $propertyObjectMock = $this->createPartialMock(\stdClass::class, ['__destruct']);
- $propertyObjectMock->expects($this->atLeastOnce())->method('__destruct');
- $testClass->setPropertyObject($propertyObjectMock);
-
- foreach ($this->_fixtureProperties as $property) {
- if ($property['is_static']) {
- $this->assertAttributeNotEmpty($property['name'], get_class($testClass));
- } else {
- $this->assertAttributeNotEmpty($property['name'], $testClass);
+ $reflectionClass = new \ReflectionClass($testClass);
+ $classProperties = $reflectionClass->getProperties();
+ $fixturePropertiesNames = array_keys($this->_fixtureProperties);
+ foreach ($classProperties as $property) {
+ if (in_array($property->getName(), $fixturePropertiesNames)) {
+ $property->setAccessible(true);
+ $value = $property->getValue($testClass);
+ $this->assertNotNull($value);
}
}
$clearProperties = new \Magento\TestFramework\Workaround\Cleanup\TestCaseProperties();
$clearProperties->endTestSuite($testSuite);
- foreach ($this->_fixtureProperties as $property) {
- if ($property['is_static']) {
- $this->assertAttributeEmpty($property['name'], get_class($testClass));
- } else {
- $this->assertAttributeEmpty($property['name'], $testClass);
+ foreach ($classProperties as $property) {
+ if (in_array($property->getName(), $fixturePropertiesNames)) {
+ $property->setAccessible(true);
+ $value = $property->getValue($testClass);
+ $this->assertNull($value);
}
}
}
diff --git a/dev/tests/integration/phpunit.xml.dist b/dev/tests/integration/phpunit.xml.dist
index 56812163ed5f2..99767a91ca73f 100644
--- a/dev/tests/integration/phpunit.xml.dist
+++ b/dev/tests/integration/phpunit.xml.dist
@@ -6,7 +6,7 @@
*/
-->
testsuite/Magento/MemoryUsageTest.php
- testsuite
- ../../../app/code/*/*/Test/Integration
+ testsuite
+ ../../../app/code/*/*/Test/Integration
testsuite/Magento/MemoryUsageTest.php
-
+
../../../app/code/Magento
../../../lib/internal/Magento
diff --git a/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsReadTest.php b/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsReadTest.php
index ab72a2e1b1dd2..ca2033b2efda2 100644
--- a/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsReadTest.php
+++ b/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsReadTest.php
@@ -15,7 +15,7 @@ class MarkAsReadTest extends \Magento\TestFramework\TestCase\AbstractBackendCont
/**
* @inheritdoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->resource = 'Magento_AdminNotification::mark_as_read';
$this->uri = 'backend/admin/notification/markasread';
diff --git a/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsReadTest.php b/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsReadTest.php
index 04a69fe200dd1..ea5fd8ec72ab1 100644
--- a/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsReadTest.php
+++ b/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsReadTest.php
@@ -9,7 +9,7 @@
class MassMarkAsReadTest extends \Magento\TestFramework\TestCase\AbstractBackendController
{
- public function setUp()
+ protected function setUp(): void
{
$this->resource = 'Magento_AdminNotification::mark_as_read';
$this->uri = 'backend/admin/notification/massmarkasread';
diff --git a/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemoveTest.php b/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemoveTest.php
index 55ee6a58063a4..06ccf4bb8a4af 100644
--- a/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemoveTest.php
+++ b/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemoveTest.php
@@ -9,7 +9,7 @@
class MassRemoveTest extends \Magento\TestFramework\TestCase\AbstractBackendController
{
- public function setUp()
+ protected function setUp(): void
{
$this->resource = 'Magento_AdminNotification::adminnotification_remove';
$this->uri = 'backend/admin/notification/massremove';
diff --git a/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/RemoveTest.php b/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/RemoveTest.php
index 47f842ff005d3..0ffdbdd570f9c 100644
--- a/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/RemoveTest.php
+++ b/dev/tests/integration/testsuite/Magento/AdminNotification/Controller/Adminhtml/Notification/RemoveTest.php
@@ -7,7 +7,7 @@
class RemoveTest extends \Magento\TestFramework\TestCase\AbstractBackendController
{
- public function setUp()
+ protected function setUp(): void
{
$this->resource = 'Magento_AdminNotification::adminnotification_remove';
$this->uri = 'backend/admin/notification/remove';
diff --git a/dev/tests/integration/testsuite/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection/CriticalTest.php b/dev/tests/integration/testsuite/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection/CriticalTest.php
index bd0084de43041..218bb5089ce3f 100644
--- a/dev/tests/integration/testsuite/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection/CriticalTest.php
+++ b/dev/tests/integration/testsuite/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection/CriticalTest.php
@@ -12,7 +12,7 @@ class CriticalTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Critical::class
diff --git a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricingTest.php b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricingTest.php
index ce0cc79b0a5e0..1ce2b01b10212 100644
--- a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricingTest.php
+++ b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricingTest.php
@@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+
namespace Magento\AdvancedPricingImportExport\Model\Export;
use Magento\Framework\App\Filesystem\DirectoryList;
@@ -19,8 +20,7 @@
use Magento\ImportExport\Model\Import;
/**
- * Advanced pricing test
- *
+ * Test for \Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class AdvancedPricingTest extends TestCase
@@ -41,7 +41,7 @@ class AdvancedPricingTest extends TestCase
protected $fileSystem;
// @codingStandardsIgnoreStart
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
$db = Bootstrap::getInstance()
->getBootstrap()
@@ -54,9 +54,10 @@ public static function setUpBeforeClass()
parent::setUpBeforeClass();
}
+
// @codingStandardsIgnoreEnd
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -112,11 +113,11 @@ public function testExport()
*/
private function assertDiscountTypes($exportContent)
{
- $this->assertContains(
+ $this->assertStringContainsString(
'2.0000,8.000000,Fixed',
$exportContent
);
- $this->assertContains(
+ $this->assertStringContainsString(
'10.0000,50.00,Discount',
$exportContent
);
@@ -148,7 +149,7 @@ public function testExportMultipleWebsites()
$csvfile = uniqid('importexport_') . '.csv';
$exportContent = $this->exportData($csvfile);
- $this->assertContains(
+ $this->assertStringContainsString(
'"AdvancedPricingSimple 2",test,"ALL GROUPS",3.0000,5.0000',
$exportContent
);
@@ -174,11 +175,11 @@ public function testExportImportOfAdvancedPricing(): void
{
$csvfile = uniqid('importexport_') . '.csv';
$exportContent = $this->exportData($csvfile);
- $this->assertContains(
+ $this->assertStringContainsString(
'second_simple,"All Websites [USD]","ALL GROUPS",10.0000,3.00,Discount',
$exportContent
);
- $this->assertContains(
+ $this->assertStringContainsString(
'simple,"All Websites [USD]",General,5.0000,95.000000,Fixed',
$exportContent
);
@@ -198,13 +199,12 @@ public function testExportImportOfAdvancedPricing(): void
]
);
- $this->assertEquals(
+ $this->assertEqualsWithDelta(
['5.0000', '90.000000'],
[
$firstProductTierPrices[0]->getQty(),
$firstProductTierPrices[0]->getValue(),
],
- '',
0.1
);
@@ -216,13 +216,12 @@ public function testExportImportOfAdvancedPricing(): void
]
);
- $this->assertEquals(
+ $this->assertEqualsWithDelta(
['5.00', '10.0000'],
[
$secondProductTierPrices[0]->getExtensionAttributes()->getPercentageValue(),
$secondProductTierPrices[0]->getQty(),
],
- '',
0.1
);
}
diff --git a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php
index 1a997cbca7a30..747b990ce632e 100644
--- a/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php
+++ b/dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php
@@ -6,7 +6,6 @@
namespace Magento\AdvancedPricingImportExport\Model\Import;
use Magento\Framework\App\Filesystem\DirectoryList;
-use Magento\ImportExport\Model\Import;
/**
* @magentoAppArea adminhtml
@@ -36,7 +35,7 @@ class AdvancedPricingTest extends \PHPUnit\Framework\TestCase
*/
protected $expectedTierPrice;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->fileSystem = $this->objectManager->get(\Magento\Framework\Filesystem::class);
@@ -47,53 +46,53 @@ protected function setUp()
'AdvancedPricingSimple 1' => [
[
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
- 'value' => '300.0000',
+ 'value' => '300.000000',
'qty' => '10.0000',
'percentage_value' => null
],
[
'customer_group_id' => '1',
- 'value' => '11.0000',
+ 'value' => '11.000000',
'qty' => '11.0000',
'percentage_value' => null
],
[
'customer_group_id' => '3',
- 'value' => '14.0000',
+ 'value' => '14.000000',
'qty' => '14.0000',
'percentage_value' => null
],
[
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
- 'value' => '160.5000',
+ 'value' => 160.5,
'qty' => '20.0000',
- 'percentage_value' => '50.0000'
+ 'percentage_value' => '50.00'
]
],
'AdvancedPricingSimple 2' => [
[
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
- 'value' => '1000000.0000',
+ 'value' => '1000000.000000',
'qty' => '100.0000',
'percentage_value' => null
],
[
'customer_group_id' => '0',
- 'value' => '12.0000',
+ 'value' => '12.000000',
'qty' => '12.0000',
'percentage_value' => null
],
[
'customer_group_id' => '2',
- 'value' => '13.0000',
+ 'value' => '13.000000',
'qty' => '13.0000',
'percentage_value' => null
],
[
'customer_group_id' => \Magento\Customer\Model\Group::CUST_GROUP_ALL,
- 'value' => '327.0000',
+ 'value' => 327.0,
'qty' => '200.0000',
- 'percentage_value' => '50.0000'
+ 'percentage_value' => '50.00'
]
]
];
@@ -139,7 +138,7 @@ public function testImportAddUpdate()
foreach ($productIdList as $sku => $productId) {
$product->load($productId);
$tierPriceCollection = $product->getTierPrices();
- $this->assertEquals(4, count($tierPriceCollection));
+ $this->assertCount(4, $tierPriceCollection);
$index = 0;
/** @var \Magento\Catalog\Model\Product\TierPrice $tierPrice */
foreach ($tierPriceCollection as $tierPrice) {
@@ -166,11 +165,11 @@ private function checkPercentageDiscount(
$sku,
$index
) {
- $this->assertEquals(
- $this->expectedTierPrice[$sku][$index]['percentage_value'],
- $tierPrice->getExtensionAttributes()->getPercentageValue()
- );
- $tierPrice->setData('percentage_value', $tierPrice->getExtensionAttributes()->getPercentageValue());
+ $this->assertEquals(
+ (int)$this->expectedTierPrice[$sku][$index]['percentage_value'],
+ (int)$tierPrice->getExtensionAttributes()->getPercentageValue()
+ );
+ $tierPrice->setData('percentage_value', $tierPrice->getExtensionAttributes()->getPercentageValue());
}
/**
@@ -237,7 +236,7 @@ public function testImportDelete()
$newPricingData = $this->objectManager->create(\Magento\Catalog\Model\Product::class)
->load($ids[$index])
->getTierPrices();
- $this->assertEquals(0, count($newPricingData));
+ $this->assertCount(0, $newPricingData);
}
}
@@ -281,7 +280,7 @@ public function testImportReplace()
foreach ($productIdList as $sku => $productId) {
$product->load($productId);
$tierPriceCollection = $product->getTierPrices();
- $this->assertEquals(4, count($tierPriceCollection));
+ $this->assertCount(4, $tierPriceCollection);
$index = 0;
/** @var \Magento\Catalog\Model\Product\TierPrice $tierPrice */
foreach ($tierPriceCollection as $tierPrice) {
diff --git a/dev/tests/integration/testsuite/Magento/AdvancedSearch/Block/SuggestionsTest.php b/dev/tests/integration/testsuite/Magento/AdvancedSearch/Block/SuggestionsTest.php
index 85537bcd515b5..85a9d8ae8a509 100644
--- a/dev/tests/integration/testsuite/Magento/AdvancedSearch/Block/SuggestionsTest.php
+++ b/dev/tests/integration/testsuite/Magento/AdvancedSearch/Block/SuggestionsTest.php
@@ -18,7 +18,7 @@ class SuggestionsTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\AdvancedSearch\Block\Suggestions */
protected $block;
- protected function setUp()
+ protected function setUp(): void
{
$suggestedQueries = $this->createMock(SuggestedQueriesInterface::CLASS);
$suggestedQueries->expects($this->any())->method('getItems')->willReturn([
@@ -36,11 +36,11 @@ public function testRenderEscaping()
{
$html = $this->block->toHtml();
- $this->assertContains('test+item', $html);
- $this->assertContains('test item', $html);
+ $this->assertStringContainsString('test+item', $html);
+ $this->assertStringContainsString('test item', $html);
- $this->assertNotContains('', $responseBody);
+ $this->assertStringContainsString('<script>alert("xss");</script>', $responseBody);
+ $this->assertStringNotContainsString('', $responseBody);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/AdvancedPricingTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/AdvancedPricingTest.php
index da4cf6335fb05..31c9cd9636956 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/AdvancedPricingTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/AdvancedPricingTest.php
@@ -29,7 +29,7 @@ class AdvancedPricingTest extends AbstractBackendController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->productRepository = $this->_objectManager->get(ProductRepositoryInterface::class);
@@ -98,7 +98,7 @@ private function dispatchWithData(int $productId, array $productPostData): void
$this->getRequest()->setMethod(Http::METHOD_POST);
$this->dispatch('backend/catalog/product/save/id/' . $productId);
$this->assertSessionMessages(
- $this->contains('You saved the product.'),
+ $this->containsEqual('You saved the product.'),
MessageInterface::TYPE_SUCCESS
);
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CategoryIndexTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CategoryIndexTest.php
index 4d44afe831029..263b26866ef7f 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CategoryIndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CategoryIndexTest.php
@@ -47,7 +47,7 @@ class CategoryIndexTest extends AbstractBackendController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CreateCustomOptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CreateCustomOptionsTest.php
index a4631526bd4c5..b1aef9f81eba1 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CreateCustomOptionsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/CreateCustomOptionsTest.php
@@ -41,7 +41,7 @@ class CreateCustomOptionsTest extends AbstractBackendController
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -65,7 +65,7 @@ public function testSaveCustomOptionWithTypeField(array $productPostData): void
$this->getRequest()->setMethod(HttpRequest::METHOD_POST);
$this->dispatch('backend/catalog/product/save/id/' . $product->getEntityId());
$this->assertSessionMessages(
- $this->contains('You saved the product.'),
+ $this->containsEqual('You saved the product.'),
MessageInterface::TYPE_SUCCESS
);
$productOptions = $this->optionRepository->getProductOptions($product);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/DeleteCustomOptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/DeleteCustomOptionsTest.php
index 6a4ff066f710d..6a3f002c390e7 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/DeleteCustomOptionsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/DeleteCustomOptionsTest.php
@@ -48,7 +48,7 @@ class DeleteCustomOptionsTest extends AbstractBackendController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/ImagesTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/ImagesTest.php
index 697980d75a715..cd57bc831fdad 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/ImagesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/ImagesTest.php
@@ -41,7 +41,7 @@ class ImagesTest extends AbstractBackendController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->config = $this->_objectManager->get(Config::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/LinksTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/LinksTest.php
index 665d45921d435..76e075ada2a37 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/LinksTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/LinksTest.php
@@ -34,7 +34,7 @@ class LinksTest extends AbstractBackendController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->productRepository = $this->_objectManager->create(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/UpdateCustomOptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/UpdateCustomOptionsTest.php
index 1badf6a1a081a..394b79c20a00f 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/UpdateCustomOptionsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/UpdateCustomOptionsTest.php
@@ -49,7 +49,7 @@ class UpdateCustomOptionsTest extends AbstractBackendController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -116,7 +116,7 @@ public function testUpdateCustomOptionWithTypeField(array $optionData, array $up
$this->getRequest()->setMethod(HttpRequest::METHOD_POST);
$this->dispatch('backend/catalog/product/save/id/' . $product->getEntityId());
$this->assertSessionMessages(
- $this->contains('You saved the product.'),
+ $this->containsEqual('You saved the product.'),
MessageInterface::TYPE_SUCCESS
);
$updatedOptions = $this->optionRepository->getProductOptions($product);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SearchTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SearchTest.php
index cfa8b6022963e..a65ac746f7723 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SearchTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/SearchTest.php
@@ -24,7 +24,7 @@ public function testExecute() : void
->setPostValue('limit', 50);
$this->dispatch('backend/catalog/product/search');
$responseBody = $this->getResponse()->getBody();
- $this->assertContains(
+ $this->assertStringContainsString(
'"options":{"1":{"value":"1","label":"Simple Product","is_active":1,"path":"simple","optgroup":false}',
$responseBody
);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/DeleteTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/DeleteTest.php
index 5cb1f862054ba..dfe1115f1d167 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/DeleteTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/DeleteTest.php
@@ -54,7 +54,7 @@ class DeleteTest extends AbstractBackendController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->getAttributeSetByName = $this->_objectManager->get(GetAttributeSetByName::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/SaveTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/SaveTest.php
index 1edd494dabbe3..cdbc9bc90362f 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/SaveTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/SaveTest.php
@@ -87,7 +87,7 @@ class SaveTest extends AbstractBackendController
/**
* @inheritDoc
*/
- public function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->logger = $this->_objectManager->get(Monolog::class);
@@ -109,7 +109,7 @@ public function setUp()
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->attributeRepository->get('country_of_manufacture')->setIsUserDefined(false);
parent::tearDown();
@@ -204,8 +204,11 @@ public function testAlreadyExistsExceptionProcessingWhenGroupCodeIsDuplicated():
$jsonResponse = $this->json->unserialize($this->getResponse()->getBody());
$this->assertNotNull($jsonResponse);
$this->assertEquals(1, $jsonResponse['error']);
- $this->assertContains(
- (string)__('Attribute group with same code already exist. Please rename "attribute-group-name" group'),
+ $this->assertStringContainsString(
+ (string)__(
+ 'Attribute group with same code already exist.'
+ . ' Please rename "attribute-group-name" group'
+ ),
$jsonResponse['message']
);
}
@@ -237,7 +240,7 @@ public function testRemoveAttributeFromAttributeSet(): void
$this->dispatch('backend/catalog/product/edit/id/' . $product->getEntityId());
$syslogPath = $this->getSyslogPath();
$syslogContent = file_exists($syslogPath) ? file_get_contents($syslogPath) : '';
- $this->assertNotContains($message, $syslogContent);
+ $this->assertStringNotContainsString($message, $syslogContent);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/UpdateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/UpdateTest.php
index 765f59b15be83..ff36ae916d6a1 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/UpdateTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/UpdateTest.php
@@ -53,7 +53,7 @@ class UpdateTest extends AbstractBackendController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->json = $this->_objectManager->get(Json::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php
index 7ca04863f58a1..65e7e94f4aa24 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php
@@ -47,7 +47,7 @@ class ProductTest extends \Magento\TestFramework\TestCase\AbstractBackendControl
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -86,7 +86,7 @@ public function testSaveActionAndNew()
$this->dispatch('backend/catalog/product/save/id/' . $product->getEntityId());
$this->assertRedirect($this->stringStartsWith('http://localhost/index.php/backend/catalog/product/new/'));
$this->assertSessionMessages(
- $this->contains('You saved the product.'),
+ $this->containsEqual('You saved the product.'),
MessageInterface::TYPE_SUCCESS
);
}
@@ -330,7 +330,7 @@ public function testSaveActionTierPrice(array $postData, array $tierPrice)
$this->getRequest()->setPostValue($postData);
$this->dispatch('backend/catalog/product/save/id/' . $postData['id']);
$this->assertSessionMessages(
- $this->contains('You saved the product.'),
+ $this->containsEqual('You saved the product.'),
MessageInterface::TYPE_SUCCESS
);
}
@@ -412,6 +412,7 @@ private function getProductData(array $tierPrice)
$repo = $this->repositoryFactory->create();
$product = $repo->get('tier_prices')->getData();
$product['tier_price'] = $tierPrice;
+ /** @phpstan-ignore-next-line */
unset($product['entity_id']);
return $product;
}
@@ -594,11 +595,11 @@ private function assertSaveAndDuplicateAction(Product $product)
$this->getRequest()->setMethod(HttpRequest::METHOD_POST);
$this->dispatch('backend/catalog/product/save/id/' . $product->getEntityId());
$this->assertSessionMessages(
- $this->contains('You saved the product.'),
+ $this->containsEqual('You saved the product.'),
MessageInterface::TYPE_SUCCESS
);
$this->assertSessionMessages(
- $this->contains('You duplicated the product.'),
+ $this->containsEqual('You duplicated the product.'),
MessageInterface::TYPE_SUCCESS
);
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Category/CategoryUrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Category/CategoryUrlRewriteTest.php
index 1b51c65e1e853..ad62a4ec2df29 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Category/CategoryUrlRewriteTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Category/CategoryUrlRewriteTest.php
@@ -34,7 +34,7 @@ class CategoryUrlRewriteTest extends AbstractController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/CategoryTest.php
index c18a867a9b76e..07cc43921d59f 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/CategoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/CategoryTest.php
@@ -48,7 +48,7 @@ class CategoryTest extends AbstractController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php
index c303fb1fe6e0c..460488fdfae76 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php
@@ -31,7 +31,7 @@ class CompareTest extends \Magento\TestFramework\TestCase\AbstractController
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->formKey = $this->_objectManager->get(\Magento\Framework\Data\Form\FormKey::class);
@@ -173,19 +173,19 @@ public function testIndexActionDisplay()
$responseBody = $this->getResponse()->getBody();
- $this->assertContains('Products Comparison List', $responseBody);
+ $this->assertStringContainsString('Products Comparison List', $responseBody);
- $this->assertContains('simple_product_1', $responseBody);
- $this->assertContains('Simple Product 1 Name', $responseBody);
- $this->assertContains('Simple Product 1 Full Description', $responseBody);
- $this->assertContains('Simple Product 1 Short Description', $responseBody);
- $this->assertContains('$1,234.56', $responseBody);
+ $this->assertStringContainsString('simple_product_1', $responseBody);
+ $this->assertStringContainsString('Simple Product 1 Name', $responseBody);
+ $this->assertStringContainsString('Simple Product 1 Full Description', $responseBody);
+ $this->assertStringContainsString('Simple Product 1 Short Description', $responseBody);
+ $this->assertStringContainsString('$1,234.56', $responseBody);
- $this->assertContains('simple_product_2', $responseBody);
- $this->assertContains('Simple Product 2 Name', $responseBody);
- $this->assertContains('Simple Product 2 Full Description', $responseBody);
- $this->assertContains('Simple Product 2 Short Description', $responseBody);
- $this->assertContains('$987.65', $responseBody);
+ $this->assertStringContainsString('simple_product_2', $responseBody);
+ $this->assertStringContainsString('Simple Product 2 Name', $responseBody);
+ $this->assertStringContainsString('Simple Product 2 Full Description', $responseBody);
+ $this->assertStringContainsString('Simple Product 2 Short Description', $responseBody);
+ $this->assertStringContainsString('$987.65', $responseBody);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ProductUrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ProductUrlRewriteTest.php
index d55c85d9b9d00..231c56858dfb8 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ProductUrlRewriteTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ProductUrlRewriteTest.php
@@ -48,7 +48,7 @@ class ProductUrlRewriteTest extends AbstractController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ViewTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ViewTest.php
index f45c9934acfc1..5458de89e9b82 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ViewTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ViewTest.php
@@ -67,7 +67,7 @@ class ViewTest extends AbstractController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -336,7 +336,7 @@ private function setupLoggerMock(): MockObject
{
$logger = $this->getMockBuilder(LoggerInterface::class)
->disableOriginalConstructor()
- ->getMock();
+ ->getMockForAbstractClass();
$this->_objectManager->addSharedInstance($logger, MagentoMonologLogger::class);
return $logger;
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/ProductTest.php
index 20805271f6b5b..4494ccf1eb3fe 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/ProductTest.php
@@ -5,15 +5,14 @@
*/
declare(strict_types=1);
-
namespace Magento\Catalog\Controller;
-use Magento\Catalog\Api\ProductRepositoryInterface;
-use Magento\TestFramework\Catalog\Model\ProductLayoutUpdateManager;
-use Magento\TestFramework\Helper\Bootstrap;
use Magento\Catalog\Api\Data\ProductInterface;
+use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Catalog\Model\Session;
use Magento\Framework\Registry;
+use Magento\TestFramework\Catalog\Model\ProductLayoutUpdateManager;
+use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\Helper\Xpath;
use Magento\TestFramework\TestCase\AbstractController;
@@ -38,7 +37,7 @@ class ProductTest extends AbstractController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Randomly fails due to known HHVM bug (DOMText mixed with DOMElement)');
@@ -91,16 +90,16 @@ public function testViewAction(): void
$responseBody = $this->getResponse()->getBody();
/* Product info */
- $this->assertContains($product->getName(), $responseBody);
- $this->assertContains($product->getDescription(), $responseBody);
- $this->assertContains($product->getShortDescription(), $responseBody);
- $this->assertContains($product->getSku(), $responseBody);
+ $this->assertStringContainsString($product->getName(), $responseBody);
+ $this->assertStringContainsString($product->getDescription(), $responseBody);
+ $this->assertStringContainsString($product->getShortDescription(), $responseBody);
+ $this->assertStringContainsString($product->getSku(), $responseBody);
/* Stock info */
- $this->assertContains('$1,234.56', $responseBody);
- $this->assertContains('In stock', $responseBody);
- $this->assertContains((string)__('Add to Cart'), $responseBody);
+ $this->assertStringContainsString('$1,234.56', $responseBody);
+ $this->assertStringContainsString('In stock', $responseBody);
+ $this->assertStringContainsString((string)__('Add to Cart'), $responseBody);
/* Meta info */
- $this->assertContains('Simple Product 1 Meta Title', $responseBody);
+ $this->assertStringContainsString('Simple Product 1 Meta Title', $responseBody);
$this->assertEquals(
1,
Xpath::getElementsCountForXpath(
@@ -164,8 +163,11 @@ public function testGalleryAction(): void
$product = $this->productRepository->get('simple_product_1');
$this->dispatch(sprintf('catalog/product/gallery/id/%s', $product->getEntityId()));
- $this->assertContains('http://localhost/pub/media/catalog/product/', $this->getResponse()->getBody());
- $this->assertContains($this->getProductImageFile(), $this->getResponse()->getBody());
+ $this->assertStringContainsString(
+ 'http://localhost/pub/media/catalog/product/',
+ $this->getResponse()->getBody()
+ );
+ $this->assertStringContainsString($this->getProductImageFile(), $this->getResponse()->getBody());
}
/**
@@ -201,6 +203,7 @@ public function testImageAction(): void
$imageContent = ob_get_clean();
/**
* Check against PNG file signature.
+ *
* @link http://www.libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.PNG-file-signature
*/
$this->assertStringStartsWith(sprintf("%cPNG\r\n%c\n", 137, 26), $imageContent);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Cron/DeleteOutdatedPriceValuesTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Cron/DeleteOutdatedPriceValuesTest.php
index 6486c0089c206..6629aa1ba8740 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Cron/DeleteOutdatedPriceValuesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Cron/DeleteOutdatedPriceValuesTest.php
@@ -37,7 +37,7 @@ class DeleteOutdatedPriceValuesTest extends \PHPUnit\Framework\TestCase
*/
private $objectManager;
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
@@ -128,7 +128,7 @@ public function testExecute()
);
}
- public function tearDown()
+ protected function tearDown(): void
{
parent::tearDown();
/** @var ReinitableConfigInterface $reinitiableConfig */
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/CategoryTest.php
index 3d241be195578..307a5bce14134 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/CategoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/CategoryTest.php
@@ -19,14 +19,14 @@ class CategoryTest extends \PHPUnit\Framework\TestCase
*/
protected $_helper;
- protected function setUp()
+ protected function setUp(): void
{
$this->_helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Catalog\Helper\Category::class
);
}
- protected function tearDown()
+ protected function tearDown(): void
{
if ($this->_helper) {
$helperClass = get_class($this->_helper);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/DataTest.php
index 0c76696cfbd00..38f9310aa6ff9 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/DataTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/DataTest.php
@@ -68,7 +68,7 @@ class DataTest extends \PHPUnit\Framework\TestCase
*/
private $scopeConfig;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->helper = $this->objectManager->get(\Magento\Catalog\Helper\Data::class);
@@ -76,7 +76,7 @@ protected function setUp()
$this->scopeConfig = $this->objectManager->get(\Magento\Framework\App\MutableScopeConfig::class);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->tearDownDefaultRules();
}
@@ -98,7 +98,7 @@ public function testGetBreadcrumbPath()
try {
$path = $this->helper->getBreadcrumbPath();
- $this->assertInternalType('array', $path);
+ $this->assertIsArray($path);
$this->assertEquals(['category3', 'category4', 'category5'], array_keys($path));
$this->assertArrayHasKey('label', $path['category3']);
$this->assertArrayHasKey('link', $path['category3']);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/OutputTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/OutputTest.php
index ad646c1384c4a..2ef3755f3b9fd 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/OutputTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/OutputTest.php
@@ -12,7 +12,7 @@ class OutputTest extends \PHPUnit\Framework\TestCase
*/
protected $_helper;
- protected function setUp()
+ protected function setUp(): void
{
$this->_helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Catalog\Helper\Output::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompareTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompareTest.php
index 6615815569fcf..bde86b3b35440 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompareTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompareTest.php
@@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+
namespace Magento\Catalog\Helper\Product;
class CompareTest extends \PHPUnit\Framework\TestCase
@@ -17,7 +18,7 @@ class CompareTest extends \PHPUnit\Framework\TestCase
*/
protected $_objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->_helper = $this->_objectManager->get(\Magento\Catalog\Helper\Product\Compare::class);
@@ -27,7 +28,7 @@ public function testGetListUrl()
{
/** @var $empty \Magento\Catalog\Helper\Product\Compare */
$empty = $this->_objectManager->create(\Magento\Catalog\Helper\Product\Compare::class);
- $this->assertContains('/catalog/product_compare/index/', $empty->getListUrl());
+ $this->assertStringContainsString('/catalog/product_compare/index/', $empty->getListUrl());
}
public function testGetAddUrl()
@@ -61,12 +62,15 @@ public function testGetAddToCartUrl()
public function testGetRemoveUrl()
{
$url = $this->_helper->getRemoveUrl();
- $this->assertContains('/catalog/product_compare/remove/', $url);
+ $this->assertStringContainsString('/catalog/product_compare/remove/', $url);
}
public function testGetClearListUrl()
{
- $this->assertContains('\/catalog\/product_compare\/clear\/', $this->_helper->getPostDataClearList());
+ $this->assertStringContainsString(
+ '\/catalog\/product_compare\/clear\/',
+ $this->_helper->getPostDataClearList()
+ );
}
/**
@@ -84,6 +88,7 @@ public function testGetItemCollection()
* calculate()
* getItemCount()
* hasItems()
+ *
* @magentoDataFixture Magento/Catalog/_files/multiple_products.php
* @magentoDbIsolation disabled
*/
@@ -120,7 +125,7 @@ protected function _testGetProductUrl($method, $expectedFullAction)
$product = $this->_objectManager->create(\Magento\Catalog\Model\Product::class);
$product->setId(10);
$url = $this->_helper->{$method}($product);
- $this->assertContains($expectedFullAction, $url);
+ $this->assertStringContainsString($expectedFullAction, $url);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompositeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompositeTest.php
index f29f75010a352..a558a99bd2f17 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompositeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompositeTest.php
@@ -25,13 +25,13 @@ class CompositeTest extends \PHPUnit\Framework\TestCase
*/
protected $registry;
- protected function setUp()
+ protected function setUp(): void
{
$this->helper = Bootstrap::getObjectManager()->get(\Magento\Catalog\Helper\Product\Composite::class);
$this->registry = Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->registry->unregister('composite_configure_result_error_message');
$this->registry->unregister(RegistryConstants::CURRENT_CUSTOMER_ID);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/FlatTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/FlatTest.php
index 6b71490515e07..9692091b4d2db 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/FlatTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/FlatTest.php
@@ -17,7 +17,7 @@ class FlatTest extends \PHPUnit\Framework\TestCase
*/
protected $_state;
- protected function setUp()
+ protected function setUp(): void
{
$this->_helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Catalog\Helper\Product\Flat\Indexer::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php
index ef70d07355846..ed61775362284 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php
@@ -33,7 +33,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -61,7 +61,7 @@ protected function setUp()
/**
* Cleanup session, contaminated by product initialization methods
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->objectManager->get(\Magento\Catalog\Model\Session::class)->unsLastViewedProductId();
$this->_controller = null;
@@ -90,7 +90,7 @@ public function testInitProductLayout()
\Magento\Framework\View\Page\Config::ELEMENT_TYPE_BODY,
\Magento\Framework\View\Page\Config::BODY_ATTRIBUTE_CLASS
);
- $this->assertContains("product-{$uniqid}", $bodyClass);
+ $this->assertStringContainsString("product-{$uniqid}", $bodyClass);
$handles = $this->page->getLayout()->getUpdate()->getHandles();
$this->assertContains('catalog_product_view_type_simple', $handles);
}
@@ -119,11 +119,12 @@ public function testPrepareAndRender()
}
/**
- * @expectedException \Magento\Framework\Exception\NoSuchEntityException
* @magentoAppIsolation enabled
*/
public function testPrepareAndRenderWrongController()
{
+ $this->expectException(\Magento\Framework\Exception\NoSuchEntityException::class);
+
$objectManager = $this->objectManager;
$controller = $objectManager->create(\Magento\Catalog\Helper\Product\Stub\ProductControllerStub::class);
$this->_helper->prepareAndRender($this->page, 10, $controller);
@@ -131,10 +132,11 @@ public function testPrepareAndRenderWrongController()
/**
* @magentoAppIsolation enabled
- * @expectedException \Magento\Framework\Exception\NoSuchEntityException
*/
public function testPrepareAndRenderWrongProduct()
{
+ $this->expectException(\Magento\Framework\Exception\NoSuchEntityException::class);
+
$this->_helper->prepareAndRender($this->page, 999, $this->_controller);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/ProductTest.php
index 623182651b45f..98f623e5f193b 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/ProductTest.php
@@ -17,7 +17,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
*/
protected $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\App\State::class)
->setAreaCode('frontend');
@@ -172,7 +172,7 @@ public function testGetAttributeInputTypes()
$this->assertArrayHasKey('multiselect', $types);
$this->assertArrayHasKey('boolean', $types);
foreach ($types as $type) {
- $this->assertInternalType('array', $type);
+ $this->assertIsArray($type);
$this->assertNotEmpty($type);
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/AbstractTest.php
index 8942c19281e2b..839d72061aaec 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/AbstractTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/AbstractTest.php
@@ -24,7 +24,7 @@ class AbstractTest extends \PHPUnit\Framework\TestCase
*/
protected static $_isStubClass = false;
- protected function setUp()
+ protected function setUp(): void
{
if (!self::$_isStubClass) {
$this->getMockForAbstractClass(
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/AbstractLayoutUpdateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/AbstractLayoutUpdateTest.php
index 40725d3ee58be..506556dbe95b3 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/AbstractLayoutUpdateTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/AbstractLayoutUpdateTest.php
@@ -53,7 +53,7 @@ private function recreateCategory(): void
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->categoryFactory = Bootstrap::getObjectManager()->get(CategoryFactory::class);
$this->recreateCategory();
@@ -93,7 +93,7 @@ public function testDependsOnNewUpdate(): void
/** @var AbstractBackend $fileAttribute */
$fileAttribute = $this->category->getAttributes()['custom_layout_update_file']->getBackend();
$fileAttribute->beforeSave($this->category);
- $this->assertEquals(null, $this->category->getData('custom_layout_update_file'));
+ $this->assertNull($this->category->getData('custom_layout_update_file'));
//Removing custom layout update by explicitly selecting the new file (or an empty file).
$this->recreateCategory();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/CustomlayoutupdateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/CustomlayoutupdateTest.php
index 7f594d265418f..b88b235cc34ff 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/CustomlayoutupdateTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/CustomlayoutupdateTest.php
@@ -49,7 +49,7 @@ private function recreateCategory(): void
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->categoryFactory = Bootstrap::getObjectManager()->get(CategoryFactory::class);
$this->recreateCategory();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/DataProviderTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/DataProviderTest.php
index 6d66055cd1548..f9237e89817f1 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/DataProviderTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/DataProviderTest.php
@@ -60,7 +60,7 @@ private function createDataProvider(): DataProvider
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$objectManager = Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php
index 5b24c4e22191a..d9d8639cc9601 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php
@@ -45,7 +45,7 @@ class SaveHandlerTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productRepository = $objectManager->create(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryLinkManagementTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryLinkManagementTest.php
index 50d0ddbf5dccf..2326e3bfd8056 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryLinkManagementTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryLinkManagementTest.php
@@ -55,7 +55,7 @@ class CategoryLinkManagementTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->tableMaintainer = $this->objectManager->get(TableMaintainer::class);
@@ -70,7 +70,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->objectManager->removeSharedInstance(CategoryLinkRepository::class);
$this->objectManager->removeSharedInstance(CategoryRepository::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryRepositoryTest.php
index c4cabe46f5b32..bfacdb85bbcce 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryRepositoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryRepositoryTest.php
@@ -51,7 +51,7 @@ class CategoryRepositoryTest extends TestCase
*
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->repositoryFactory = Bootstrap::getObjectManager()->get(CategoryRepositoryInterfaceFactory::class);
$this->layoutManager = Bootstrap::getObjectManager()->get(CategoryLayoutUpdateManager::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTest.php
index 5ec0427093997..13437554febd3 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTest.php
@@ -58,7 +58,7 @@ class CategoryTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
/** @var $storeManager StoreManagerInterface */
@@ -213,9 +213,15 @@ public function testGetCustomDesignDate(): void
public function testGetDesignAttributes(): void
{
- $attributes = $this->_model->getDesignAttributes();
- $this->assertContains('custom_design_from', array_keys($attributes));
- $this->assertContains('custom_design_to', array_keys($attributes));
+ $attributeCodes = array_map(
+ function ($elem) {
+ return $elem->getAttributeCode();
+ },
+ $this->_model->getDesignAttributes()
+ );
+
+ $this->assertContains('custom_design_from', $attributeCodes);
+ $this->assertContains('custom_design_to', $attributeCodes);
}
public function testCheckId(): void
@@ -363,7 +369,7 @@ public function testAddChildCategory(): void
$this->_model->setData($data);
$this->categoryResource->save($this->_model);
$parentCategory = $this->categoryRepository->get(333);
- $this->assertContains($this->_model->getId(), $parentCategory->getChildren());
+ $this->assertStringContainsString((string)$this->_model->getId(), $parentCategory->getChildren());
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php
index 8eeba1230f8b1..30aabab288215 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php
@@ -21,7 +21,7 @@ class CategoryTreeTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Category::class
@@ -78,19 +78,21 @@ public function testMove()
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testMoveWrongParent()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$this->_model->load(7);
$this->_model->move(100, 0);
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testMoveWrongId()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$this->_model->move(100, 0);
}
@@ -115,11 +117,11 @@ public function testGetParentId()
public function testGetParentIds()
{
- $this->assertEquals([], $this->_model->getParentIds());
+ $this->assertEmpty($this->_model->getParentIds());
$this->_model->unsetData();
$this->_model->load(4);
- $this->assertContains(3, $this->_model->getParentIds());
- $this->assertNotContains(4, $this->_model->getParentIds());
+ $this->assertContainsEquals(3, $this->_model->getParentIds());
+ $this->assertNotContainsEquals(4, $this->_model->getParentIds());
}
public function testGetChildren()
@@ -171,37 +173,37 @@ public function testGetLevel()
public function testGetAnchorsAbove()
{
$this->_model->load(4);
- $this->assertContains(3, $this->_model->getAnchorsAbove());
+ $this->assertContainsEquals(3, $this->_model->getAnchorsAbove());
$this->_model->load(5);
- $this->assertContains(4, $this->_model->getAnchorsAbove());
+ $this->assertContainsEquals(4, $this->_model->getAnchorsAbove());
}
public function testGetParentCategories()
{
$this->_model->load(5);
$parents = $this->_model->getParentCategories();
- $this->assertEquals(3, count($parents));
+ $this->assertCount(3, $parents);
}
public function testGetParentCategoriesEmpty()
{
$this->_model->load(1);
$parents = $this->_model->getParentCategories();
- $this->assertEquals(0, count($parents));
+ $this->assertCount(0, $parents);
}
public function testGetChildrenCategories()
{
$this->_model->load(3);
$children = $this->_model->getChildrenCategories();
- $this->assertEquals(2, count($children));
+ $this->assertCount(2, $children);
}
public function testGetChildrenCategoriesEmpty()
{
$this->_model->load(5);
$children = $this->_model->getChildrenCategories();
- $this->assertEquals(0, count($children));
+ $this->assertCount(0, $children);
}
public function testGetParentDesignCategory()
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php
index 59b991b5e3621..36379adcee601 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php
@@ -22,7 +22,7 @@ class ConfigTest extends \PHPUnit\Framework\TestCase
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->config = $this->objectManager->get(Config::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/DesignTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/DesignTest.php
index 38960ab66399a..859acb98adcba 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/DesignTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/DesignTest.php
@@ -16,7 +16,7 @@ class DesignTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Design::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php
index 569cf2357675c..51ebc4b03310e 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ImageUploaderTest.php
@@ -37,7 +37,7 @@ class ImageUploaderTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Framework\Filesystem $filesystem */
@@ -98,12 +98,13 @@ public function testMoveFileFromTmp(): void
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage File validation failed.
* @return void
*/
public function testSaveFileToTmpDirWithWrongExtension(): void
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('File validation failed.');
+
$fileName = 'text.txt';
$tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP);
$filePath = $tmpDirectory->getAbsolutePath($fileName);
@@ -124,12 +125,13 @@ public function testSaveFileToTmpDirWithWrongExtension(): void
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage File validation failed.
* @return void
*/
public function testSaveFileToTmpDirWithWrongFile(): void
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('File validation failed.');
+
$fileName = 'file.gif';
$tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP);
$filePath = $tmpDirectory->getAbsolutePath($fileName);
@@ -152,7 +154,7 @@ public function testSaveFileToTmpDirWithWrongFile(): void
/**
* @inheritdoc
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/Product/Action/FullTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/Product/Action/FullTest.php
index 54d717747d046..105e36f7b0b5e 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/Product/Action/FullTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/Product/Action/FullTest.php
@@ -38,7 +38,7 @@ class FullTest extends \PHPUnit\Framework\TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$preferenceObject = $this->objectManager->get(PreferenceObject::class);
@@ -50,7 +50,7 @@ protected function setUp()
/**
* @inheritDoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->objectManager->removeSharedInstance(OriginObject::class);
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php
index dab47c818ece9..7082b9cb7cbdb 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php
@@ -32,7 +32,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
*/
private $categoryRepository;
- protected function setUp()
+ protected function setUp(): void
{
/** @var \Magento\Framework\Indexer\IndexerInterface indexer */
$this->indexer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/FlatTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/FlatTest.php
index 58a7a0fbb2ace..4657621a196eb 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/FlatTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/FlatTest.php
@@ -56,7 +56,7 @@ class FlatTest extends \Magento\TestFramework\Indexer\TestCase
*/
protected static $totalBefore = 0;
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
self::loadAttributeCodes();
@@ -76,7 +76,7 @@ public function testEntityItemsBefore()
$category = $this->instantiateCategoryModel();
$result = $category->getCollection()->getAllIds();
$this->assertNotEmpty($result);
- $this->assertTrue(is_array($result));
+ $this->assertIsArray($result);
}
/**
@@ -128,7 +128,7 @@ public function testCreateCategory()
$this->createSubCategoriesInDefaultCategory();
$result = $this->getLoadedDefaultCategory()->getCollection()->getItems();
- $this->assertTrue(is_array($result));
+ $this->assertIsArray($result);
$this->assertEquals(self::$defaultCategoryId, $result[self::$categoryOne]->getParentId());
$this->assertEquals(self::$categoryOne, $result[self::$categoryTwo]->getParentId());
@@ -236,7 +236,7 @@ public function testDeleteCategory()
$category = $this->instantiateCategoryModel();
$result = $category->getCollection()->getAllIds();
$this->assertNotEmpty($result);
- $this->assertTrue(is_array($result));
+ $this->assertIsArray($result);
$this->assertCount($countBeforeModification, $result);
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/CategoryIndexTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/CategoryIndexTest.php
index 06f083781aa26..e407a8d67b5c2 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/CategoryIndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/CategoryIndexTest.php
@@ -63,7 +63,7 @@ class CategoryIndexTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/FullTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/FullTest.php
index d1e040a307587..82069209e4c96 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/FullTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/FullTest.php
@@ -17,7 +17,7 @@ class FullTest extends \Magento\TestFramework\Indexer\TestCase
*/
protected $_processor;
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
$db = Bootstrap::getInstance()->getBootstrap()
->getApplication()
@@ -30,7 +30,7 @@ public static function setUpBeforeClass()
parent::setUpBeforeClass();
}
- protected function setUp()
+ protected function setUp(): void
{
$this->_processor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Indexer\Product\Eav\Processor::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/RowsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/RowsTest.php
index 3c335a281fc9c..96989b8cea696 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/RowsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/RowsTest.php
@@ -15,7 +15,7 @@ class RowsTest extends \PHPUnit\Framework\TestCase
*/
protected $_productAction;
- protected function setUp()
+ protected function setUp(): void
{
$this->_productAction = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Catalog\Model\Product\Action::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/FullTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/FullTest.php
index 095fa864ccb41..4313f95f24a8e 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/FullTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/FullTest.php
@@ -40,7 +40,7 @@ class FullTest extends \Magento\TestFramework\Indexer\TestCase
/**
* @inheritdoc
*/
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
/*
* Due to insufficient search engine isolation for Elasticsearch, this class must explicitly perform
@@ -56,7 +56,7 @@ public static function setUpBeforeClass()
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->_state = $this->objectManager->get(State::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RelationTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RelationTest.php
index 72f1d330ee7d6..51b1d4fdb7fe0 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RelationTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RelationTest.php
@@ -43,7 +43,7 @@ class RelationTest extends \Magento\TestFramework\Indexer\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -105,7 +105,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
foreach ($this->flatUpdated as $flatTable) {
$this->connection->dropColumn($flatTable, 'child_id');
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowsTest.php
index 1252245a259c2..df496c6de730f 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowsTest.php
@@ -52,7 +52,7 @@ class RowsTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->processor = $objectManager->get(Processor::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/ProcessorTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/ProcessorTest.php
index 9ae9cc6b6629f..5c376517ed143 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/ProcessorTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/ProcessorTest.php
@@ -22,7 +22,7 @@ class ProcessorTest extends \Magento\TestFramework\Indexer\TestCase
*/
protected $_processor;
- protected function setUp()
+ protected function setUp(): void
{
$this->_state = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Catalog\Model\Indexer\Product\Flat\State::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/FullTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/FullTest.php
index d5d7aae5832d3..29d616057bf32 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/FullTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/FullTest.php
@@ -15,7 +15,7 @@ class FullTest extends \PHPUnit\Framework\TestCase
*/
protected $_processor;
- protected function setUp()
+ protected function setUp(): void
{
$this->_processor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Catalog\Model\Indexer\Product\Price\Processor::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowTest.php
index 83ceda5bc1ce4..acf5e4fd02390 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowTest.php
@@ -20,7 +20,7 @@ class RowTest extends \PHPUnit\Framework\TestCase
*/
protected $_processor;
- protected function setUp()
+ protected function setUp(): void
{
$this->_product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Product::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowsTest.php
index 9e297726f99ad..0c082daa6b55e 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowsTest.php
@@ -20,7 +20,7 @@ class RowsTest extends \PHPUnit\Framework\TestCase
*/
protected $_processor;
- protected function setUp()
+ protected function setUp(): void
{
$this->_product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Product::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/SimpleWithOptionsTierPriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/SimpleWithOptionsTierPriceTest.php
index d8e49d1e34366..6d43cc8d8d479 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/SimpleWithOptionsTierPriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/SimpleWithOptionsTierPriceTest.php
@@ -30,7 +30,7 @@ class SimpleWithOptionsTierPriceTest extends \PHPUnit\Framework\TestCase
*/
private $productCollectionFactory;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/SimpleWithOptionsTierPriceWithDimensionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/SimpleWithOptionsTierPriceWithDimensionTest.php
index 80af901788dd8..6c718f948eac8 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/SimpleWithOptionsTierPriceWithDimensionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/SimpleWithOptionsTierPriceWithDimensionTest.php
@@ -38,7 +38,7 @@ class SimpleWithOptionsTierPriceWithDimensionTest extends \PHPUnit\Framework\Tes
/**
* set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/CategoryTest.php
index d4926e78040d6..36ce8fe76191e 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/CategoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/CategoryTest.php
@@ -20,7 +20,7 @@ class CategoryTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Layer\Category::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/AttributeTest.php
index e1b20a63fa4f7..edd461b082c12 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/AttributeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/AttributeTest.php
@@ -29,7 +29,7 @@ class AttributeTest extends \PHPUnit\Framework\TestCase
*/
protected $_layer;
- protected function setUp()
+ protected function setUp(): void
{
/** @var $attribute \Magento\Catalog\Model\Entity\Attribute */
$attribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
@@ -91,8 +91,8 @@ public function testGetItems()
{
$items = $this->_model->getItems();
- $this->assertInternalType('array', $items);
- $this->assertEquals(1, count($items));
+ $this->assertIsArray($items);
+ $this->assertCount(1, $items);
/** @var $item \Magento\Catalog\Model\Layer\Filter\Item */
$item = $items[0];
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/CategoryTest.php
index 0090ff38c2a48..07fcd88bd1d2d 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/CategoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/CategoryTest.php
@@ -24,7 +24,7 @@ class CategoryTest extends \PHPUnit\Framework\TestCase
*/
protected $_category;
- protected function setUp()
+ protected function setUp(): void
{
$this->_category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Category::class
@@ -135,8 +135,8 @@ public function testGetItems()
$items = $model->getItems();
- $this->assertInternalType('array', $items);
- $this->assertEquals(2, count($items));
+ $this->assertIsArray($items);
+ $this->assertCount(2, $items);
/** @var $item \Magento\Catalog\Model\Layer\Filter\Item */
$item = $items[0];
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/PriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/PriceTest.php
index d2fb64813dd1e..f7444ca1caaae 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/PriceTest.php
@@ -18,7 +18,7 @@ class PriceTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Category::class
@@ -71,17 +71,17 @@ public function testGetMaxPriceInt()
public function getRangeItemCountsDataProvider()
{
return [
- [1, [11 => 2, 46 => 1]],
- [10, [2 => 2, 5 => 1]],
- [20, [1 => 2, 3 => 1]],
- [50, [1 => 3]]
+ // These are $inputRange, [$expectedItemCounts] values
+ [1, [11 => 2, 46 => 1, 16 => '1']],
+ [10, [2 => 3, 5 => 1]],
+ [20, [1 => 3, 3 => 1]],
+ [50, [1 => 4]]
];
}
/**
* @magentoDataFixture Magento/Catalog/_files/categories.php
* @magentoDbIsolation disabled
- * @magentoConfigFixture default/catalog/search/engine mysql
* @dataProvider getRangeItemCountsDataProvider
*/
public function testGetRangeItemCounts($inputRange, $expectedItemCounts)
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DecimalTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DecimalTest.php
index 2d6b894ac69f8..ad4aa3e8369da 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DecimalTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DecimalTest.php
@@ -20,7 +20,7 @@ class DecimalTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmAdvancedTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmAdvancedTest.php
index 1964b465a9141..a3b2862aa2d20 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmAdvancedTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmAdvancedTest.php
@@ -17,7 +17,6 @@ class AlgorithmAdvancedTest extends \PHPUnit\Framework\TestCase
* @magentoDataFixture Magento/Catalog/Model/Layer/Filter/Price/_files/products_advanced.php
* @magentoDbIsolation disabled
* @magentoAppIsolation enabled
- * @magentoConfigFixture default/catalog/search/engine mysql
* @covers \Magento\Framework\Search\Dynamic\Algorithm::calculateSeparators
*/
public function testWithoutLimits()
@@ -90,7 +89,6 @@ protected function _prepareFilter($layer, $priceResource, $request = null)
* @magentoDataFixture Magento/Catalog/Model/Layer/Filter/Price/_files/products_advanced.php
* @magentoDbIsolation disabled
* @magentoAppIsolation enabled
- * @magentoConfigFixture default/catalog/search/engine mysql
* @covers \Magento\Framework\Search\Dynamic\Algorithm::calculateSeparators
*/
public function testWithLimits()
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php
index e3a948d6c63de..55fa56a5000c1 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php
@@ -38,8 +38,10 @@ class AlgorithmBaseTest extends \PHPUnit\Framework\TestCase
/**
* @magentoDbIsolation disabled
* @magentoAppIsolation enabled
- * @magentoConfigFixture default/catalog/search/engine mysql
* @dataProvider pricesSegmentationDataProvider
+ * @param $categoryId
+ * @param array $entityIds
+ * @param array $intervalItems
* @covers \Magento\Framework\Search\Dynamic\Algorithm::calculateSeparators
*/
public function testPricesSegmentation($categoryId, array $entityIds, array $intervalItems)
@@ -110,10 +112,10 @@ public function testPricesSegmentation($categoryId, array $entityIds, array $int
);
$items = $model->calculateSeparators($interval);
- $this->assertEquals(array_keys($intervalItems), array_keys($items));
+ $this->assertEquals($intervalItems, $items);
for ($i = 0, $count = count($intervalItems); $i < $count; ++$i) {
- $this->assertInternalType('array', $items[$i]);
+ $this->assertIsArray($items[$i]);
$this->assertEquals($intervalItems[$i]['from'], $items[$i]['from']);
$this->assertEquals($intervalItems[$i]['to'], $items[$i]['to']);
$this->assertEquals($intervalItems[$i]['count'], $items[$i]['count']);
@@ -129,15 +131,40 @@ public function testPricesSegmentation($categoryId, array $entityIds, array $int
public function pricesSegmentationDataProvider()
{
$testCases = include __DIR__ . '/_files/_algorithm_base_data.php';
+ $testCasesNew = $this->getUnSkippedTestCases($testCases);
$result = [];
- foreach ($testCases as $index => $testCase) {
+ foreach ($testCasesNew as $index => $testCase) {
$result[] = [
$index + 4, //category id
$testCase[1],
$testCase[2],
];
}
-
return $result;
}
+
+ /**
+ * Get unSkipped test cases from dataProvider
+ *
+ * @param array $testCases
+ * @return array
+ */
+ private function getUnSkippedTestCases(array $testCases) : array
+ {
+ // TO DO UnSkip skipped test cases and remove this function
+ $SkippedTestCases = [];
+ $UnSkippedTestCases = [];
+ foreach ($testCases as $testCase) {
+ if (array_key_exists('incomplete_reason', $testCase)) {
+ if ($testCase['incomplete_reason'] === " ") {
+ $UnSkippedTestCases [] = $testCase;
+ } else {
+ if ($testCase['incomplete_reason'] != " ") {
+ $SkippedTestCases [] = $testCase;
+ }
+ }
+ }
+ }
+ return $UnSkippedTestCases;
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/_algorithm_base_data.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/_algorithm_base_data.php
index c8bb8b55dc048..84f82d4480e49 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/_algorithm_base_data.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/_files/_algorithm_base_data.php
@@ -8,21 +8,34 @@
* Test cases for pricesSegmentationDataProvider
*/
$testCases = [
- // no products, no prices
- [[], [], []],
- // small prices
+ // some test cases are skipped, as part of stabilization
+ // no products, no prices data set 0
+ [
+ [], [],
+ [
+ ['from' => 0, 'to' => '', 'count' => 138]
+ ],
+ 'incomplete_reason' => ' '
+ ],
+ // small prices data set 1
[
range(0.01, 0.08, 0.01),
range(1, 8, 1),
- [['from' => 0, 'to' => 0.05, 'count' => 4], ['from' => 0.05, 'to' => '', 'count' => 4]]
+ [
+ ['from' => 0, 'to' => '', 'count' => 138]
+ ],
+ 'incomplete_reason' => ' '
],
- // zero price test
+ // zero price test data set 2
[
[0, 0.71, 0.89],
range(9, 11, 1),
- [['from' => 0, 'to' => 0, 'count' => 1], ['from' => 0.5, 'to' => '', 'count' => 2]]
+ [
+ ['from' => 0, 'to' => '', 'count' => 138]
+ ],
+ 'incomplete_reason' => ' '
],
- // first quantile should be skipped
+ // first quantile should be skipped data set 3
[
[
0.01,
@@ -48,15 +61,31 @@
0.15,
],
range(12, 32, 1),
- [['from' => 0, 'to' => 0.05, 'count' => 12], ['from' => 0.05, 'to' => '', 'count' => 9]]
+ [
+ ['from' => 0, 'to' => 0.05, 'count' => 12.0], ['from' => 0.05, 'to' => '', 'count' => 126.0],
+ ],
+ 'incomplete_reason' => ' '
+ ],
+ // test many equal values data set 4
+ [
+ array_merge([10.57], array_fill(0, 20, 10.58), [10.59]),
+ range(63, 84, 1),
+ [
+ ['from' => 0, 'to' => 15.0, 'count' => 13.0], ['from' => 15.0, 'to' => '', 'count' => 125.0],
+ ],
+ 'incomplete_reason' => ' '
],
- // test if best rounding factor is used
+ // test if best rounding factor is used data set 5
[
[10.19, 10.2, 10.2, 10.2, 10.21],
range(33, 37, 1),
- [['from' => 10.19, 'to' => 10.19, 'count' => 1], ['from' => 10.2, 'to' => '', 'count' => 4]]
+ [
+ ['from' => 10.19, 'to' => 10.19, 'count' => 1], ['from' => 10.2, 'to' => '', 'count' => 4],
+ ],
+ 'incomplete_reason' => 'MC-33826:'
+ . 'Stabilize skipped test cases for Integration AlgorithmBaseTest with elasticsearch'
],
- // quantiles interception
+ // quantiles interception data set 6
[
[
5.99,
@@ -85,25 +114,21 @@
['from' => 0, 'to' => 9, 'count' => 5],
['from' => 9.99, 'to' => 9.99, 'count' => 5],
['from' => 10, 'to' => '', 'count' => 10]
- ]
+ ],
+ 'incomplete_reason' => 'MC-33826:'
+ . 'Stabilize skipped test cases for Integration AlgorithmBaseTest with elasticsearch'
],
- // test if best rounding factor is used
+ // test if best rounding factor is used data set 7
[
[10.18, 10.19, 10.19, 10.19, 10.2],
range(58, 62, 1),
- [['from' => 0, 'to' => 10.2, 'count' => 4], ['from' => 10.2, 'to' => 10.2, 'count' => 1]]
- ],
- // test many equal values
- [
- array_merge([10.57], array_fill(0, 20, 10.58), [10.59]),
- range(63, 84, 1),
[
- ['from' => 10.57, 'to' => 10.57, 'count' => 1],
- ['from' => 10.58, 'to' => 10.58, 'count' => 20],
- ['from' => 10.59, 'to' => 10.59, 'count' => 1]
- ]
+ ['from' => 0, 'to' => 10.2, 'count' => 4], ['from' => 10.2, 'to' => 10.2, 'count' => 1]
+ ],
+ 'incomplete_reason' => 'MC-33826:'
+ . 'Stabilize skipped test cases for Integration AlgorithmBaseTest with elasticsearch',
],
- // test preventing low count in interval and rounding factor to have lower priority
+ // test preventing low count in interval and rounding factor to have lower priority data set 8
[
[
0.01,
@@ -171,7 +196,9 @@
['from' => 10, 'to' => 100, 'count' => 7],
['from' => 100, 'to' => 500, 'count' => 8],
['from' => 500, 'to' => '', 'count' => 8]
- ]
+ ],
+ 'incomplete_reason' => 'MC-33826:'
+ . 'Stabilize skipped test cases for Integration AlgorithmBaseTest with elasticsearch',
],
];
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/PriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/PriceTest.php
index 96ed41d9a4076..4ab3d3af2cab4 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/PriceTest.php
@@ -24,7 +24,7 @@ class PriceTest extends \PHPUnit\Framework\TestCase
*/
protected $groupManagement;
- protected function setUp()
+ protected function setUp(): void
{
$category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Category::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layout/DepersonalizePluginTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layout/DepersonalizePluginTest.php
index 43b5422dbb90a..13de41eba389a 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layout/DepersonalizePluginTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layout/DepersonalizePluginTest.php
@@ -39,7 +39,7 @@ class DepersonalizePluginTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->catalogSession = Bootstrap::getObjectManager()->get(CatalogSession::class);
$this->layout = Bootstrap::getObjectManager()->get(LayoutFactory::class)->create();
@@ -49,7 +49,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->catalogSession->clearStorage();
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ActionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ActionTest.php
index 19f5e78b2537a..4cb6d33c47e74 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ActionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ActionTest.php
@@ -19,7 +19,7 @@ class ActionTest extends \PHPUnit\Framework\TestCase
*/
private $objectManager;
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
/** @var \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry */
$indexerRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
@@ -27,7 +27,7 @@ public static function setUpBeforeClass()
$indexerRegistry->get(Fulltext::INDEXER_ID)->setScheduled(true);
}
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -152,7 +152,7 @@ public function updateAttributesDataProvider()
];
}
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
/** @var \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry */
$indexerRegistry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/PriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/PriceTest.php
index 297414202f584..19a23d8543870 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/PriceTest.php
@@ -30,7 +30,7 @@ class PriceTest extends \PHPUnit\Framework\TestCase
/** @var ProductRepositoryInterface */
private $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var ReinitableConfigInterface $reinitiableConfig */
@@ -105,7 +105,7 @@ public function testAfterSave()
$product->setStoreId($globalStoreId);
$product->getResource()->save($product);
$product = $this->productRepository->get('simple', false, $globalStoreId, true);
- $this->assertEquals('9.99', $product->getPrice());
+ $this->assertEquals('9.990000', $product->getPrice());
}
/**
@@ -140,10 +140,10 @@ public function testAfterSaveWithDifferentStores()
$this->assertEquals(10, $product->getPrice());
$product = $this->productRepository->get('simple', false, $secondStoreId, true);
- $this->assertEquals('9.99', $product->getPrice());
+ $this->assertEquals('9.990000', $product->getPrice());
$product = $this->productRepository->get('simple', false, $thirdStoreId, true);
- $this->assertEquals('9.99', $product->getPrice());
+ $this->assertEquals('9.990000', $product->getPrice());
}
/**
@@ -179,10 +179,10 @@ public function testAfterSaveWithSameCurrency()
$this->assertEquals(10, $product->getPrice());
$product = $this->productRepository->get('simple', false, $secondStoreId, true);
- $this->assertEquals('9.99', $product->getPrice());
+ $this->assertEquals('9.990000', $product->getPrice());
$product = $this->productRepository->get('simple', false, $thirdStoreId, true);
- $this->assertEquals('9.99', $product->getPrice());
+ $this->assertEquals('9.990000', $product->getPrice());
}
/**
@@ -218,10 +218,10 @@ public function testAfterSaveWithUseDefault()
$this->assertEquals(10, $product->getPrice());
$product = $this->productRepository->get('simple', false, $secondStoreId, true);
- $this->assertEquals('9.99', $product->getPrice());
+ $this->assertEquals('9.990000', $product->getPrice());
$product = $this->productRepository->get('simple', false, $thirdStoreId, true);
- $this->assertEquals('9.99', $product->getPrice());
+ $this->assertEquals('9.990000', $product->getPrice());
$product->setStoreId($thirdStoreId);
$product->setPrice(null);
@@ -293,7 +293,7 @@ public function testAfterSaveForWebsitesWithDifferentCurrencies()
$this->assertEquals(100, $product->getPrice());
}
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
parent::tearDownAfterClass();
/** @var ReinitableConfigInterface $reinitiableConfig */
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php
index 973d290d61466..bcba571d2333c 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php
@@ -37,7 +37,7 @@ class TierpriceTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Product\Attribute\Backend\Tierprice::class
@@ -78,10 +78,11 @@ public function testValidate()
* Test that duplicated tier price values issues exception during validation.
*
* @dataProvider validateDuplicateDataProvider
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testValidateDuplicate(array $tierPricesData)
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$product = new \Magento\Framework\DataObject();
$product->setTierPrice($tierPricesData);
@@ -112,10 +113,11 @@ public function validateDuplicateDataProvider(): array
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testValidateDuplicateWebsite()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$product = new \Magento\Framework\DataObject();
$product->setTierPrice(
[
@@ -129,10 +131,11 @@ public function testValidateDuplicateWebsite()
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testValidatePercentage()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$product = new \Magento\Framework\DataObject();
$product->setTierPrice(
[
@@ -155,7 +158,7 @@ public function testPreparePriceData()
];
$newData = $this->_model->preparePriceData($data, \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE, 1);
- $this->assertEquals(4, count($newData));
+ $this->assertCount(4, $newData);
$this->assertArrayHasKey('1-2', $newData);
$this->assertArrayHasKey('1-5', $newData);
$this->assertArrayHasKey('1-5.3', $newData);
@@ -175,7 +178,7 @@ public function testAfterLoad()
$this->_model->afterLoad($product);
$price = $product->getTierPrice();
$this->assertNotEmpty($price);
- $this->assertEquals(5, count($price));
+ $this->assertCount(5, $price);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php
index d2ab4d69dc45c..12aed27e32d44 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php
@@ -36,7 +36,7 @@ abstract class AbstractAttributeTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php
index 5de9d30f71638..1bc2f581fa069 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php
@@ -44,6 +44,7 @@ public function testNegativeValue(): void
/**
* @dataProvider productProvider
* @param string $productSku
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function testDefaultValue(string $productSku): void
{
@@ -88,6 +89,6 @@ protected function getAttributeCode(): string
*/
protected function getDefaultAttributeValue(): string
{
- return '100';
+ return '100.000000';
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/SetTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/SetTest.php
index d5a8b694b7718..d28ea2b4151db 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/SetTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/SetTest.php
@@ -76,7 +76,7 @@ class SetTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->objectManager = Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php
index bfcd9a17b7ce1..33e82e9f6ddcc 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php
@@ -14,7 +14,7 @@ class CountryofmanufactureTest extends \PHPUnit\Framework\TestCase
*/
private $model;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->model = $objectManager->create(
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Compare/ListCompareTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Compare/ListCompareTest.php
index 98b264a8991bc..7ce6b8cfff7a0 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Compare/ListCompareTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Compare/ListCompareTest.php
@@ -21,7 +21,7 @@ class ListCompareTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\Customer\Model\Session */
protected $_session;
- protected function setUp()
+ protected function setUp(): void
{
/** @var $session \Magento\Customer\Model\Session */
$this->_session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
@@ -35,7 +35,7 @@ protected function setUp()
->create(\Magento\Catalog\Model\Product\Compare\ListCompare::class, ['customerVisitor' => $this->_visitor]);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_session->setCustomerId(null);
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/CreateCustomOptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/CreateCustomOptionsTest.php
index cab75c7848f06..0a60f1153447d 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/CreateCustomOptionsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/CreateCustomOptionsTest.php
@@ -66,7 +66,7 @@ class CreateCustomOptionsTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/DeleteCustomOptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/DeleteCustomOptionsTest.php
index 8039d3515e304..ddcca81b1ed4d 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/DeleteCustomOptionsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/DeleteCustomOptionsTest.php
@@ -52,7 +52,7 @@ class DeleteCustomOptionsTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/CreateHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/CreateHandlerTest.php
index 2277470e33b12..bb841e52d4d49 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/CreateHandlerTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/CreateHandlerTest.php
@@ -61,7 +61,7 @@ class CreateHandlerTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->createHandler = $this->objectManager->create(CreateHandler::class);
@@ -102,14 +102,15 @@ public function testExecuteWithImageDuplicate(): void
* Check sanity of posted image file name.
*
* @param string $imageFileName
- * @expectedException \Magento\Framework\Exception\FileSystemException
- * @expectedExceptionMessageRegExp ".+ file doesn't exist."
- * @expectedExceptionMessageRegExp "/^((?!\.\.\/).)*$/"
* @dataProvider illegalFilenameDataProvider
* @return void
*/
public function testExecuteWithIllegalFilename(string $imageFileName): void
{
+ $this->expectException(\Magento\Framework\Exception\FileSystemException::class);
+ $this->expectExceptionMessageMatches('".+ file doesn\'t exist."');
+ $this->expectExceptionMessageMatches('/^((?!\.\.\/).)*$/');
+
$data = [
'media_gallery' => ['images' => ['image' => ['file' => $imageFileName, 'label' => 'New image']]],
];
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/ProcessorTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/ProcessorTest.php
index 1e5f70bf6a870..f836fe9cbb96a 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/ProcessorTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/ProcessorTest.php
@@ -28,7 +28,7 @@ class ProcessorTest extends \PHPUnit\Framework\TestCase
*/
protected static $_mediaDir;
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Framework\Filesystem\Directory\WriteInterface $mediaDirectory */
@@ -51,7 +51,7 @@ public static function setUpBeforeClass()
copy($fixtureDir . "/magento_small_image.jpg", self::$_mediaTmpDir . "/magento_small_image.jpg");
}
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Catalog\Model\Product\Media\Config $config */
@@ -72,7 +72,7 @@ public static function tearDownAfterClass()
}
}
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Product\Gallery\Processor::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/ReadHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/ReadHandlerTest.php
index 89b91ab57e51a..0b9e02df1514f 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/ReadHandlerTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/ReadHandlerTest.php
@@ -68,7 +68,7 @@ class ReadHandlerTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->readHandler = $this->objectManager->create(ReadHandler::class);
@@ -273,7 +273,7 @@ public function executeOnStoreViewDataProvider(): array
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
parent::tearDown();
$this->galleryResource->getConnection()
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php
index fcee06187f374..f9d235493297f 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/UpdateHandlerTest.php
@@ -82,7 +82,7 @@ class UpdateHandlerTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->fileName = 'image.txt';
$this->objectManager = Bootstrap::getObjectManager();
@@ -140,7 +140,7 @@ public function testExecuteWithOneImage(): void
$this->updateHandler->execute($product);
$productImages = $this->galleryResource->loadProductGalleryByAttributeId($product, $this->mediaAttributeId);
$updatedImage = reset($productImages);
- $this->assertTrue(is_array($updatedImage));
+ $this->assertIsArray($updatedImage);
$this->assertEquals('New image', $updatedImage['label']);
$this->assertEquals('New image', $updatedImage['label_default']);
$this->assertEquals('1', $updatedImage['disabled']);
@@ -342,7 +342,7 @@ public function testExecuteWithTwoImagesOnStoreView(): void
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
parent::tearDown();
$this->mediaDirectory->getDriver()->deleteFile($this->mediaDirectory->getAbsolutePath($this->fileName));
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php
index 37fee97161b2d..1c9b8f2ce1918 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ImageTest.php
@@ -62,12 +62,12 @@ public function testSetWatermark()
$inputFile = 'watermark.png';
$expectedFile = '/somewhere/watermark.png';
- /** @var \Magento\Framework\View\FileSystem|\PHPUnit_Framework_MockObject_MockObject $viewFilesystem */
+ /** @var \Magento\Framework\View\FileSystem|\PHPUnit\Framework\MockObject\MockObject $viewFilesystem */
$viewFileSystem = $this->createMock(\Magento\Framework\View\FileSystem::class);
$viewFileSystem->expects($this->once())
->method('getStaticFileName')
->with($inputFile)
- ->will($this->returnValue($expectedFile));
+ ->willReturn($expectedFile);
/** @var $model \Magento\Catalog\Model\Product\Image */
$model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/LinksTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/LinksTest.php
index b8be34f460dcb..386e9c5079416 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/LinksTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/LinksTest.php
@@ -78,7 +78,7 @@ class LinksTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->objectManager = Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/DateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/DateTest.php
index 8463577c34ed9..8cc00070a2470 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/DateTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/DateTest.php
@@ -27,7 +27,7 @@ class DateTest extends \PHPUnit\Framework\TestCase
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->model = $this->objectManager->create(
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFileTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFileTest.php
index 37ef60208861d..0be889f546a2b 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFileTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorFileTest.php
@@ -25,7 +25,7 @@ class ValidatorFileTest extends \PHPUnit\Framework\TestCase
protected $objectManager;
/**
- * @var \Magento\Framework\HTTP\Adapter\FileTransferFactory|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\Framework\HTTP\Adapter\FileTransferFactory|\PHPUnit\Framework\MockObject\MockObject
*/
protected $httpFactoryMock;
@@ -39,7 +39,7 @@ class ValidatorFileTest extends \PHPUnit\Framework\TestCase
*/
protected $maxFileSize;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->httpFactoryMock = $this->createPartialMock(
@@ -67,13 +67,14 @@ protected function setUp()
}
/**
- * @expectedException \Magento\Framework\Validator\Exception
* @return void
*/
public function testRunValidationException()
{
+ $this->expectException(\Magento\Framework\Validator\Exception::class);
+
$httpAdapterMock = $this->createPartialMock(\Zend_File_Transfer_Adapter_Http::class, ['isValid']);
- $this->httpFactoryMock->expects($this->once())->method('create')->will($this->returnValue($httpAdapterMock));
+ $this->httpFactoryMock->expects($this->once())->method('create')->willReturn($httpAdapterMock);
$this->model->validate(
$this->objectManager->create(\Magento\Framework\DataObject::class),
@@ -99,8 +100,8 @@ public function testLargeSizeFile()
$exception = function () {
throw new \Exception();
};
- $httpAdapterMock->expects($this->once())->method('getFileInfo')->will($this->returnCallback($exception));
- $this->httpFactoryMock->expects($this->once())->method('create')->will($this->returnValue($httpAdapterMock));
+ $httpAdapterMock->expects($this->once())->method('getFileInfo')->willReturnCallback($exception);
+ $this->httpFactoryMock->expects($this->once())->method('create')->willReturn($httpAdapterMock);
$property = new \ReflectionProperty($httpAdapterMock, '_files');
$property->setAccessible(true);
@@ -112,18 +113,19 @@ public function testLargeSizeFile()
}
/**
- * @expectedException \Magento\Catalog\Model\Product\Exception
* @return void
*/
public function testOptionRequiredException()
{
+ $this->expectException(\Magento\Catalog\Model\Product\Exception::class);
+
$this->prepareEnv();
$httpAdapterMock = $this->createPartialMock(\Zend_File_Transfer_Adapter_Http::class, ['getFileInfo']);
$exception = function () {
throw new \Exception();
};
- $httpAdapterMock->expects($this->once())->method('getFileInfo')->will($this->returnCallback($exception));
- $this->httpFactoryMock->expects($this->once())->method('create')->will($this->returnValue($httpAdapterMock));
+ $httpAdapterMock->expects($this->once())->method('getFileInfo')->willReturnCallback($exception);
+ $this->httpFactoryMock->expects($this->once())->method('create')->willReturn($httpAdapterMock);
$property = new \ReflectionProperty($httpAdapterMock, '_files');
$property->setAccessible(true);
@@ -135,15 +137,16 @@ public function testOptionRequiredException()
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
* @return void
*/
public function testException()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$this->prepareEnv();
$httpAdapterMock = $this->createPartialMock(\Zend_File_Transfer_Adapter_Http::class, ['isUploaded']);
- $httpAdapterMock->expects($this->once())->method('isUploaded')->will($this->returnValue(false));
- $this->httpFactoryMock->expects($this->once())->method('create')->will($this->returnValue($httpAdapterMock));
+ $httpAdapterMock->expects($this->once())->method('isUploaded')->willReturn(false);
+ $this->httpFactoryMock->expects($this->once())->method('create')->willReturn($httpAdapterMock);
$property = new \ReflectionProperty($httpAdapterMock, '_files');
$property->setAccessible(true);
@@ -217,8 +220,8 @@ public function testValidate()
{
$this->prepareGoodEnv();
$httpAdapterMock = $this->createPartialMock(\Zend_File_Transfer_Adapter_Http::class, ['isValid']);
- $httpAdapterMock->expects($this->once())->method('isValid')->will($this->returnValue(true));
- $this->httpFactoryMock->expects($this->once())->method('create')->will($this->returnValue($httpAdapterMock));
+ $httpAdapterMock->expects($this->once())->method('isValid')->willReturn(true);
+ $this->httpFactoryMock->expects($this->once())->method('create')->willReturn($httpAdapterMock);
$property = new \ReflectionProperty($httpAdapterMock, '_files');
$property->setAccessible(true);
@@ -239,8 +242,8 @@ public function testEmptyFile()
$this->expectExceptionMessage('The file is empty. Select another file and try again.');
$httpAdapterMock = $this->createPartialMock(\Zend_File_Transfer_Adapter_Http::class, ['isValid']);
- $httpAdapterMock->expects($this->once())->method('isValid')->will($this->returnValue(true));
- $this->httpFactoryMock->expects($this->once())->method('create')->will($this->returnValue($httpAdapterMock));
+ $httpAdapterMock->expects($this->once())->method('isValid')->willReturn(true);
+ $this->httpFactoryMock->expects($this->once())->method('create')->willReturn($httpAdapterMock);
$property = new \ReflectionProperty($httpAdapterMock, '_files');
$property->setAccessible(true);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php
index d4214a32f31dc..0718e3f3b9d64 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php
@@ -26,14 +26,14 @@ class ValidatorInfoTest extends \PHPUnit\Framework\TestCase
protected $maxFileSizeInMb;
/**
- * @var \Magento\Catalog\Model\Product\Option\Type\File\ValidateFactory|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\Catalog\Model\Product\Option\Type\File\ValidateFactory|\PHPUnit\Framework\MockObject\MockObject
*/
protected $validateFactoryMock;
/**
* {@inheritdoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Framework\File\Size $fileSize */
@@ -69,16 +69,16 @@ public function testExceptionWithErrors()
);
$validateMock = $this->createPartialMock(\Zend_Validate::class, ['isValid', 'getErrors']);
- $validateMock->expects($this->once())->method('isValid')->will($this->returnValue(false));
- $validateMock->expects($this->exactly(2))->method('getErrors')->will($this->returnValue([
+ $validateMock->expects($this->once())->method('isValid')->willReturn(false);
+ $validateMock->expects($this->exactly(2))->method('getErrors')->willReturn([
\Zend_Validate_File_ExcludeExtension::FALSE_EXTENSION,
\Zend_Validate_File_Extension::FALSE_EXTENSION,
\Zend_Validate_File_ImageSize::WIDTH_TOO_BIG,
\Zend_Validate_File_FilesSize::TOO_BIG,
- ]));
+ ]);
$this->validateFactoryMock->expects($this->once())
->method('create')
- ->will($this->returnValue($validateMock));
+ ->willReturn($validateMock);
$this->model->validate(
$this->getOptionValue(),
@@ -97,11 +97,11 @@ public function testExceptionWithoutErrors()
);
$validateMock = $this->createPartialMock(\Zend_Validate::class, ['isValid', 'getErrors']);
- $validateMock->expects($this->once())->method('isValid')->will($this->returnValue(false));
- $validateMock->expects($this->exactly(1))->method('getErrors')->will($this->returnValue(false));
+ $validateMock->expects($this->once())->method('isValid')->willReturn(false);
+ $validateMock->expects($this->exactly(1))->method('getErrors')->willReturn(false);
$this->validateFactoryMock->expects($this->once())
->method('create')
- ->will($this->returnValue($validateMock));
+ ->willReturn($validateMock);
$this->model->validate(
$this->getOptionValue(),
@@ -118,7 +118,7 @@ public function testValidate()
$validate = $this->objectManager->create(\Zend_Validate::class);
$this->validateFactoryMock->expects($this->once())
->method('create')
- ->will($this->returnValue($validate));
+ ->willReturn($validate);
$this->assertTrue(
$this->model->validate(
$this->getOptionValue(),
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php
index 74082c339bd79..54caa6143b20b 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/TextTest.php
@@ -31,7 +31,7 @@ class TextTest extends TestCase
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->optionText = $this->objectManager->create(Text::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ProductFrontendAction/SynchronizerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ProductFrontendAction/SynchronizerTest.php
index 5cf53349480f1..251853b1f5e2e 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ProductFrontendAction/SynchronizerTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/ProductFrontendAction/SynchronizerTest.php
@@ -27,7 +27,7 @@ class SynchronizerTest extends \PHPUnit\Framework\TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php
index c668e82c0bfa0..c72e7e0e1d078 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php
@@ -16,7 +16,7 @@ class AbstractTypeTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Catalog\Api\ProductRepositoryInterface::class
@@ -199,7 +199,7 @@ public function testPrepareForCartOptionsException()
$product = $repository->get('simple');
// fixture
- $this->assertContains(
+ $this->assertStringContainsString(
"The product's required option(s) weren't entered. Make sure the options are entered and try again.",
$this->_model->prepareForCart(new \Magento\Framework\DataObject(), $product)
);
@@ -225,10 +225,11 @@ public function testCheckProductBuyState()
/**
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testCheckProductBuyStateException()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$repository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\ProductRepository::class
);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceWithDimensionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceWithDimensionTest.php
index fe39de2729eac..ea7a184b0625e 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceWithDimensionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/PriceWithDimensionTest.php
@@ -34,7 +34,7 @@ class PriceWithDimensionTest extends \PHPUnit\Framework\TestCase
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Product\Type\Price::class
@@ -67,10 +67,10 @@ public function testGetPriceFromIndexer()
$return = $connection->fetchAll($select);
- $this->assertEquals('10', $return[0]['price']);
- $this->assertEquals('10', $return[0]['final_price']);
- $this->assertEquals('19', $return[0]['min_price']);
- $this->assertEquals('19', $return[0]['max_price']);
+ $this->assertEquals(10, $return[0]['price']);
+ $this->assertEquals(10, $return[0]['final_price']);
+ $this->assertEquals(19, $return[0]['min_price']);
+ $this->assertEquals(19, $return[0]['max_price']);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/TypeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/TypeTest.php
index dadee3d9b6fac..bc8d777b49316 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/TypeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/TypeTest.php
@@ -12,7 +12,7 @@ class TypeTest extends \PHPUnit\Framework\TestCase
*/
protected $_productType;
- protected function setUp()
+ protected function setUp(): void
{
$this->_productType = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Catalog\Model\Product\Type::class
@@ -173,7 +173,7 @@ public function testGetTypes()
public function testGetCompositeTypes()
{
$types = $this->_productType->getCompositeTypes();
- $this->assertInternalType('array', $types);
+ $this->assertIsArray($types);
$this->assertContains(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE, $types);
}
@@ -209,7 +209,7 @@ public function testGetTypesByPriority()
*/
protected function _assertOptions($options)
{
- $this->assertInternalType('array', $options);
+ $this->assertIsArray($options);
$types = [];
foreach ($options as $option) {
$this->assertArrayHasKey('value', $option);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UpdateCustomOptionsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UpdateCustomOptionsTest.php
index c07303f03e4f1..387f19f67e18d 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UpdateCustomOptionsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UpdateCustomOptionsTest.php
@@ -67,7 +67,7 @@ class UpdateCustomOptionsTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
@@ -86,7 +86,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->storeManager->setCurrentStore($this->currentStoreId);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UpdateProductWebsiteTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UpdateProductWebsiteTest.php
index 646e661419292..c63a3c8249e77 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UpdateProductWebsiteTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UpdateProductWebsiteTest.php
@@ -38,7 +38,7 @@ class UpdateProductWebsiteTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UrlTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UrlTest.php
index 451e19be28e5f..1a41561b60d40 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UrlTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UrlTest.php
@@ -27,7 +27,7 @@ class UrlTest extends \PHPUnit\Framework\TestCase
*/
protected $urlPathGenerator;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Product\Url::class
@@ -139,7 +139,7 @@ public function testGetUrl()
\Magento\Catalog\Model\Product::class
);
$product->setId(100);
- $this->assertContains('catalog/product/view/id/100/', $this->_model->getUrl($product));
+ $this->assertStringContainsString('catalog/product/view/id/100/', $this->_model->getUrl($product));
}
/**
@@ -169,7 +169,7 @@ public function testGetProductUrlWithRearrangedUrlRewrites()
$product = $productRepository->get('simple');
$category = $categoryRepository->get($product->getCategoryIds()[0]);
$registry->register('current_category', $category);
- $this->assertNotContains($category->getUrlPath(), $this->_model->getProductUrl($product));
+ $this->assertStringNotContainsString($category->getUrlPath(), $this->_model->getProductUrl($product));
$rewrites = $urlFinder->findAllByData(
[
@@ -184,6 +184,6 @@ public function testGetProductUrlWithRearrangedUrlRewrites()
}
}
$urlPersist->replace($rewrites);
- $this->assertNotContains($category->getUrlPath(), $this->_model->getProductUrl($product));
+ $this->assertStringNotContainsString($category->getUrlPath(), $this->_model->getProductUrl($product));
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductExternalTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductExternalTest.php
index a1923e63972ee..d80668c6e8e0c 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductExternalTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductExternalTest.php
@@ -33,7 +33,7 @@ class ProductExternalTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -241,8 +241,8 @@ public function testGetProductUrl()
$this->assertStringEndsWith('catalog/product/view/', $this->_model->getUrlInStore());
$this->_model->setId(999);
$url = $this->_model->getProductUrl();
- $this->assertContains('catalog/product/view', $url);
- $this->assertContains('id/999', $url);
+ $this->assertStringContainsString('catalog/product/view', $url);
+ $this->assertStringContainsString('id/999', $url);
$storeUrl = $this->_model->getUrlInStore();
$this->assertEquals($storeUrl, $url);
}
@@ -319,7 +319,7 @@ public function testCustomOptionsApi()
$this->assertTrue($this->_model->hasCustomOptions());
$this->_model->setCustomOptions(['test']);
- $this->assertTrue(is_array($this->_model->getCustomOptions()));
+ $this->assertIsArray($this->_model->getCustomOptions());
}
public function testCanBeShowInCategory()
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php
index 1ed0057ca2486..12eefd8f59b60 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php
@@ -31,7 +31,7 @@ class ProductGettersTest extends \PHPUnit\Framework\TestCase
*/
private $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Product::class
@@ -260,7 +260,7 @@ public function testGetDefaultAttributeSetId()
{
$setId = $this->_model->getDefaultAttributeSetId();
$this->assertNotEmpty($setId);
- $this->assertRegExp('/^[0-9]+$/', $setId);
+ $this->assertMatchesRegularExpression('/^[0-9]+$/', $setId);
}
public function testGetPreconfiguredValues()
@@ -270,7 +270,7 @@ public function testGetPreconfiguredValues()
$this->assertEquals('test', $this->_model->getPreconfiguredValues());
}
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$mediaDirectory = $objectManager->get(
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductHydratorTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductHydratorTest.php
index 9481702183327..49b19c6aa8871 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductHydratorTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductHydratorTest.php
@@ -28,7 +28,7 @@ class ProductHydratorTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->hydratorPool = $this->objectManager->create(HydratorPool::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductLink/ProductLinkQueryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductLink/ProductLinkQueryTest.php
index 8509174e127e7..f5688dbdc5873 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductLink/ProductLinkQueryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductLink/ProductLinkQueryTest.php
@@ -38,7 +38,7 @@ class ProductLinkQueryTest extends TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -134,9 +134,9 @@ public function testSearch(): void
//Determining whether the product is supposed to be linked by SKU
preg_match('/^simple\-related\-(\d+)$/i', $criteria->getBelongsToProductSku(), $productIndex);
$this->assertNotEmpty($productIndex);
- $this->assertFalse(empty($productIndex[1]));
+ $this->assertNotEmpty($productIndex[1]);
$productIndex = (int)$productIndex[1];
- $this->assertRegExp('/^related\-product\-' .$productIndex .'\-\d+$/i', $link->getLinkedProductSku());
+ $this->assertMatchesRegularExpression('/^related\-product\-' .$productIndex .'\-\d+$/i', $link->getLinkedProductSku());
//Position must be set
$this->assertGreaterThan(0, $link->getPosition());
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php
index 7b7a0591d1d97..66e60a24e0a07 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php
@@ -32,7 +32,7 @@ class ProductPriceTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = Bootstrap::getObjectManager()->create(Product::class);
$this->productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceWithDimensionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceWithDimensionTest.php
index 348d6e19b44e3..8b073e85e5bbb 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceWithDimensionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceWithDimensionTest.php
@@ -36,7 +36,7 @@ class ProductPriceWithDimensionTest extends \PHPUnit\Framework\TestCase
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = Bootstrap::getObjectManager()->create(Product::class);
$this->productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductRepositoryTest.php
index fb07d08faca58..0fe3ef55455d2 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductRepositoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductRepositoryTest.php
@@ -56,7 +56,7 @@ class ProductRepositoryTest extends \PHPUnit\Framework\TestCase
/**
* Sets up common objects
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class);
$this->searchCriteriaBuilder = Bootstrap::getObjectManager()->get(SearchCriteriaBuilder::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php
index cb1e07c8c104a..b56e9e502cce6 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php
@@ -50,7 +50,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
@@ -60,7 +60,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Catalog\Model\Product\Media\Config $config */
@@ -653,7 +653,7 @@ public function testSaveWithBackordersEnabled(int $qty, int $stockStatus, bool $
{
$product = $this->productRepository->get('simple-out-of-stock', true, null, true);
$stockItem = $product->getExtensionAttributes()->getStockItem();
- $this->assertEquals(false, $stockItem->getIsInStock());
+ $this->assertFalse($stockItem->getIsInStock());
$stockData = [
'backorders' => 1,
'qty' => $qty,
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php
index 2df9c468ba10a..5b9c7b267f188 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php
@@ -50,7 +50,7 @@ class AttributeTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- public function setUp()
+ protected function setUp(): void
{
CacheCleaner::cleanAll();
$this->objectManager = Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/WebsiteAttributesSynchronizerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/WebsiteAttributesSynchronizerTest.php
index 4857bb0dcc86b..73b40c9839dbb 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/WebsiteAttributesSynchronizerTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/WebsiteAttributesSynchronizerTest.php
@@ -43,7 +43,7 @@ class WebsiteAttributesSynchronizerTest extends \PHPUnit\Framework\TestCase
/**
* @return void
*/
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Category/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Category/CollectionTest.php
index 3b1c23e2ae10c..874862b725341 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Category/CollectionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Category/CollectionTest.php
@@ -18,7 +18,7 @@ class CollectionTest extends \PHPUnit\Framework\TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\ResourceModel\Category\Collection::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Eav/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Eav/AttributeTest.php
index 498c3167ed734..19e62d7a50606 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Eav/AttributeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Eav/AttributeTest.php
@@ -15,7 +15,7 @@ class AttributeTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php
index 2100920ab8ac9..552dd3fbbfdd5 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php
@@ -39,7 +39,7 @@ class CollectionTest extends \PHPUnit\Framework\TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->collection = Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\ResourceModel\Product\Collection::class
@@ -262,7 +262,7 @@ public function testJoinTable()
. ' LEFT JOIN `' . $urlRewriteTable . '` AS `alias` ON (alias.entity_id =e.entity_id)'
. ' AND (alias.entity_type = \'product\')';
- self::assertContains($expected, str_replace(PHP_EOL, '', $sql));
+ self::assertStringContainsString($expected, str_replace(PHP_EOL, '', $sql));
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/SourceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/SourceTest.php
index 78ae21b1441bd..6ecfdbe567c07 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/SourceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/SourceTest.php
@@ -40,7 +40,7 @@ class SourceTest extends \PHPUnit\Framework\TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->source = Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\ResourceModel\Product\Indexer\Eav\Source::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Link/Product/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Link/Product/CollectionTest.php
index ba6f6f3f40ef5..e3f2723d06de7 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Link/Product/CollectionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Link/Product/CollectionTest.php
@@ -16,7 +16,7 @@ class CollectionTest extends \PHPUnit\Framework\TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\ResourceModel\Product\Link\Product\Collection::class
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/ProductTest.php
index f560854fa75f6..ab810aec2c835 100755
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/ProductTest.php
@@ -45,7 +45,7 @@ class ProductTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Webapi/Product/Option/Type/File/ProcessorTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Webapi/Product/Option/Type/File/ProcessorTest.php
index 4d45f95379468..d63306ebafcc7 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Webapi/Product/Option/Type/File/ProcessorTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Webapi/Product/Option/Type/File/ProcessorTest.php
@@ -14,7 +14,7 @@ class ProcessorTest extends \PHPUnit\Framework\TestCase
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -35,17 +35,17 @@ public function testProcessFileContent($pathConfig)
$result = $model->processFileContent($imageContent);
$this->assertArrayHasKey('fullpath', $result);
- $this->assertTrue(file_exists($result['fullpath']));
+ $this->assertFileExists($result['fullpath']);
/** @var $filesystem \Magento\Framework\Filesystem */
$filesystem = $this->objectManager->get(\Magento\Framework\Filesystem::class);
$this->assertArrayHasKey('quote_path', $result);
$filePath = $filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath($result['quote_path']);
- $this->assertTrue(file_exists($filePath));
+ $this->assertFileExists($filePath);
$this->assertArrayHasKey('order_path', $result);
$filePath = $filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath($result['order_path']);
- $this->assertTrue(file_exists($filePath));
+ $this->assertFileExists($filePath);
}
public function pathConfigDataProvider()
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Observer/SwitchPriceAttributeScopeOnConfigChangeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Observer/SwitchPriceAttributeScopeOnConfigChangeTest.php
index a591d45ddd18e..8e23ef8817206 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Observer/SwitchPriceAttributeScopeOnConfigChangeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Observer/SwitchPriceAttributeScopeOnConfigChangeTest.php
@@ -15,7 +15,7 @@ class SwitchPriceAttributeScopeOnConfigChangeTest extends \PHPUnit\Framework\Tes
*/
private $objectManager;
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/CombinationWithDifferentTypePricesTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/CombinationWithDifferentTypePricesTest.php
index 5b55bb32ce669..7d366811952ca 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/CombinationWithDifferentTypePricesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/CombinationWithDifferentTypePricesTest.php
@@ -92,7 +92,7 @@ class CombinationWithDifferentTypePricesTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->objectManager = Bootstrap::getObjectManager();
@@ -112,7 +112,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
parent::tearDown();
$this->registry->unregister('product');
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php
index ee52ec09e3e2a..e9d663adbb681 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php
@@ -38,7 +38,7 @@ class RenderingBasedOnIsProductListFlagTest extends \PHPUnit\Framework\TestCase
*/
private $finalPriceBox;
- protected function setUp()
+ protected function setUp(): void
{
$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
$this->product = $productRepository->get('simple');
@@ -73,7 +73,7 @@ protected function setUp()
public function testRenderingByDefault()
{
$html = $this->finalPriceBox->toHtml();
- self::assertContains('5.99', $html);
+ self::assertStringContainsString('5.99', $html);
$this->assertGreaterThanOrEqual(
1,
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
@@ -103,7 +103,7 @@ public function testRenderingAccordingToIsProductListFlag($flag)
{
$this->finalPriceBox->setData('is_product_list', $flag);
$html = $this->finalPriceBox->toHtml();
- self::assertContains('5.99', $html);
+ self::assertStringContainsString('5.99', $html);
$this->assertGreaterThanOrEqual(
1,
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php
index 8e5b38a4f8802..4933404d0c6da 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php
@@ -71,7 +71,7 @@ class FinalPriceBoxTest extends \PHPUnit\Framework\TestCase
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
@@ -134,7 +134,7 @@ protected function setUp()
public function testRenderAmountMinimalProductWithTierPricesShouldShowMinTierPrice()
{
$result = $this->finalPriceBox->renderAmountMinimal();
- $this->assertContains('$5.00', $result);
+ $this->assertStringContainsString('$5.00', $result);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Attributes/ListingTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Attributes/ListingTest.php
index 08590e6d5f2c2..dabe1c13f33ad 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Attributes/ListingTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Attributes/ListingTest.php
@@ -13,7 +13,7 @@ class ListingTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\Framework\App\RequestInterface */
private $request;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Framework\App\RequestInterface $request */
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractEavTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractEavTest.php
index 3375a4e8e4094..a95a981cb8006 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractEavTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractEavTest.php
@@ -37,7 +37,7 @@ abstract class AbstractEavTest extends TestCase
protected $eavModifier;
/**
- * @var LocatorInterface|PHPUnit_Framework_MockObject_MockObject
+ * @var LocatorInterface|PHPUnit\Framework\MockObject\MockObject
*/
protected $locatorMock;
@@ -79,7 +79,7 @@ abstract class AbstractEavTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$mappings = [
@@ -92,7 +92,7 @@ protected function setUp()
'gallery' => 'image'
];
$this->objectManager = Bootstrap::getObjectManager();
- $this->locatorMock = $this->createMock(LocatorInterface::class);
+ $this->locatorMock = $this->getMockForAbstractClass(LocatorInterface::class);
$this->locatorMock->expects($this->any())->method('getStore')->willReturn(
$this->objectManager->get(StoreInterface::class)
);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php
index 22bb76ca9222d..8ad346af068b4 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php
@@ -22,7 +22,7 @@ class CategoriesTest extends \PHPUnit\Framework\TestCase
*/
private $object;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$registry = $objectManager->get(\Magento\Framework\Registry::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/EavTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/EavTest.php
index 83c6e99df629e..1c709ffcacec7 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/EavTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/EavTest.php
@@ -37,7 +37,7 @@ class EavTest extends AbstractEavTest
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->attributeGroupByName = $this->objectManager->get(GetAttributeGroupByName::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/LayoutUpdateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/LayoutUpdateTest.php
index ebfbd06d7edad..38fcc4554d391 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/LayoutUpdateTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/LayoutUpdateTest.php
@@ -56,7 +56,7 @@ class LayoutUpdateTest extends TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->locator = $this->getMockForAbstractClass(LocatorInterface::class);
$store = Bootstrap::getObjectManager()->create(StoreInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/_files/eav_expected_data_output.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/_files/eav_expected_data_output.php
index ea9d4008a1110..e4402c3cdd56b 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/_files/eav_expected_data_output.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/_files/eav_expected_data_output.php
@@ -9,13 +9,13 @@
"product" => [
"name" => "Simple Product",
"sku" => "simple",
- "price" => "10.0000",
+ "price" => "10.00",
"tax_class_id" => "0",
"quantity_and_stock_status" => [
"is_in_stock" => true,
"qty" => 100.0
],
- "weight" => "1.0000",
+ "weight" => "1.000000",
"visibility" => "4",
"category_ids" => [
"2"
@@ -36,27 +36,27 @@
"website_id" => "0",
"all_groups" => "1",
"cust_group" => 32000,
- "price" => "8.0000",
+ "price" => "8.000000",
"price_qty" => "2.0000",
- "website_price" => "8.0000",
+ "website_price" => "8.000000",
"price_id" => "__placeholder__"
],
[
"website_id" => "0",
"all_groups" => "0",
"cust_group" => "0",
- "price" => "5.0000",
+ "price" => "5.000000",
"price_qty" => "3.0000",
- "website_price" => "5.0000",
+ "website_price" => "5.000000",
"price_id" => "__placeholder__"
],
[
"website_id" => "0",
"all_groups" => "1",
"cust_group" => 32000,
- "price" => "5.0000",
+ "price" => "5.000000",
"price_qty" => "5.0000",
- "website_price" => "5.0000",
+ "website_price" => "5.000000",
"price_id" => "__placeholder__"
]
],
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
index c09d68a66ee8e..28e280318fa1a 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
@@ -33,7 +33,7 @@ class QuantityAndStockStatusTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/attribute_set_based_on_default_set.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/attribute_set_based_on_default_set.php
index 929b88367dd78..c2cf72c78be49 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/attribute_set_based_on_default_set.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/attribute_set_based_on_default_set.php
@@ -7,20 +7,19 @@
/** @var $product \Magento\Catalog\Model\Product */
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
-/** @var \Magento\Eav\Model\Entity\Attribute\Set $attributeSet */
-$attributeSet = $objectManager->create(\Magento\Eav\Model\Entity\Attribute\Set::class);
+/** @var \Magento\Eav\Model\AttributeSetManagement $attributeSetManagement */
+$attributeSetManagement = $objectManager->create(\Magento\Eav\Model\AttributeSetManagement::class);
-$entityType = $objectManager->create(\Magento\Eav\Model\Entity\Type::class)->loadByCode('catalog_product');
-$defaultSetId = $objectManager->create(\Magento\Catalog\Model\Product::class)->getDefaultAttributeSetid();
+/** @var \Magento\Eav\Api\Data\AttributeSetInterface $attributeSet */
+$attributeSet = $objectManager->create(\Magento\Eav\Model\Entity\Attribute\Set::class);
$data = [
'attribute_set_name' => 'second_attribute_set',
- 'entity_type_id' => $entityType->getId(),
'sort_order' => 200,
];
-$attributeSet->setData($data);
-$attributeSet->validate();
-$attributeSet->save();
-$attributeSet->initFromSkeleton($defaultSetId);
-$attributeSet->save();
+$attributeSet->organizeData($data);
+
+$defaultSetId = $objectManager->create(\Magento\Catalog\Model\Product::class)->getDefaultAttributeSetId();
+
+$attributeSetManagement->create(\Magento\Catalog\Model\Product::ENTITY, $attributeSet, $defaultSetId);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php
index eecdcdf038cf8..cfd07f57a4cd8 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php
@@ -71,7 +71,7 @@ abstract class AbstractProductExportImportTestCase extends \PHPUnit\Framework\Te
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->fileSystem = $this->objectManager->get(\Magento\Framework\Filesystem::class);
@@ -84,7 +84,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->executeFixtures($this->fixtures, true);
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php
index 1daa794165873..dd36f90757398 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php
@@ -69,7 +69,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
'is_decimal_divided'
];
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -95,15 +95,15 @@ public function testExport(): void
)
);
$exportData = $this->model->export();
- $this->assertContains('New Product', $exportData);
-
- $this->assertContains('Option 1 & Value 1"', $exportData);
- $this->assertContains('Option 1 & Value 2"', $exportData);
- $this->assertContains('Option 1 & Value 3"', $exportData);
- $this->assertContains('Option 4 ""!@#$%^&*', $exportData);
- $this->assertContains('test_option_code_2', $exportData);
- $this->assertContains('max_characters=10', $exportData);
- $this->assertContains('text_attribute=!@#$%^&*()_+1234567890-=|\\:;""\'<,>.?/', $exportData);
+ $this->assertStringContainsString('New Product', $exportData);
+
+ $this->assertStringContainsString('Option 1 & Value 1"', $exportData);
+ $this->assertStringContainsString('Option 1 & Value 2"', $exportData);
+ $this->assertStringContainsString('Option 1 & Value 3"', $exportData);
+ $this->assertStringContainsString('Option 4 ""!@#$%^&*', $exportData);
+ $this->assertStringContainsString('test_option_code_2', $exportData);
+ $this->assertStringContainsString('max_characters=10', $exportData);
+ $this->assertStringContainsString('text_attribute=!@#$%^&*()_+1234567890-=|\\:;""\'<,>.?/', $exportData);
$occurrencesCount = substr_count($exportData, 'Hello "" &"" Bring the water bottle when you can!');
$this->assertEquals(1, $occurrencesCount);
}
@@ -122,8 +122,8 @@ public function testExportSpecialChars(): void
)
);
$exportData = $this->model->export();
- $this->assertContains('simple ""1""', $exportData);
- $this->assertContains('Category with slash\/ symbol', $exportData);
+ $this->assertStringContainsString('simple ""1""', $exportData);
+ $this->assertStringContainsString('Category with slash\/ symbol', $exportData);
}
/**
@@ -160,20 +160,20 @@ public function testExportStockItemAttributesAreFilled(): void
\Magento\Framework\Filesystem\Directory\Write::class,
['getParentDirectory', 'isWritable', 'isFile', 'readFile', 'openFile']
);
- $directoryMock->expects($this->any())->method('getParentDirectory')->will($this->returnValue('some#path'));
- $directoryMock->expects($this->any())->method('isWritable')->will($this->returnValue(true));
- $directoryMock->expects($this->any())->method('isFile')->will($this->returnValue(true));
+ $directoryMock->expects($this->any())->method('getParentDirectory')->willReturn('some#path');
+ $directoryMock->expects($this->any())->method('isWritable')->willReturn(true);
+ $directoryMock->expects($this->any())->method('isFile')->willReturn(true);
$directoryMock->expects(
$this->any()
)->method(
'readFile'
- )->will(
- $this->returnValue('some string read from file')
+ )->willReturn(
+ 'some string read from file'
);
- $directoryMock->expects($this->once())->method('openFile')->will($this->returnValue($fileWrite));
+ $directoryMock->expects($this->once())->method('openFile')->willReturn($fileWrite);
$filesystemMock = $this->createPartialMock(\Magento\Framework\Filesystem::class, ['getDirectoryWrite']);
- $filesystemMock->expects($this->once())->method('getDirectoryWrite')->will($this->returnValue($directoryMock));
+ $filesystemMock->expects($this->once())->method('getDirectoryWrite')->willReturn($directoryMock);
$exportAdapter = new \Magento\ImportExport\Model\Export\Adapter\Csv($filesystemMock);
@@ -189,7 +189,7 @@ public function testExportStockItemAttributesAreFilled(): void
public function verifyHeaderColumns(array $headerColumns): void
{
foreach (self::$stockItemAttributes as $stockItemAttribute) {
- $this->assertContains(
+ $this->assertStringContainsString(
$stockItemAttribute,
$headerColumns,
"Stock item attribute {$stockItemAttribute} is absent among header columns"
@@ -237,11 +237,11 @@ public function testExceptionInGetExportData(): void
\Magento\Framework\Filesystem\Directory\Write::class,
['getParentDirectory', 'isWritable']
);
- $directoryMock->expects($this->any())->method('getParentDirectory')->will($this->returnValue('some#path'));
- $directoryMock->expects($this->any())->method('isWritable')->will($this->returnValue(true));
+ $directoryMock->expects($this->any())->method('getParentDirectory')->willReturn('some#path');
+ $directoryMock->expects($this->any())->method('isWritable')->willReturn(true);
$filesystemMock = $this->createPartialMock(\Magento\Framework\Filesystem::class, ['getDirectoryWrite']);
- $filesystemMock->expects($this->once())->method('getDirectoryWrite')->will($this->returnValue($directoryMock));
+ $filesystemMock->expects($this->once())->method('getDirectoryWrite')->willReturn($directoryMock);
$exportAdapter = new \Magento\ImportExport\Model\Export\Adapter\Csv($filesystemMock);
@@ -288,10 +288,10 @@ public function testExportWithFieldsEnclosure(): void
);
$exportData = $this->model->export();
- $this->assertContains('""Option 2""', $exportData);
- $this->assertContains('""Option 3""', $exportData);
- $this->assertContains('""Option 4 """"!@#$%^&*""', $exportData);
- $this->assertContains('text_attribute=""!@#$%^&*()_+1234567890-=|\:;""""\'<,>.?/', $exportData);
+ $this->assertStringContainsString('""Option 2""', $exportData);
+ $this->assertStringContainsString('""Option 3""', $exportData);
+ $this->assertStringContainsString('""Option 4 """"!@#$%^&*""', $exportData);
+ $this->assertStringContainsString('text_attribute=""!@#$%^&*()_+1234567890-=|\:;""""\'<,>.?/', $exportData);
}
/**
@@ -319,10 +319,10 @@ public function testCategoryIdsFilter(): void
$exportData = $this->model->export();
- $this->assertContains('Simple Product', $exportData);
- $this->assertContains('Simple Product Three', $exportData);
- $this->assertNotContains('Simple Product Two', $exportData);
- $this->assertNotContains('Simple Product Not Visible On Storefront', $exportData);
+ $this->assertStringContainsString('Simple Product', $exportData);
+ $this->assertStringContainsString('Simple Product Three', $exportData);
+ $this->assertStringNotContainsString('Simple Product Two', $exportData);
+ $this->assertStringNotContainsString('Simple Product Not Visible On Storefront', $exportData);
}
/**
@@ -588,10 +588,10 @@ public function testFilterByQuantityAndStockStatus(
): void {
$exportData = $this->doExport(['quantity_and_stock_status' => $value]);
foreach ($productsIncluded as $productName) {
- $this->assertContains($productName, $exportData);
+ $this->assertStringContainsString($productName, $exportData);
}
foreach ($productsNotIncluded as $productName) {
- $this->assertNotContains($productName, $exportData);
+ $this->assertStringNotContainsString($productName, $exportData);
}
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractTest.php
index bc10fd00911fb..3d83fb0671277 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractTest.php
@@ -24,7 +24,7 @@ class AbstractTest extends \PHPUnit\Framework\TestCase
* On product import abstract class methods level it doesn't matter what product type is using.
* That is why current tests are using simple product entity type by default
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$params = [$this->objectManager->create(\Magento\CatalogImportExport\Model\Import\Product::class), 'simple'];
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php
index a9b1fe6d936ba..4d08d71793cbb 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php
@@ -68,7 +68,7 @@ class ProductTest extends \Magento\TestFramework\Indexer\TestCase
protected $_uploaderFactory;
/**
- * @var \Magento\CatalogInventory\Model\Spi\StockStateProviderInterface|\PHPUnit_Framework_MockObject_MockObject
+ * @var \Magento\CatalogInventory\Model\Spi\StockStateProviderInterface|\PHPUnit\Framework\MockObject\MockObject
*/
protected $_stockStateProvider;
@@ -78,7 +78,7 @@ class ProductTest extends \Magento\TestFramework\Indexer\TestCase
protected $objectManager;
/**
- * @var LoggerInterface|\PHPUnit_Framework_MockObject_MockObject
+ * @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject
*/
private $logger;
@@ -95,12 +95,12 @@ class ProductTest extends \Magento\TestFramework\Indexer\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->logger = $this->getMockBuilder(LoggerInterface::class)
->disableOriginalConstructor()
- ->getMock();
+ ->getMockForAbstractClass();
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\CatalogImportExport\Model\Import\Product::class,
['logger' => $this->logger]
@@ -112,7 +112,7 @@ protected function setUp()
parent::setUp();
}
- protected function tearDown()
+ protected function tearDown(): void
{
/* We rollback here the products created during the Import because they were
created during test execution and we do not have the rollback for them */
@@ -366,7 +366,7 @@ public function testSaveCustomOptions(string $importFile, string $sku, int $expe
$actualOptions = $actualData['options'];
sort($expectedOptions);
sort($actualOptions);
- $this->assertEquals($expectedOptions, $actualOptions);
+ $this->assertSame($expectedOptions, $actualOptions);
// assert of options data
$this->assertCount(count($expectedData['data']), $actualData['data']);
@@ -937,9 +937,9 @@ public function testSaveImagesNoSelection()
$product = $this->getProductBySku('simple_new');
$this->assertEquals('/m/a/magento_image.jpg', $product->getData('image'));
- $this->assertEquals(null, $product->getData('small_image'));
- $this->assertEquals(null, $product->getData('thumbnail'));
- $this->assertEquals(null, $product->getData('swatch_image'));
+ $this->assertNull($product->getData('small_image'));
+ $this->assertNull($product->getData('thumbnail'));
+ $this->assertNull($product->getData('swatch_image'));
}
/**
@@ -1397,7 +1397,7 @@ public function testProductCategories($fixture, $separator)
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$resource = $objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class);
$productId = $resource->getIdBySku('simple1');
- $this->assertTrue(is_numeric($productId));
+ $this->assertIsNumeric($productId);
/** @var \Magento\Catalog\Model\Product $product */
$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Product::class
@@ -1524,8 +1524,8 @@ public function testProductDuplicateCategories()
$this->assertTrue($errorCount === 1, 'Error expected');
$errorMessage = $errorProcessor->getAllErrors()[0]->getErrorMessage();
- $this->assertContains('URL key for specified store already exists', $errorMessage);
- $this->assertContains('Default Category/Category 2', $errorMessage);
+ $this->assertStringContainsString('URL key for specified store already exists', $errorMessage);
+ $this->assertStringContainsString('Default Category/Category 2', $errorMessage);
$categoryAfter = $this->loadCategoryByName('Category 2');
$this->assertTrue($categoryAfter === null);
@@ -2595,9 +2595,9 @@ public function testImportWithDifferentSkuCase()
$this->_model->importData();
- $this->assertEquals(
+ $this->assertCount(
3,
- count($productRepository->getList($searchCriteria)->getItems())
+ $productRepository->getList($searchCriteria)->getItems()
);
foreach ($importedPrices as $sku => $expectedPrice) {
$this->assertEquals($expectedPrice, $productRepository->get($sku)->getPrice());
@@ -2621,9 +2621,9 @@ public function testImportWithDifferentSkuCase()
$this->_model->importData();
- $this->assertEquals(
+ $this->assertCount(
3,
- count($productRepository->getList($searchCriteria)->getItems()),
+ $productRepository->getList($searchCriteria)->getItems(),
'Ensures that new products were not created'
);
foreach ($updatedPrices as $sku => $expectedPrice) {
@@ -3119,12 +3119,12 @@ public function testCheckDoubleImportOfProducts()
/** @var SearchCriteria $searchCriteria */
$searchCriteria = $this->searchCriteriaBuilder->create();
- $this->assertEquals(true, $this->importFile('products_with_two_store_views.csv', 2));
+ $this->assertTrue($this->importFile('products_with_two_store_views.csv', 2));
$productsAfterFirstImport = $this->productRepository->getList($searchCriteria)->getItems();
- $this->assertEquals(3, count($productsAfterFirstImport));
+ $this->assertCount(3, $productsAfterFirstImport);
- $this->assertEquals(true, $this->importFile('products_with_two_store_views.csv', 2));
+ $this->assertTrue($this->importFile('products_with_two_store_views.csv', 2));
$productsAfterSecondImport = $this->productRepository->getList($searchCriteria)->getItems();
- $this->assertEquals(3, count($productsAfterSecondImport));
+ $this->assertCount(3, $productsAfterSecondImport);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/UploaderTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/UploaderTest.php
index d1d87b6916eb6..c9136fec609ec 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/UploaderTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/UploaderTest.php
@@ -42,7 +42,7 @@ class UploaderTest extends \Magento\TestFramework\Indexer\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->fileReader = $this->getMockForAbstractClass(\Magento\Framework\Filesystem\File\ReadInterface::class);
@@ -114,10 +114,11 @@ public function testMoveWithValidFile(): void
*
* @magentoAppIsolation enabled
* @return void
- * @expectedException \Magento\Framework\Exception\LocalizedException
*/
public function testMoveWithFileOutsideTemp(): void
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
$tmpDir = $this->uploader->getTmpDir();
$newTmpDir = $tmpDir . '/test1';
if (!$this->directory->create($newTmpDir)) {
@@ -136,11 +137,12 @@ public function testMoveWithFileOutsideTemp(): void
/**
* @magentoAppIsolation enabled
* @return void
- * @expectedException \Exception
- * @expectedExceptionMessage Disallowed file type
*/
public function testMoveWithInvalidFile(): void
{
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Disallowed file type');
+
$fileName = 'media_import_image.php';
$filePath = $this->directory->getAbsolutePath($this->uploader->getTmpDir() . '/' . $fileName);
//phpcs:ignore
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options.csv
index ac701022a0815..c67ca3301a813 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options.csv
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options.csv
@@ -1,2 +1,2 @@
sku,website_code,store_view_code,attribute_set_code,product_type,name,description,short_description,weight,product_online,visibility,product_websites,categories,price,special_price,special_price_from_date,special_price_to_date,tax_class_name,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,additional_images,additional_image_labels,configurable_variation_labels,configurable_variations,bundle_price_type,bundle_sku_type,bundle_weight_type,bundle_values,downloadble_samples,downloadble_links,associated_skus,related_skus,crosssell_skus,upsell_skus,custom_options,additional_attributes,manage_stock,is_in_stock,qty,out_of_stock_qty,is_qty_decimal,allow_backorders,min_cart_qty,max_cart_qty,notify_on_stock_below,qty_increments,enable_qty_increments,is_decimal_divided,new_from_date,new_to_date,gift_message_available,created_at,updated_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_price,msrp_display_actual_price_type,map_enabled
-simple,base,,Default,simple,New Product,,,9,1,"Catalog, Search",base,,10,,,,Taxable Goods,new-product,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title,type=field,required=1,sku=1-text,price=0,price_type=fixed,max_characters=10|name=Test Date and Time Title,type=date_time,required=1,price=2,sku=2-date|name=Test Select,type=drop_down,required=1,price=3,option_title=Option 1,sku=3-1-select|name=Test Select,type=drop_down,required=1,price=3,option_title=Option 2,sku=3-2-select|name=Test Radio,type=radio,required=1,price=3,option_title=Option 1,sku=4-1-radio|name=Test Radio,type=radio,required=1,price=3,option_title=Option 2,sku=4-2-radio",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
+simple,base,,Default,simple,New Product,,,9,1,"Catalog, Search",base,,10,,,,Taxable Goods,new-product,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title,type=field,required=1,sku=1-text,price=0.000000,price_type=fixed,max_characters=10|name=Test Date and Time Title,type=date_time,required=1,price=2.000000,sku=2-date|name=Test Select,type=drop_down,required=1,price=3.000000,option_title=Option 1,sku=3-1-select|name=Test Select,type=drop_down,required=1,price=3.000000,option_title=Option 2,sku=3-2-select|name=Test Radio,type=radio,required=1,price=3.000000,option_title=Option 1,sku=4-1-radio|name=Test Radio,type=radio,required=1,price=3.000000,option_title=Option 2,sku=4-2-radio",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_and_multiple_store_views.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_and_multiple_store_views.csv
index 17858531993db..0d4c53ca5812d 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_and_multiple_store_views.csv
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_and_multiple_store_views.csv
@@ -1,7 +1,7 @@
sku,website_code,store_view_code,attribute_set_code,product_type,name,description,short_description,weight,product_online,visibility,product_websites,categories,price,special_price,special_price_from_date,special_price_to_date,tax_class_name,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,additional_images,additional_image_labels,configurable_variation_labels,configurable_variations,bundle_price_type,bundle_sku_type,bundle_weight_type,bundle_values,downloadble_samples,downloadble_links,associated_skus,related_skus,crosssell_skus,upsell_skus,custom_options,additional_attributes,manage_stock,is_in_stock,qty,out_of_stock_qty,is_qty_decimal,allow_backorders,min_cart_qty,max_cart_qty,notify_on_stock_below,qty_increments,enable_qty_increments,is_decimal_divided,new_from_date,new_to_date,gift_message_available,created_at,updated_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_price,msrp_display_actual_price_type,map_enabled
-simple,base,,Default,simple,New Product,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title,type=field,required=1,sku=1-text,price=100|name=Test Date and Time Title,type=date_time,required=1,sku=2-date,price=200|name=Test Select,type=drop_down,required=1,sku=3-1-select,price=310,option_title=Select Option 1|name=Test Select,type=drop_down,required=1,sku=3-2-select,price=320,option_title=Select Option 2|name=Test Checkbox,type=checkbox,required=1,sku=4-1-select,price=410,option_title=Checkbox Option 1|name=Test Checkbox,type=checkbox,required=1,sku=4-2-select,price=420,option_title=Checkbox Option 2|name=Test Radio,type=radio,required=1,sku=5-1-radio,price=510,option_title=Radio Option 1|name=Test Radio,type=radio,required=1,sku=5-2-radio,price=520,option_title=Radio Option 2",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
+simple,base,,Default,simple,New Product,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title,type=field,required=1,sku=1-text,price=100.000000|name=Test Date and Time Title,type=date_time,required=1,sku=2-date,price=200.000000|name=Test Select,type=drop_down,required=1,sku=3-1-select,price=310.000000,option_title=Select Option 1|name=Test Select,type=drop_down,required=1,sku=3-2-select,price=320.000000,option_title=Select Option 2|name=Test Checkbox,type=checkbox,required=1,sku=4-1-select,price=410.000000,option_title=Checkbox Option 1|name=Test Checkbox,type=checkbox,required=1,sku=4-2-select,price=420.000000,option_title=Checkbox Option 2|name=Test Radio,type=radio,required=1,sku=5-1-radio,price=510.000000,option_title=Radio Option 1|name=Test Radio,type=radio,required=1,sku=5-2-radio,price=520.000000,option_title=Radio Option 2",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
simple,,default,Default,simple,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title_default,type=field,sku=1-text|name=Test Date and Time Title_default,type=date_time,sku=2-date|name=Test Select_default,type=drop_down,sku=3-1-select,option_title=Select Option 1_default|name=Test Select_default,type=drop_down,sku=3-2-select,option_title=Select Option 2_default|name=Test Checkbox_default,type=checkbox,sku=4-1-select,option_title=Checkbox Option 1_default|name=Test Checkbox_default,type=checkbox,sku=4-2-select,option_title=Checkbox Option 2_default|name=Test Radio_default,type=radio,sku=5-1-radio,option_title=Radio Option 1_default|name=Test Radio_default,type=radio,sku=5-2-radio,option_title=Radio Option 2_default",,,,,,,,,,,,,,,,,,,,,,,,,,,
-simple,,secondstore,Default,simple,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title_fixture_second_store,type=field,sku=1-text,price=101|name=Test Date and Time Title_fixture_second_store,type=date_time,sku=2-date,price=201|name=Test Select_fixture_second_store,type=drop_down,sku=3-1-select,price=311,option_title=Select Option 1_fixture_second_store|name=Test Select_fixture_second_store,type=drop_down,sku=3-2-select,price=321,option_title=Select Option 2_fixture_second_store|name=Test Checkbox_second_store,type=checkbox,sku=4-1-select,price=411,option_title=Checkbox Option 1_second_store|name=Test Checkbox_second_store,type=checkbox,sku=4-2-select,price=421,option_title=Checkbox Option 2_second_store|name=Test Radio_fixture_second_store,type=radio,sku=5-1-radio,price=511,option_title=Radio Option 1_fixture_second_store|name=Test Radio_fixture_second_store,type=radio,sku=5-2-radio,price=521,option_title=Radio Option 2_fixture_second_store",,,,,,,,,,,,,,,,,,,,,,,,,,,
+simple,,secondstore,Default,simple,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Field Title_fixture_second_store,type=field,sku=1-text,price=101.000000|name=Test Date and Time Title_fixture_second_store,type=date_time,sku=2-date,price=201.000000|name=Test Select_fixture_second_store,type=drop_down,sku=3-1-select,price=311.000000,option_title=Select Option 1_fixture_second_store|name=Test Select_fixture_second_store,type=drop_down,sku=3-2-select,price=321.000000,option_title=Select Option 2_fixture_second_store|name=Test Checkbox_second_store,type=checkbox,sku=4-1-select,price=411.000000,option_title=Checkbox Option 1_second_store|name=Test Checkbox_second_store,type=checkbox,sku=4-2-select,price=421.000000,option_title=Checkbox Option 2_second_store|name=Test Radio_fixture_second_store,type=radio,sku=5-1-radio,price=511.000000,option_title=Radio Option 1_fixture_second_store|name=Test Radio_fixture_second_store,type=radio,sku=5-2-radio,price=521.000000,option_title=Radio Option 2_fixture_second_store",,,,,,,,,,,,,,,,,,,,,,,,,,,
newprod2,base,secondstore,Default,configurable,New Product 2,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product-2,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
newprod3,base,,Default,configurable,New Product 3,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product-3,,,,,,,,,,,,,,,,,,,,,,,,"name=Line 1,type=field,max_characters=30,required=1,option_title=Line 1|name=Line 2,type=field,max_characters=30,required=0,option_title=Line 2",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
newprod4,base,secondstore,Default,configurable,New Product 4,,,9,1,"Catalog, Search","base,secondwebsite",,10,,,,Taxable Goods,new-product-4,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,,
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_new.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_new.csv
index f276a96cd1d38..557084334dc64 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_new.csv
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_new.csv
@@ -1,2 +1,2 @@
sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,crosssell_skus,upsell_skus,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,associated_skus
-simple_new,,Default,simple,,base,"New Product",,,,1,"Taxable Goods","Catalog, Search",10.0000,,,,new-product,"New Product","New Product","New Product ",,,,,,,"2015-10-20 07:05:38","2015-10-20 07:05:38",,,"Block after Info Column",,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,0,1,1.0000,0,0,0,1,,,,,,,"name=New Radio,type=radio,required=1,price=3.0000,price_type=fixed,sku=4-1-radio,option_title=Option 1|name=New Radio,type=radio,required=1,price=3.0000,price_type=fixed,sku=4-2-radio,option_title=Option 2|name=New Select,type=drop_down,required=1,price=3.0000,price_type=fixed,sku=3-1-select,option_title=Option 1|name=New Select,type=drop_down,required=1,price=3.0000,price_type=fixed,sku=3-2-select,option_title=Option2|name=Test Date and Time Title,type=date_time,required=1,price=2.0000,price_type=fixed,sku=2-date|name=Test Field Title,type=field,required=1,price=0.0000,price_type=fixed,sku=1-text,max_characters=10|name=New Select With Zero Price,type=drop_down,required=1,price=0,price_type=fixed,sku=3-1-select,option_title=Option 1",,,,,,
+simple_new,,Default,simple,,base,"New Product",,,,1,"Taxable Goods","Catalog, Search",10.0000,,,,new-product,"New Product","New Product","New Product ",,,,,,,"2015-10-20 07:05:38","2015-10-20 07:05:38",,,"Block after Info Column",,,,,,,,,,,,,"has_options=1,quantity_and_stock_status=In Stock,required_options=1",100.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,0,1,1.0000,0,0,0,1,,,,,,,"name=New Radio,type=radio,required=1,price=3.000000,price_type=fixed,sku=4-1-radio,option_title=Option 1|name=New Radio,type=radio,required=1,price=3.000000,price_type=fixed,sku=4-2-radio,option_title=Option 2|name=New Select,type=drop_down,required=1,price=3.000000,price_type=fixed,sku=3-1-select,option_title=Option 1|name=New Select,type=drop_down,required=1,price=3.000000,price_type=fixed,sku=3-2-select,option_title=Option2|name=Test Date and Time Title,type=date_time,required=1,price=2.000000,price_type=fixed,sku=2-date|name=Test Field Title,type=field,required=1,price=0.000000,price_type=fixed,sku=1-text,max_characters=10|name=New Select With Zero Price,type=drop_down,required=1,price=0.000000,price_type=fixed,sku=3-1-select,option_title=Option 1",,,,,,
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/ProductTest.php
index c39acbc338727..e325968f73906 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/ProductTest.php
@@ -152,17 +152,17 @@ protected function assertEqualsSpecificAttributes(
if (!empty($actualProduct->getImage())
&& !empty($expectedProduct->getImage())
) {
- $this->assertContains('magento_image', $actualProduct->getImage());
+ $this->assertStringContainsString('magento_image', $actualProduct->getImage());
}
if (!empty($actualProduct->getSmallImage())
&& !empty($expectedProduct->getSmallImage())
) {
- $this->assertContains('magento_image', $actualProduct->getSmallImage());
+ $this->assertStringContainsString('magento_image', $actualProduct->getSmallImage());
}
if (!empty($actualProduct->getThumbnail())
&& !empty($expectedProduct->getThumbnail())
) {
- $this->assertContains('magento_image', $actualProduct->getThumbnail());
+ $this->assertStringContainsString('magento_image', $actualProduct->getThumbnail());
}
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php
index b7be72e9ff827..6724437ccfccf 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php
@@ -13,7 +13,7 @@ class CustomergroupTest extends \PHPUnit\Framework\TestCase
*/
protected $_block;
- protected function setUp()
+ protected function setUp(): void
{
$this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\CatalogInventory\Block\Adminhtml\Form\Field\Customergroup::class
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/FullTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/FullTest.php
index 6bf1f5fbf0be2..49d137aee8228 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/FullTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/FullTest.php
@@ -15,7 +15,7 @@ class FullTest extends \PHPUnit\Framework\TestCase
*/
protected $_processor;
- protected function setUp()
+ protected function setUp(): void
{
$this->_processor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\CatalogInventory\Model\Indexer\Stock\Processor::class
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/RowTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/RowTest.php
index 6b120f7bff6b4..d6529c26975f7 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/RowTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/RowTest.php
@@ -15,7 +15,7 @@ class RowTest extends \PHPUnit\Framework\TestCase
*/
protected $_processor;
- protected function setUp()
+ protected function setUp(): void
{
$this->_processor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\CatalogInventory\Model\Indexer\Stock\Processor::class
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/RowsTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/RowsTest.php
index a4d3e84b855ff..6d81810fd6803 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/RowsTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/RowsTest.php
@@ -15,7 +15,7 @@ class RowsTest extends \PHPUnit\Framework\TestCase
*/
protected $_processor;
- protected function setUp()
+ protected function setUp(): void
{
$this->_processor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\CatalogInventory\Model\Indexer\Stock\Processor::class
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Plugin/ProductSearchTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Plugin/ProductSearchTest.php
index b947895021d29..d3524da5f7fe7 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Plugin/ProductSearchTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Plugin/ProductSearchTest.php
@@ -41,7 +41,7 @@ public function testExecute() : void
->setPostValue('limit', 50);
$this->dispatch('backend/catalog/product/search');
$responseBody = $this->getResponse()->getBody();
- $this->assertContains(
+ $this->assertStringContainsString(
'"options":{"1":{"value":"1","label":"Simple Product","is_active":1,"path":"simple","optgroup":false}',
$responseBody
);
@@ -64,7 +64,7 @@ public function testExecuteNotShowOutOfStock() : void
->setPostValue('limit', 50);
$this->dispatch('backend/catalog/product/search');
$responseBody = $this->getResponse()->getBody();
- $this->assertNotContains(
+ $this->assertStringNotContainsString(
'"options":{"1":{"value":"1","label":"Simple Product","is_active":1,"path":"simple","optgroup":false}',
$responseBody
);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php
index 6105aba9201e2..3e7ea8f1bfd86 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php
@@ -37,12 +37,12 @@ class QuantityValidatorTest extends \PHPUnit\Framework\TestCase
private $quantityValidator;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
private $observerMock;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
private $eventMock;
@@ -52,12 +52,12 @@ class QuantityValidatorTest extends \PHPUnit\Framework\TestCase
private $objectManager;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
private $optionInitializer;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
+ * @var \PHPUnit\Framework\MockObject\MockObject
*/
private $stockState;
@@ -69,7 +69,7 @@ class QuantityValidatorTest extends \PHPUnit\Framework\TestCase
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
/** @var \Magento\Framework\ObjectManagerInterface objectManager */
$this->objectManager = Bootstrap::getObjectManager();
@@ -151,7 +151,7 @@ public function testQuoteWithOptionsWithErrors()
*
*
* @param \Magento\Quote\Model\Quote\Item $quoteItem
- * @param \PHPUnit_Framework_MockObject_MockObject $resultMock
+ * @param \PHPUnit\Framework\MockObject\MockObject $resultMock
*/
private function setMockStockStateResultToQuoteItemOptions($quoteItem, $resultMock)
{
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStockTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStockTest.php
index 5d790b6cfd008..d96ab43d32d80 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStockTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStockTest.php
@@ -22,7 +22,7 @@ class DefaultStockTest extends \PHPUnit\Framework\TestCase
*/
private $stockConfiguration;
- protected function setUp()
+ protected function setUp(): void
{
$this->indexer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\DefaultStock::class
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Stock/ItemTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Stock/ItemTest.php
index 7a5d6a808eeb2..3df4c6bf3d69a 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Stock/ItemTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Stock/ItemTest.php
@@ -12,7 +12,7 @@ class ItemTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\CatalogInventory\Model\Stock\Item::class
@@ -55,7 +55,7 @@ public function testSaveWithNullQty()
$savedStockItem->setQty(null);
$savedStockItem->save();
- $this->assertEquals(null, $savedStockItem->load($savedStockItemId)->getQty());
+ $this->assertNull($savedStockItem->load($savedStockItemId)->getQty());
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/ByStockItemRepositoryTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/ByStockItemRepositoryTest.php
index d2c964db90e6b..94a5bf3041599 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/ByStockItemRepositoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/ByStockItemRepositoryTest.php
@@ -43,7 +43,7 @@ class ByStockItemRepositoryTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productRepository = $objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByQuantityAndStockStatusTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByQuantityAndStockStatusTest.php
index bdf3f1d793e25..57a32471a0caf 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByQuantityAndStockStatusTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByQuantityAndStockStatusTest.php
@@ -56,7 +56,7 @@ class ByQuantityAndStockStatusTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productFactory = $objectManager->get(ProductInterfaceFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByStockDataTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByStockDataTest.php
index a9186f3583ac4..7e57fc3f0d9d9 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByStockDataTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByStockDataTest.php
@@ -56,7 +56,7 @@ class ByStockDataTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productFactory = $objectManager->get(ProductInterfaceFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByStockItemTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByStockItemTest.php
index 1209c16971056..8b8aad3136e3b 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByStockItemTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductModel/ByStockItemTest.php
@@ -62,7 +62,7 @@ class ByStockItemTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productFactory = $objectManager->get(ProductInterfaceFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByQuantityAndStockStatusTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByQuantityAndStockStatusTest.php
index 59f3526b7677b..a0498f954c0ed 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByQuantityAndStockStatusTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByQuantityAndStockStatusTest.php
@@ -62,7 +62,7 @@ class ByQuantityAndStockStatusTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productFactory = $objectManager->get(ProductInterfaceFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByStockDataTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByStockDataTest.php
index b8202e413cae3..7ce4c97a929d8 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByStockDataTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByStockDataTest.php
@@ -62,7 +62,7 @@ class ByStockDataTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productFactory = $objectManager->get(ProductInterfaceFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByStockItemTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByStockItemTest.php
index 3d227a8622c29..76ff60f2b9f23 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByStockItemTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductCreate/ByProductRepository/ByStockItemTest.php
@@ -73,7 +73,7 @@ class ByStockItemTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productFactory = $objectManager->get(ProductInterfaceFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByQuantityAndStockStatusTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByQuantityAndStockStatusTest.php
index 3fb3fc17a7416..b17ad85e5090b 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByQuantityAndStockStatusTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByQuantityAndStockStatusTest.php
@@ -32,7 +32,7 @@ class ByQuantityAndStockStatusTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productRepository = $objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByStockDataTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByStockDataTest.php
index 9373805e2c415..d8b813d76eec8 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByStockDataTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByStockDataTest.php
@@ -32,7 +32,7 @@ class ByStockDataTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productRepository = $objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByStockItemTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByStockItemTest.php
index 922d47ec15242..be40a8c922f70 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByStockItemTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductModel/ByStockItemTest.php
@@ -45,7 +45,7 @@ class ByStockItemTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productRepository = $objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByQuantityAndStockStatusTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByQuantityAndStockStatusTest.php
index d4954370bbb7f..dbc699384473b 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByQuantityAndStockStatusTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByQuantityAndStockStatusTest.php
@@ -32,7 +32,7 @@ class ByQuantityAndStockStatusTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productRepository = $objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByStockDataTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByStockDataTest.php
index e35d3afeea7dd..e174cb33733ae 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByStockDataTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByStockDataTest.php
@@ -32,7 +32,7 @@ class ByStockDataTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->productRepository = $objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByStockItemTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByStockItemTest.php
index fcd41efaae9b0..7593d0e8b46df 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByStockItemTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/StockItemSave/OnProductUpdate/ByProductRepository/ByStockItemTest.php
@@ -51,7 +51,7 @@ class ByStockItemTest extends \PHPUnit\Framework\TestCase
StockItemInterface::IS_IN_STOCK => false,
];
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->stockItemFactory = $objectManager->get(StockItemInterfaceFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/System/Config/Backend/MinsaleqtyTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/System/Config/Backend/MinsaleqtyTest.php
index 008ec882668e4..a34da25fb187e 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/System/Config/Backend/MinsaleqtyTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/System/Config/Backend/MinsaleqtyTest.php
@@ -14,7 +14,7 @@ class MinsaleqtyTest extends \PHPUnit\Framework\TestCase
/** @var Minsaleqty */
private $minSaleQtyConfig;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->minSaleQtyConfig = $objectManager->create(Minsaleqty::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Observer/SaveInventoryDataObserverTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Observer/SaveInventoryDataObserverTest.php
index a50a7b096fe13..996b3068218c7 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Observer/SaveInventoryDataObserverTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Observer/SaveInventoryDataObserverTest.php
@@ -38,7 +38,7 @@ class SaveInventoryDataObserverTest extends TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->productRepository = Bootstrap::getObjectManager()
->get(ProductRepositoryInterface::class);
@@ -81,6 +81,6 @@ public function testAutoChangingIsInStockForParent()
$parentProductStockItem = $this->stockItemRepository->get(
$parentProduct->getExtensionAttributes()->getStockItem()->getItemId()
);
- $this->assertSame(false, $parentProductStockItem->getIsInStock());
+ $this->assertFalse($parentProductStockItem->getIsInStock());
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/BatchIndexTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/BatchIndexTest.php
index 11556dcfb7e7b..328f59a311781 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/BatchIndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/BatchIndexTest.php
@@ -31,14 +31,14 @@ class BatchIndexTest extends \PHPUnit\Framework\TestCase
*/
protected $resourceRule;
- protected function setUp()
+ protected function setUp(): void
{
$this->resourceRule = Bootstrap::getObjectManager()->get(\Magento\CatalogRule\Model\ResourceModel\Rule::class);
$this->product = Bootstrap::getObjectManager()->get(\Magento\Catalog\Model\Product::class);
$this->productRepository = Bootstrap::getObjectManager()->get(\Magento\Catalog\Model\ProductRepository::class);
}
- protected function tearDown()
+ protected function tearDown(): void
{
/** @var \Magento\Framework\Registry $registry */
$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php
index 13f6e5ae0e8ed..313ceca053591 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php
@@ -34,7 +34,7 @@ class IndexerBuilderTest extends \PHPUnit\Framework\TestCase
*/
protected $productThird;
- protected function setUp()
+ protected function setUp(): void
{
$this->indexerBuilder = Bootstrap::getObjectManager()->get(
\Magento\CatalogRule\Model\Indexer\IndexBuilder::class
@@ -43,7 +43,7 @@ protected function setUp()
$this->product = Bootstrap::getObjectManager()->get(\Magento\Catalog\Model\Product::class);
}
- protected function tearDown()
+ protected function tearDown(): void
{
/** @var \Magento\Framework\Registry $registry */
$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php
index 71ea03b1d362b..2b18b1569aaeb 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/Product/PriceTest.php
@@ -44,7 +44,7 @@ class PriceTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->resourceRule = $this->objectManager->get(Rule::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/ProductRuleTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/ProductRuleTest.php
index 911c7aa30641e..f6697d2501aaf 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/ProductRuleTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/ProductRuleTest.php
@@ -19,7 +19,7 @@ class ProductRuleTest extends \PHPUnit\Framework\TestCase
*/
protected $resourceRule;
- protected function setUp()
+ protected function setUp(): void
{
$this->resourceRule = Bootstrap::getObjectManager()->get(\Magento\CatalogRule\Model\ResourceModel\Rule::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/RuleProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/RuleProductTest.php
index a4a99918fe052..68d951ce62552 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/RuleProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/RuleProductTest.php
@@ -23,7 +23,7 @@ class RuleProductTest extends \PHPUnit\Framework\TestCase
*/
protected $resourceRule;
- protected function setUp()
+ protected function setUp(): void
{
$this->indexBuilder = Bootstrap::getObjectManager()->get(
\Magento\CatalogRule\Model\Indexer\IndexBuilder::class
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/ResourceModel/Product/ConditionsToCollectionApplierTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/ResourceModel/Product/ConditionsToCollectionApplierTest.php
index 78fa255897dbc..1b2485e20fc9d 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/ResourceModel/Product/ConditionsToCollectionApplierTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/ResourceModel/Product/ConditionsToCollectionApplierTest.php
@@ -28,7 +28,7 @@ class ConditionsToCollectionApplierTest extends \PHPUnit\Framework\TestCase
private $setFactory;
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
@@ -83,13 +83,14 @@ function (Product $product) {
}
/**
- * @expectedException \Magento\Framework\Exception\InputException
- * @expectedExceptionMessage Undefined rule operator "====" passed in. Valid operators are: ==,!=,>=,<=,>,<,{},!{},(),!()
*
* @magentoDbIsolation disabled
*/
public function testExceptionUndefinedRuleOperator()
{
+ $this->expectException(\Magento\Framework\Exception\InputException::class);
+ $this->expectExceptionMessage('Undefined rule operator "====" passed in. Valid operators are: ==,!=,>=,<=,>,<,{},!{},(),!()');
+
$conditions = [
'type' => \Magento\CatalogRule\Model\Rule\Condition\Combine::class,
'aggregator' => 'all',
@@ -112,13 +113,14 @@ public function testExceptionUndefinedRuleOperator()
}
/**
- * @expectedException \Magento\Framework\Exception\InputException
- * @expectedExceptionMessage Undefined rule aggregator "olo-lo" passed in. Valid operators are: all,any
*
* @magentoDbIsolation disabled
*/
public function testExceptionUndefinedRuleAggregator()
{
+ $this->expectException(\Magento\Framework\Exception\InputException::class);
+ $this->expectExceptionMessage('Undefined rule aggregator "olo-lo" passed in. Valid operators are: all,any');
+
$conditions = [
'type' => \Magento\CatalogRule\Model\Rule\Condition\Combine::class,
'aggregator' => 'olo-lo',
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/ResourceModel/Rule/CollectionTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/ResourceModel/Rule/CollectionTest.php
index c42b13ac01125..10d22240bc573 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/ResourceModel/Rule/CollectionTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/ResourceModel/Rule/CollectionTest.php
@@ -37,7 +37,7 @@ class CollectionTest extends \PHPUnit\Framework\TestCase
*/
protected $resourceRuleCollection;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->indexBuilder = $this->objectManager->get(IndexBuilder::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/RuleTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/RuleTest.php
index 6d5b87fd0949f..b1bcde183c091 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/RuleTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/RuleTest.php
@@ -16,19 +16,19 @@ class RuleTest extends \PHPUnit\Framework\TestCase
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp()
+ protected function setUp(): void
{
$resourceMock = $this->createPartialMock(
\Magento\CatalogRule\Model\ResourceModel\Rule::class,
['getIdFieldName', 'getRulesFromProduct']
);
- $resourceMock->expects($this->any())->method('getIdFieldName')->will($this->returnValue('id'));
+ $resourceMock->expects($this->any())->method('getIdFieldName')->willReturn('id');
$resourceMock->expects(
$this->any()
)->method(
'getRulesFromProduct'
- )->will(
- $this->returnValue($this->_getCatalogRulesFixtures())
+ )->willReturn(
+ $this->_getCatalogRulesFixtures()
);
$this->_object = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
diff --git a/dev/tests/integration/testsuite/Magento/CatalogRuleConfigurable/Model/Product/Type/Configurable/PriceTest.php b/dev/tests/integration/testsuite/Magento/CatalogRuleConfigurable/Model/Product/Type/Configurable/PriceTest.php
index 1d8264522a2c4..92b8823128b65 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogRuleConfigurable/Model/Product/Type/Configurable/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogRuleConfigurable/Model/Product/Type/Configurable/PriceTest.php
@@ -54,7 +54,7 @@ class PriceTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->priceModel = $this->objectManager->create(Price::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/Advanced/ResultTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/Advanced/ResultTest.php
index 57f26de8bd670..2636640d76485 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/Advanced/ResultTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/Advanced/ResultTest.php
@@ -17,7 +17,7 @@ class ResultTest extends \PHPUnit\Framework\TestCase
*/
protected $_block;
- protected function setUp()
+ protected function setUp(): void
{
$this->_layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Framework\View\LayoutInterface::class
@@ -39,7 +39,7 @@ public function testSetListOrders()
$category = $this->createPartialMock(\Magento\Catalog\Model\Category::class, ['getAvailableSortByOptions']);
$category->expects($this->atLeastOnce())
->method('getAvailableSortByOptions')
- ->will($this->returnValue($sortOptions));
+ ->willReturn($sortOptions);
$category->setId(100500); // Any id - just for layer navigation
/** @var \Magento\Catalog\Model\Layer\Resolver $resolver */
$resolver = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/ResultTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/ResultTest.php
index e36e3dee65954..76a4ff9714ebd 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/ResultTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/ResultTest.php
@@ -28,7 +28,7 @@ class ResultTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->layout = $this->objectManager->get(LayoutInterface::class);
@@ -69,12 +69,12 @@ public function testEscapeSearchText(string $searchValue, string $expectedOutput
$request->setParam(QueryFactory::QUERY_VAR_NAME, $searchValue);
$searchHtml = $searchBlock->toHtml();
- $this->assertContains('value=' . '"' . $expectedOutput . '"', $searchHtml);
- $this->assertNotContains($unexpectedOutput, $searchHtml);
+ $this->assertStringContainsString('value=' . '"' . $expectedOutput . '"', $searchHtml);
+ $this->assertStringNotContainsString($unexpectedOutput, $searchHtml);
$resultTitle = $searchResultBlock->getSearchQueryText()->render();
- $this->assertContains("Search results for: '{$expectedOutput}'", $resultTitle);
- $this->assertNotContains($unexpectedOutput, $resultTitle);
+ $this->assertStringContainsString("Search results for: '{$expectedOutput}'", $resultTitle);
+ $this->assertStringNotContainsString($unexpectedOutput, $resultTitle);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/TermTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/TermTest.php
index bc1bc3a79688b..fb15646b1825a 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/TermTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/TermTest.php
@@ -12,7 +12,7 @@ class TermTest extends \PHPUnit\Framework\TestCase
*/
protected $_block;
- protected function setUp()
+ protected function setUp(): void
{
$this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Framework\View\LayoutInterface::class
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php
index 7c627c8f56244..dcbaa4addd85e 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php
@@ -28,7 +28,7 @@ class ResultTest extends AbstractController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->productAttributeRepository = $this->_objectManager->create(ProductAttributeRepositoryInterface::class);
@@ -64,7 +64,7 @@ public function testExecute(array $searchParams): void
);
$this->dispatch('catalogsearch/advanced/result');
$responseBody = $this->getResponse()->getBody();
- $this->assertContains('Simple product name', $responseBody);
+ $this->assertStringContainsString('Simple product name', $responseBody);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/AjaxTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/AjaxTest.php
index 799bb5c16c43f..08c3832aadc20 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/AjaxTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/AjaxTest.php
@@ -14,6 +14,6 @@ public function testSuggestAction()
{
$this->getRequest()->setParam('q', 'query_text');
$this->dispatch('catalogsearch/ajax/suggest');
- $this->assertContains('query_text', $this->getResponse()->getBody());
+ $this->assertStringContainsString('query_text', $this->getResponse()->getBody());
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Result/IndexTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Result/IndexTest.php
index 279d718131dcf..29708b76caf39 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Result/IndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Result/IndexTest.php
@@ -20,7 +20,6 @@ class IndexTest extends AbstractController
/**
* Quick search test by difference product attributes.
*
- * @magentoConfigFixture default/catalog/search/engine mysql
* @magentoAppArea frontend
* @magentoDataFixture Magento/CatalogSearch/_files/product_for_search.php
* @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php
@@ -34,7 +33,7 @@ public function testExecute(string $searchString): void
$this->getRequest()->setParam('q', $searchString);
$this->dispatch('catalogsearch/result');
$responseBody = $this->getResponse()->getBody();
- $this->assertContains('Simple product name', $responseBody);
+ $this->assertStringContainsString('Simple product name', $responseBody);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/ResultTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/ResultTest.php
index 24ad6af1fea51..bdab090312de3 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/ResultTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/ResultTest.php
@@ -25,11 +25,11 @@ public function testIndexActionTranslation()
$this->dispatch('catalogsearch/result');
$responseBody = $this->getResponse()->getBody();
- $this->assertNotContains('for="search">Search', $responseBody);
+ $this->assertStringNotContainsString('for="search">Search', $responseBody);
$this->assertStringMatchesFormat('%aSuche%S%a', $responseBody);
- $this->assertNotContains('Search entire store here...', $responseBody);
- $this->assertContains('Den gesamten Shop durchsuchen...', $responseBody);
+ $this->assertStringNotContainsString('Search entire store here...', $responseBody);
+ $this->assertStringContainsString('Den gesamten Shop durchsuchen...', $responseBody);
}
/**
@@ -44,8 +44,8 @@ public function testIndexActionXSSQueryVerification()
$responseBody = $this->getResponse()->getBody();
$data = '';
- $this->assertNotContains($data, $responseBody);
- $this->assertContains($escaper->escapeHtml($data), $responseBody);
+ $this->assertStringNotContainsString($data, $responseBody);
+ $this->assertStringContainsString($escaper->escapeHtml($data), $responseBody);
}
/**
@@ -86,7 +86,7 @@ public function testPopularity()
$responseBody = $this->getResponse()->getBody();
$data = '"success":true';
- $this->assertContains($data, $responseBody);
+ $this->assertStringContainsString($data, $responseBody);
$query->loadByQueryText('query_text');
$this->assertEquals(2, $query->getPopularity());
@@ -109,8 +109,8 @@ public function testPopularSearch()
$this->dispatch('/catalogsearch/result/?q=popular_query_text');
$responseBody = $this->getResponse()->getBody();
- $this->assertContains('Search results for: 'popular_query_text'', $responseBody);
- $this->assertContains('/catalogsearch/searchTermsLog/save/', $responseBody);
+ $this->assertStringContainsString('Search results for: 'popular_query_text'', $responseBody);
+ $this->assertStringContainsString('/catalogsearch/searchTermsLog/save/', $responseBody);
$query->loadByQueryText('popular_query_text');
$this->assertEquals(100, $query->getPopularity());
@@ -133,8 +133,8 @@ public function testPopularSearchWithAdditionalRequestParameters()
$this->dispatch('/catalogsearch/result/?q=popular_query_text&additional_parameters=some');
$responseBody = $this->getResponse()->getBody();
- $this->assertContains('Search results for: 'popular_query_text'', $responseBody);
- $this->assertNotContains('/catalogsearch/searchTermsLog/save/', $responseBody);
+ $this->assertStringContainsString('Search results for: 'popular_query_text'', $responseBody);
+ $this->assertStringNotContainsString('/catalogsearch/searchTermsLog/save/', $responseBody);
$query->loadByQueryText('popular_query_text');
$this->assertEquals(101, $query->getPopularity());
@@ -157,8 +157,8 @@ public function testNotPopularSearch()
$this->dispatch('/catalogsearch/result/?q=query_text');
$responseBody = $this->getResponse()->getBody();
- $this->assertContains('Search results for: 'query_text'', $responseBody);
- $this->assertNotContains('/catalogsearch/searchTermsLog/save/', $responseBody);
+ $this->assertStringContainsString('Search results for: 'query_text'', $responseBody);
+ $this->assertStringNotContainsString('/catalogsearch/searchTermsLog/save/', $responseBody);
$query->loadByQueryText('query_text');
$this->assertEquals(2, $query->getPopularity());
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Helper/DataTest.php
index ec20229f9beb8..58ef9deb10757 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Helper/DataTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Helper/DataTest.php
@@ -12,7 +12,7 @@ class DataTest extends \PHPUnit\Framework\TestCase
*/
protected $_helper;
- protected function setUp()
+ protected function setUp(): void
{
/** @var \Magento\TestFramework\ObjectManager $objectManager */
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Adapter/Mysql/BaseSelectStrategy/BaseSelectAttributesSearchStrategyTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Adapter/Mysql/BaseSelectStrategy/BaseSelectAttributesSearchStrategyTest.php
index 9a62e8e04ed22..56d641a444c0f 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Adapter/Mysql/BaseSelectStrategy/BaseSelectAttributesSearchStrategyTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Adapter/Mysql/BaseSelectStrategy/BaseSelectAttributesSearchStrategyTest.php
@@ -38,7 +38,7 @@ class BaseSelectAttributesSearchStrategyTest extends \PHPUnit\Framework\TestCase
*/
private $scopeResolver;
- protected function setUp()
+ protected function setUp(): void
{
$this->baseSelectAttributesSearchStrategy = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(BaseSelectAttributesSearchStrategy::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Adapter/Mysql/BaseSelectStrategy/BaseSelectFullTextSearchStrategyTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Adapter/Mysql/BaseSelectStrategy/BaseSelectFullTextSearchStrategyTest.php
index ea3197da4d907..4d8623a4e9cac 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Adapter/Mysql/BaseSelectStrategy/BaseSelectFullTextSearchStrategyTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Adapter/Mysql/BaseSelectStrategy/BaseSelectFullTextSearchStrategyTest.php
@@ -32,7 +32,7 @@ class BaseSelectFullTextSearchStrategyTest extends \PHPUnit\Framework\TestCase
*/
private $scopeResolver;
- protected function setUp()
+ protected function setUp(): void
{
$this->baseSelectFullTextSearchStrategy = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(BaseSelectFullTextSearchStrategy::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProviderTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProviderTest.php
index 8f3f9b3b19c0f..0155c99e494f1 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProviderTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProviderTest.php
@@ -49,7 +49,7 @@ class DataProviderTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->searchRequestConfig = $this->objectManager->create(SearchRequestConfig::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/FullTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/FullTest.php
index a5c18f0fcee6c..8033b73631f19 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/FullTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/FullTest.php
@@ -20,13 +20,16 @@
*/
class FullTest extends \PHPUnit\Framework\TestCase
{
+ protected function setUp(): void
+ {
+ $this->markTestSkipped("MC-18332: Mysql Search Engine is deprecated and will be removed");
+ }
/**
* Testing fulltext index rebuild
*
* @magentoDataFixture Magento/CatalogSearch/_files/products_for_index.php
* @magentoDataFixture Magento/CatalogSearch/_files/product_configurable_not_available.php
* @magentoDataFixture Magento/Framework/Search/_files/product_configurable.php
- * @magentoConfigFixture default/catalog/search/engine mysql
*/
public function testGetIndexData()
{
@@ -51,8 +54,8 @@ public function testGetIndexData()
$productsIds = array_keys($result);
foreach ($productsIds as $productId) {
$product = $productRepository->getById($productId);
- $this->assertContains($product->getVisibility(), $allowedVisibility);
- $this->assertContains($product->getStatus(), $allowedStatuses);
+ $this->assertContainsEquals($product->getVisibility(), $allowedVisibility);
+ $this->assertContainsEquals($product->getStatus(), $allowedStatuses);
}
$expectedData = $this->getExpectedIndexData();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php
index ec2a14abafc18..b3a8a067d877b 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Model/Plugin/CategoryTest.php
@@ -24,7 +24,7 @@ class CategoryTest extends \PHPUnit\Framework\TestCase
*/
private $categoryRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->indexerProcessor = Bootstrap::getObjectManager()->create(Processor::class);
$this->categoryRepository = Bootstrap::getObjectManager()->create(CategoryRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AttributeTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AttributeTest.php
index c789183069c10..f30e73d913202 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AttributeTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/AttributeTest.php
@@ -32,7 +32,7 @@ class AttributeTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->indexerProcessor = Bootstrap::getObjectManager()->create(Processor::class);
$this->attribute = Bootstrap::getObjectManager()->create(Attribute::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php
index b0ae104cae393..9da81d35ca9bd 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/FulltextTest.php
@@ -67,7 +67,7 @@ class FulltextTest extends \PHPUnit\Framework\TestCase
*/
protected $dimension;
- protected function setUp()
+ protected function setUp(): void
{
/** @var \Magento\Framework\Indexer\IndexerInterface indexer */
$this->indexer = Bootstrap::getObjectManager()->create(
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/SwitcherUsedInFulltextTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/SwitcherUsedInFulltextTest.php
index 127b4ec675cdc..7f029ae537ddf 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/SwitcherUsedInFulltextTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/SwitcherUsedInFulltextTest.php
@@ -71,7 +71,7 @@ class SwitcherUsedInFulltextTest extends \PHPUnit\Framework\TestCase
*/
protected $dimension;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php
index 13e43a74c4502..463cb026a4c69 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php
@@ -27,7 +27,7 @@ class AttributeTest extends \PHPUnit\Framework\TestCase
*/
protected $_layer;
- protected function setUp()
+ protected function setUp(): void
{
/** @var $attribute \Magento\Catalog\Model\Entity\Attribute */
$attribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
@@ -88,7 +88,7 @@ public function testGetItemsWithApply()
$this->_model->apply($request);
$items = $this->_model->getItems();
- $this->assertInternalType('array', $items);
+ $this->assertIsArray($items);
$this->assertEmpty($items);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/CategoryTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/CategoryTest.php
index a017979028152..960da17f50ff9 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/CategoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/CategoryTest.php
@@ -27,7 +27,7 @@ class CategoryTest extends \PHPUnit\Framework\TestCase
*/
protected $_category;
- protected function setUp()
+ protected function setUp(): void
{
$this->_category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Catalog\Model\Category::class
@@ -43,7 +43,7 @@ protected function setUp()
$this->_model->setRequestVar('cat');
}
- protected function tearDown()
+ protected function tearDown(): void
{
/** @var $objectManager \Magento\TestFramework\ObjectManager */
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -118,8 +118,8 @@ public function testGetItems()
$items = $this->_model->getItems();
- $this->assertInternalType('array', $items);
- $this->assertEquals(2, count($items));
+ $this->assertIsArray($items);
+ $this->assertCount(2, $items);
/** @var $item \Magento\Catalog\Model\Layer\Filter\Item */
$item = $items[0];
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/DecimalTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/DecimalTest.php
index f0c8402c51879..def90b0b5e97b 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/DecimalTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/DecimalTest.php
@@ -21,7 +21,7 @@ class DecimalTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/PriceTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/PriceTest.php
index 232b4ec00973a..98fc2a2370414 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Layer/Filter/PriceTest.php
@@ -28,7 +28,7 @@ class PriceTest extends \PHPUnit\Framework\TestCase
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$category = $this->objectManager->create(
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Advanced/CollectionTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Advanced/CollectionTest.php
index 3eea0aa117452..407d2bc3ce2e3 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Advanced/CollectionTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Advanced/CollectionTest.php
@@ -20,7 +20,7 @@ class CollectionTest extends \PHPUnit\Framework\TestCase
*/
private $advancedCollection;
- protected function setUp()
+ protected function setUp(): void
{
$advanced = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(\Magento\CatalogSearch\Model\Search\ItemCollectionProvider::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php
index 55465e938e71b..4c9c670a946b0 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php
@@ -11,11 +11,15 @@
*/
class CollectionTest extends \PHPUnit\Framework\TestCase
{
+ protected function setUp(): void
+ {
+ $this->markTestSkipped("MC-18332: Mysql Search Engine is deprecated and will be removed");
+ }
+
/**
* @dataProvider filtersDataProviderSearch
* @magentoDataFixture Magento/Framework/Search/_files/products.php
* @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php
- * @magentoConfigFixture default/catalog/search/engine mysql
* @magentoAppIsolation enabled
*/
public function testLoadWithFilterSearch($request, $filters, $expectedCount)
@@ -150,7 +154,6 @@ public function filtersDataProviderCatalogView()
* Test configurable product with multiple options
*
* @magentoDataFixture Magento/CatalogSearch/_files/product_configurable_two_options.php
- * @magentoConfigFixture default/catalog/search/engine mysql
* @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php
* @magentoAppIsolation enabled
* @dataProvider configurableProductWithMultipleOptionsDataProvider
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/AttributeSearchWeightTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/AttributeSearchWeightTest.php
index bfde20950d105..b05bc21d66a61 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/AttributeSearchWeightTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/AttributeSearchWeightTest.php
@@ -43,7 +43,7 @@ class AttributeSearchWeightTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productAttributeRepository = $this->objectManager->get(ProductAttributeRepositoryInterface::class);
@@ -54,7 +54,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->updateAttributesWeight($this->collectedAttributesWeight);
}
@@ -62,7 +62,6 @@ protected function tearDown()
/**
* Perform search by word and check founded product order in different cases.
*
- * @magentoConfigFixture default/catalog/search/engine mysql
* @magentoDataFixture Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php
* @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php
* @dataProvider attributeSearchWeightDataProvider
@@ -78,6 +77,9 @@ public function testAttributeSearchWeight(
array $attributeWeights,
array $expectedProductNames
): void {
+ $this->markTestSkipped(
+ 'MC-33824: Stabilize skipped test cases for Integration AttributeSearchWeightTest with Elasticsearch'
+ );
$this->updateAttributesWeight($attributeWeights);
$actualProductNames = $this->quickSearchByQuery->execute($searchQuery)->getColumnValues('name');
$this->assertEquals($expectedProductNames, $actualProductNames, 'Products order is not as expected.');
@@ -91,57 +93,57 @@ public function testAttributeSearchWeight(
public function attributeSearchWeightDataProvider(): array
{
return [
- 'sku_order_more_than_name' => [
- '1234-1234-1234-1234',
- [
- 'sku' => 6,
- 'name' => 5,
- ],
- [
- 'Simple',
- '1234-1234-1234-1234',
- ],
- ],
'name_order_more_than_sku' => [
- '1234-1234-1234-1234',
+ 'Nintendo Wii',
[
- 'name' => 6,
'sku' => 5,
+ 'name' => 6,
],
[
- '1234-1234-1234-1234',
- 'Simple',
+ 'Nintendo Wii',
+ 'Xbox',
],
],
'search_by_word_from_description' => [
- 'Simple',
+ 'Xbox',
[
- 'test_searchable_attribute' => 8,
- 'sku' => 6,
- 'name' => 5,
+ 'name' => 10,
+ 'test_searchable_attribute' => 9,
+ 'sku' => 2,
'description' => 1,
],
[
- 'Product with attribute',
- '1234-1234-1234-1234',
- 'Simple',
- 'Product with description',
+ 'Nintendo Wii',
+ 'Xbox',
+ 'Console description',
+ 'Gamecube attribute',
],
],
'search_by_attribute_option' => [
- 'Simple',
+ 'Xbox',
[
- 'description' => 10,
- 'test_searchable_attribute' => 8,
- 'sku' => 6,
- 'name' => 1,
+ 'name' => 10,
+ 'description' => 9,
+ 'test_searchable_attribute' => 7,
+ 'sku' => 2,
+ ],
+ [
+ 'Nintendo Wii',
+ 'Xbox',
+ 'Console description',
+ 'Gamecube attribute',
],
+ ],
+ 'sku_order_more_than_name' => [
+ 'Nintendo Wii',
[
- 'Product with description',
- 'Product with attribute',
- '1234-1234-1234-1234',
- 'Simple',
+ 'sku' => 6,
+ 'name' => 5,
],
+ [
+ 'Xbox',
+ 'Nintendo Wii',
+ ]
],
];
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/CustomAttributeFilterTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/CustomAttributeFilterTest.php
index d92539396de58..f6a7e2d2118ba 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/CustomAttributeFilterTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/CustomAttributeFilterTest.php
@@ -25,7 +25,7 @@ class CustomAttributeFilterTest extends \PHPUnit\Framework\TestCase
/** @var */
private $customAttributeFilter;
- /** @var EavConfig|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var EavConfig|\PHPUnit\Framework\MockObject\MockObject */
private $eavConfigMock;
/** @var StoreManagerInterface */
@@ -34,7 +34,7 @@ class CustomAttributeFilterTest extends \PHPUnit\Framework\TestCase
/** @var ConditionManager */
private $conditionManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->resource = $this->objectManager->create(ResourceConnection::class);
@@ -68,11 +68,12 @@ public function testApplyWithoutFilters()
}
/**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Invalid attribute id for field: field1
*/
public function testApplyWithWrongAttributeFilter()
{
+ $this->expectException(\InvalidArgumentException::class);
+ $this->expectExceptionMessage('Invalid attribute id for field: field1');
+
$select = $this->resource->getConnection()->select();
$filters = $this->mockFilters();
$firstFilter = reset($filters);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithFullFilterTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithFullFilterTest.php
index e94eda11a3fc5..f323ac2fc2435 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithFullFilterTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithFullFilterTest.php
@@ -57,7 +57,7 @@ class StockStatusFilterWithFullFilterTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithGeneralFilterTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithGeneralFilterTest.php
index 809116e9c7d84..617f878e041e3 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithGeneralFilterTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/StockStatusFilterWithGeneralFilterTest.php
@@ -40,7 +40,7 @@ class StockStatusFilterWithGeneralFilterTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -52,11 +52,12 @@ protected function setUp()
/**
* @return void
*
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Invalid filter type: some_wrong_type
*/
public function testApplyWithWrongType()
{
+ $this->expectException(\InvalidArgumentException::class);
+ $this->expectExceptionMessage('Invalid filter type: some_wrong_type');
+
$select = $this->resource->getConnection()->select();
$this->stockStatusFilter->apply(
$select,
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/VisibilityFilterTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/VisibilityFilterTest.php
index e1e75d98f05d4..c8abd200d7f4b 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/VisibilityFilterTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/FilterMapper/VisibilityFilterTest.php
@@ -27,7 +27,7 @@ class VisibilityFilterTest extends \PHPUnit\Framework\TestCase
/** @var StoreManagerInterface */
private $storeManager;
- /** @var EavConfig|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var EavConfig|\PHPUnit\Framework\MockObject\MockObject */
private $eavConfigMock;
/** @var VisibilityFilter */
@@ -36,7 +36,7 @@ class VisibilityFilterTest extends \PHPUnit\Framework\TestCase
/** @var int */
private $answerToLifeTheUniverseAndEverything = 42;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->resource = $this->objectManager->create(ResourceConnection::class);
@@ -56,11 +56,12 @@ protected function setUp()
}
/**
- * @expectedException InvalidArgumentException
- * @expectedExceptionMessage Invalid filter type: Luke, I am your father!
*/
public function testApplyWithWrongType()
{
+ $this->expectException(\InvalidArgumentException::class);
+ $this->expectExceptionMessage('Invalid filter type: Luke, I am your father!');
+
$select = $this->resource->getConnection()->select();
$filter = $this->mockFilter();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php
index df577d1f158df..b93c0284f9463 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php
@@ -18,7 +18,7 @@ class RequestGeneratorTest extends \PHPUnit\Framework\TestCase
*/
protected $model;
- protected function setUp()
+ protected function setUp(): void
{
$this->model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create(\Magento\CatalogSearch\Model\Search\RequestGenerator::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php
index cb7aaa9f16a19..50b2a3038b364 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php
@@ -23,8 +23,9 @@
$product->setTypeId(Type::TYPE_SIMPLE)
->setAttributeSetId($product->getDefaultAttributeSetId())
->setWebsiteIds([1])
- ->setName('Simple')
- ->setSku('1234-1234-1234-1234')
+ ->setName('Xbox')
+ ->setSku('nintendo-wii')
+ ->setUrlKey('not-related')
->setPrice(10)
->setTaxClassId(0)
->setVisibility(Visibility::VISIBILITY_BOTH)
@@ -43,8 +44,9 @@
$product->setTypeId(Type::TYPE_SIMPLE)
->setAttributeSetId($product->getDefaultAttributeSetId())
->setWebsiteIds([1])
- ->setName('1234-1234-1234-1234')
- ->setSku('Simple')
+ ->setName('Nintendo Wii')
+ ->setSku('xbox')
+ ->setUrlKey('something-random')
->setPrice(10)
->setTaxClassId(0)
->setVisibility(Visibility::VISIBILITY_BOTH)
@@ -63,9 +65,10 @@
$product->setTypeId(Type::TYPE_SIMPLE)
->setAttributeSetId($product->getDefaultAttributeSetId())
->setWebsiteIds([1])
- ->setName('Product with description')
- ->setSku('product_with_description')
- ->setDescription('Simple')
+ ->setName('Console description')
+ ->setSku('console_description')
+ ->setUrlKey('console-description')
+ ->setDescription('xbox')
->setPrice(10)
->setTaxClassId(0)
->setVisibility(Visibility::VISIBILITY_BOTH)
@@ -84,13 +87,14 @@
$product->setTypeId(Type::TYPE_SIMPLE)
->setAttributeSetId($product->getDefaultAttributeSetId())
->setWebsiteIds([1])
- ->setName('Product with attribute')
- ->setSku('product_with_attribute')
+ ->setName('Gamecube attribute')
+ ->setSku('gamecube_attribute')
+ ->setUrlKey('gamecube-attribute')
->setPrice(10)
->setTaxClassId(0)
->setVisibility(Visibility::VISIBILITY_BOTH)
->setStatus(Status::STATUS_ENABLED)
- ->setTestSearchableAttribute($attribute->getSource()->getOptionId('Simple'))
+ ->setTestSearchableAttribute($attribute->getSource()->getOptionId('xbox'))
->setStockData(
[
'use_config_manage_stock' => 1,
diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/searchable_attribute.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/searchable_attribute.php
index 0d20dcb24dfbf..516056242e24d 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/searchable_attribute.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/_files/searchable_attribute.php
@@ -46,7 +46,7 @@
'option_1' => ['Option 1'],
'option_2' => ['Option 2'],
'option_3' => ['Option 3'],
- 'option_4' => ['Simple']
+ 'option_4' => ['xbox']
],
'order' => [
'option_1' => 1,
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/AbstractUrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/AbstractUrlRewriteTest.php
index 251a79f46e38c..c71b03da3188c 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/AbstractUrlRewriteTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/AbstractUrlRewriteTest.php
@@ -39,7 +39,7 @@ abstract class AbstractUrlRewriteTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php
index 67a1e0bb43ecb..d0f6f755f93ef 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGeneratorTest.php
@@ -31,7 +31,7 @@ class CategoryUrlRewriteGeneratorTest extends TestCase
/** @var ObjectManagerInterface */
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteTest.php
index 1431148c5f868..3d02b2a469e29 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteTest.php
@@ -48,7 +48,7 @@ class CategoryUrlRewriteTest extends AbstractUrlRewriteTest
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGeneratorTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGeneratorTest.php
index 446b423e17187..e63654e02c4b1 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGeneratorTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGeneratorTest.php
@@ -38,7 +38,7 @@ class AnchorUrlRewriteGeneratorTest extends TestCase
/**
* @inheritDoc
*/
- public function setUp()
+ protected function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteGeneratorTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteGeneratorTest.php
index 091e5318fa924..4b5f3fd5fc24e 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteGeneratorTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteGeneratorTest.php
@@ -23,7 +23,7 @@ class ProductUrlRewriteGeneratorTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteTest.php
index f8fe68c2e0a2d..0432649455abe 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteTest.php
@@ -41,7 +41,7 @@ class ProductUrlRewriteTest extends AbstractUrlRewriteTest
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteSavingObserverTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteSavingObserverTest.php
index 367018d5090bd..5bb20bcd959e0 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteSavingObserverTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteSavingObserverTest.php
@@ -26,7 +26,7 @@ class CategoryProcessUrlRewriteSavingObserverTest extends \PHPUnit\Framework\Tes
/** @var \Magento\Framework\ObjectManagerInterface */
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -51,7 +51,7 @@ private function getActualResults(array $filter)
return $actualResults;
}
- public function tearDown()
+ protected function tearDown(): void
{
$category = $this->objectManager->create(\Magento\Catalog\Model\Category::class);
$category->load(3);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProcessUrlRewriteOnChangeVisibilityObserverTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProcessUrlRewriteOnChangeVisibilityObserverTest.php
index d3f0e9fa2a5ab..77715ad54e146 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProcessUrlRewriteOnChangeVisibilityObserverTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProcessUrlRewriteOnChangeVisibilityObserverTest.php
@@ -37,7 +37,7 @@ class ProcessUrlRewriteOnChangeVisibilityObserverTest extends \PHPUnit\Framework
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserverTest.php
index c72a58197b1fd..c3efd660792c0 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserverTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserverTest.php
@@ -21,7 +21,7 @@ class ProductProcessUrlRewriteSavingObserverTest extends \PHPUnit\Framework\Test
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -85,7 +85,7 @@ public function testUrlKeyHasChangedInGlobalContext()
];
$actual = $this->getActualResults($productFilter);
foreach ($expected as $row) {
- $this->assertContains($row, $actual);
+ $this->assertContainsEquals($row, $actual);
}
$product->setData('save_rewrites_history', true);
@@ -126,7 +126,7 @@ public function testUrlKeyHasChangedInGlobalContext()
$actual = $this->getActualResults($productFilter);
foreach ($expected as $row) {
- $this->assertContains($row, $actual);
+ $this->assertContainsEquals($row, $actual);
}
}
@@ -182,7 +182,7 @@ public function testUrlKeyHasChangedInStoreviewContextWithPermanentRedirection()
$actual = $this->getActualResults($productFilter);
foreach ($expected as $row) {
- $this->assertContains($row, $actual);
+ $this->assertContainsEquals($row, $actual);
}
}
@@ -231,7 +231,7 @@ public function testUrlKeyHasChangedInStoreviewContextWithoutPermanentRedirectio
$actual = $this->getActualResults($productFilter);
foreach ($expected as $row) {
- $this->assertContains($row, $actual);
+ $this->assertContainsEquals($row, $actual);
}
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandlerTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandlerTest.php
index ed69c2a74885c..18b6bedfec262 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandlerTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandlerTest.php
@@ -40,7 +40,7 @@ class UrlRewriteHandlerTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Block/Adminhtml/Category/Tab/AttributesTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Block/Adminhtml/Category/Tab/AttributesTest.php
index 8ca84c4b066fe..e2f8a2d5e4c21 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Block/Adminhtml/Category/Tab/AttributesTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Plugin/Catalog/Block/Adminhtml/Category/Tab/AttributesTest.php
@@ -24,7 +24,7 @@ class AttributesTest extends \PHPUnit\Framework\TestCase
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$objectManager = Bootstrap::getObjectManager();
@@ -51,8 +51,8 @@ public function testGetAttributesMeta()
$urlKeyData = $meta['search_engine_optimization']['children']['url_key']['arguments']['data']['config'];
$this->assertEquals('text', $urlKeyData['dataType']);
$this->assertEquals('input', $urlKeyData['formElement']);
- $this->assertEquals(true, $urlKeyData['visible']);
- $this->assertEquals(false, $urlKeyData['required']);
+ $this->assertTrue($urlKeyData['visible']);
+ $this->assertFalse($urlKeyData['required']);
$this->assertEquals('[STORE VIEW]', $urlKeyData['scopeLabel']);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php b/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php
index 8bcd0001b8119..87e5744da6e08 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php
@@ -34,7 +34,7 @@ class ProductListTest extends TestCase
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->block = $this->objectManager->create(ProductsList::class);
@@ -286,7 +286,7 @@ function ($item) {
},
$productCollection->getItems()
);
- $this->assertEquals($matches, $skus, '', 0.0, 10, true);
+ $this->assertEmpty(array_diff($matches, $skus));
}
public function priceFilterDataProvider(): array
diff --git a/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/Widget/ConditionsTest.php b/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/Widget/ConditionsTest.php
index a861a69c2135b..9ea0e29af55cb 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/Widget/ConditionsTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/Widget/ConditionsTest.php
@@ -7,7 +7,7 @@
namespace Magento\CatalogWidget\Block\Product\Widget;
/**
- * Class ConditionsTest
+ * Test for \Magento\CatalogWidget\Block\Product\Widget\Conditions
*/
class ConditionsTest extends \PHPUnit\Framework\TestCase
{
@@ -21,7 +21,7 @@ class ConditionsTest extends \PHPUnit\Framework\TestCase
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->block = $this->objectManager->create(
@@ -63,16 +63,16 @@ public function testRender()
$result = $this->block->render($element);
/* Assert HTML contains form elements */
- $this->assertContains('name="parameters[conditions][1][type]"', $result);
- $this->assertContains('name="parameters[conditions][1][value]"', $result);
+ $this->assertStringContainsString('name="parameters[conditions][1][type]"', $result);
+ $this->assertStringContainsString('name="parameters[conditions][1][value]"', $result);
/* Assert HTML contains child url */
- $this->assertContains(
+ $this->assertStringContainsString(
'catalog_widget/product_widget/conditions/form/options_fieldset67a77e971a7c331b6eaefcaf2f596097',
$result
);
/* Assert HTML contains html id */
- $this->assertContains('window.options_fieldset67a77e971a7c331b6eaefcaf2f596097', $result);
+ $this->assertStringContainsString('window.options_fieldset67a77e971a7c331b6eaefcaf2f596097', $result);
/* Assert HTML contains required JS code */
- $this->assertContains("VarienRulesForm('options_fieldset67a77e971a7c331b6eaefcaf2f596097", $result);
+ $this->assertStringContainsString("VarienRulesForm('options_fieldset67a77e971a7c331b6eaefcaf2f596097", $result);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogWidget/Model/Rule/Condition/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogWidget/Model/Rule/Condition/ProductTest.php
index f7967eee8b247..6dca0ce6e290c 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogWidget/Model/Rule/Condition/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogWidget/Model/Rule/Condition/ProductTest.php
@@ -23,7 +23,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$rule = $this->objectManager->create(\Magento\CatalogWidget\Model\Rule::class);
@@ -61,7 +61,7 @@ public function testAddGlobalAttributeToCollection()
$collectedAttributes = $this->conditionProduct->getRule()->getCollectedAttributes();
$this->assertArrayHasKey('special_price', $collectedAttributes);
$query = (string)$collection->getSelect();
- $this->assertContains('special_price', $query);
+ $this->assertStringContainsString('special_price', $query);
$this->assertEquals('at_special_price.value', $this->conditionProduct->getMappedSqlField());
}
@@ -78,7 +78,7 @@ public function testAddNonGlobalAttributeToCollectionNoProducts()
$collectedAttributes = $this->conditionProduct->getRule()->getCollectedAttributes();
$this->assertArrayHasKey('visibility', $collectedAttributes);
$query = (string)$collection->getSelect();
- $this->assertNotContains('visibility', $query);
+ $this->assertStringNotContainsString('visibility', $query);
$this->assertEquals('', $this->conditionProduct->getMappedSqlField());
$this->assertFalse($this->conditionProduct->hasValueParsed());
$this->assertFalse($this->conditionProduct->hasValue());
@@ -97,7 +97,7 @@ public function testAddNonGlobalAttributeToCollection()
$collectedAttributes = $this->conditionProduct->getRule()->getCollectedAttributes();
$this->assertArrayHasKey('visibility', $collectedAttributes);
$query = (string)$collection->getSelect();
- $this->assertNotContains('visibility', $query);
+ $this->assertStringNotContainsString('visibility', $query);
$this->assertEquals('e.entity_id', $this->conditionProduct->getMappedSqlField());
}
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Api/GuestShippingInformationManagementTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Api/GuestShippingInformationManagementTest.php
index 8018f76567d16..4cb4b00d08a84 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/Api/GuestShippingInformationManagementTest.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/Api/GuestShippingInformationManagementTest.php
@@ -57,7 +57,7 @@ class GuestShippingInformationManagementTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->management = $objectManager->get(GuestShippingInformationManagementInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Api/ShippingInformationManagementTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Api/ShippingInformationManagementTest.php
index a0ccc5014bc19..82eaec41d6610 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/Api/ShippingInformationManagementTest.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/Api/ShippingInformationManagementTest.php
@@ -44,7 +44,7 @@ class ShippingInformationManagementTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->management = $objectManager->get(ShippingInformationManagementInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php
index 8d6c2625daadc..3ec581e6755df 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php
@@ -36,7 +36,7 @@ class UpdateItemQtyTest extends \Magento\TestFramework\TestCase\AbstractControll
*/
private $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Controller/CartTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Controller/CartTest.php
index fc85cc384a3db..a9714a17ffe4f 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/Controller/CartTest.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/Controller/CartTest.php
@@ -36,7 +36,7 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->checkoutSession = $this->_objectManager->get(CheckoutSession::class);
@@ -46,7 +46,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_objectManager->removeSharedInstance(CheckoutSession::class);
parent::tearDown();
@@ -332,9 +332,9 @@ public function testAddToCartSimpleProduct($area, $expectedPrice)
$controller = $this->_objectManager->create(\Magento\Checkout\Controller\Cart\Add::class, [$quote]);
$controller->execute();
- $this->assertContains(json_encode([]), $this->getResponse()->getBody());
+ $this->assertStringContainsString(json_encode([]), $this->getResponse()->getBody());
$items = $quote->getItems()->getItems();
- $this->assertTrue(is_array($items), 'Quote doesn\'t have any items');
+ $this->assertIsArray($items, 'Quote doesn\'t have any items');
$this->assertCount(1, $items, 'Expected quote items not equal to 1');
$item = reset($items);
$this->assertEquals(1, $item->getProductId(), 'Quote has more than one product');
@@ -381,7 +381,7 @@ public function testMessageAtAddToCartWithRedirect()
);
$this->assertSessionMessages(
- $this->contains(
+ $this->containsEqual(
'You added Simple Product to your shopping cart.'
),
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
@@ -415,7 +415,7 @@ public function testMessageAtAddToCartWithoutRedirect()
$this->assertEquals('[]', $this->getResponse()->getBody());
$this->assertSessionMessages(
- $this->contains(
+ $this->containsEqual(
"\n" . 'You added Simple Product to your ' .
'shopping cart.'
),
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Model/CartTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Model/CartTest.php
index 25be9ba0c12b4..f534904e9db6b 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/Model/CartTest.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/Model/CartTest.php
@@ -20,7 +20,7 @@ class CartTest extends \PHPUnit\Framework\TestCase
*/
private $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->cart = Bootstrap::getObjectManager()->create(Cart::class);
$this->productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php
index e0e390e89c97c..41bf18619332a 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php
@@ -47,7 +47,7 @@ class SessionTest extends \PHPUnit\Framework\TestCase
/**
* @return void
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->customerRepository = $this->objectManager->create(CustomerRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Model/ShippingInformationManagementTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Model/ShippingInformationManagementTest.php
index 369919437526c..d3210b7d98314 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/Model/ShippingInformationManagementTest.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/Model/ShippingInformationManagementTest.php
@@ -57,7 +57,7 @@ class ShippingInformationManagementTest extends \PHPUnit\Framework\TestCase
/** @var InvoiceOrderInterface */
private $invoiceOrder;
- public function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/Api/SearchCriteria/ActiveStoreAgreementsFilterTest.php b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/Api/SearchCriteria/ActiveStoreAgreementsFilterTest.php
index 131de7a510223..89ebd40146f22 100644
--- a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/Api/SearchCriteria/ActiveStoreAgreementsFilterTest.php
+++ b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/Api/SearchCriteria/ActiveStoreAgreementsFilterTest.php
@@ -18,7 +18,7 @@ class ActiveStoreAgreementsFilterTest extends \PHPUnit\Framework\TestCase
*/
private $model;
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->model = $this->objectManager->create(
diff --git a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/Checkout/Plugin/GuestValidationTest.php b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/Checkout/Plugin/GuestValidationTest.php
index 34e7afb3f9176..3bcb918359770 100644
--- a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/Checkout/Plugin/GuestValidationTest.php
+++ b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/Checkout/Plugin/GuestValidationTest.php
@@ -56,7 +56,7 @@ class GuestValidationTest extends \PHPUnit\Framework\TestCase
*/
private $objectManager;
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->checkoutSession = $this->objectManager->create(\Magento\Checkout\Model\Session::class);
diff --git a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/ResourceModel/Grid/CollectionTest.php b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/ResourceModel/Grid/CollectionTest.php
index bc098cf1bd0ec..58445f49b8c5a 100644
--- a/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/ResourceModel/Grid/CollectionTest.php
+++ b/dev/tests/integration/testsuite/Magento/CheckoutAgreements/Model/ResourceModel/Grid/CollectionTest.php
@@ -23,7 +23,7 @@ class CollectionTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->collection = Bootstrap::getObjectManager()
->create(Collection::class);
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Block/BlockTest.php b/dev/tests/integration/testsuite/Magento/Cms/Block/BlockTest.php
index 33cb315f7aa71..c97a93e84fd04 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Block/BlockTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Block/BlockTest.php
@@ -28,8 +28,8 @@ public function testToHtml()
);
$block->setBlockId($cmsBlock->getId());
$result = $block->toHtml();
- $this->assertContains('', $result);
- $this->assertContains('Custom variable: "HTML Value". ', $result);
+ $this->assertStringContainsString('', $result);
+ $this->assertStringContainsString('Custom variable: "HTML Value". ', $result);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Block/Widget/BlockTest.php b/dev/tests/integration/testsuite/Magento/Cms/Block/Widget/BlockTest.php
index 266fd66bc3db9..7f71d6eb3f129 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Block/Widget/BlockTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Block/Widget/BlockTest.php
@@ -28,9 +28,9 @@ public function testToHtml()
$block->setBlockId($cmsBlock->getId());
$block->toHtml();
$result = $block->getText();
- $this->assertContains('', $result);
- $this->assertContains('Custom variable: "HTML Value". ', $result);
+ $this->assertStringContainsString('', $result);
+ $this->assertStringContainsString('Custom variable: "HTML Value". ', $result);
$this->assertSame($cmsBlock->getIdentities(), $block->getIdentities());
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/PageDesignTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/PageDesignTest.php
index 8bc7a89280559..cb6ea60a5efdc 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/PageDesignTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/PageDesignTest.php
@@ -64,7 +64,7 @@ class PageDesignTest extends AbstractBackendController
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -76,7 +76,7 @@ protected function setUp()
/**
* @inheritDoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
parent::tearDown();
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFilesTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFilesTest.php
index 15bd56f86486c..4164ad99bbf29 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFilesTest.php
@@ -53,7 +53,7 @@ class DeleteFilesTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$directoryName = 'directory1';
@@ -182,7 +182,7 @@ public function testExecuteWithLinkedMedia()
/**
* @inheritdoc
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->get(\Magento\Framework\Filesystem::class);
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFolderTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFolderTest.php
index 94638f3a71537..a80d2102edd0a 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFolderTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFolderTest.php
@@ -49,7 +49,7 @@ class DeleteFolderTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->filesystem = $objectManager->get(\Magento\Framework\Filesystem::class);
@@ -155,7 +155,7 @@ public function testExecuteWithExcludedDirectoryName()
/**
* @inheritdoc
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->get(\Magento\Framework\Filesystem::class);
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/IndexTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/IndexTest.php
index 52a06e898e9b0..37d22d9fa9e03 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/IndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/IndexTest.php
@@ -12,8 +12,8 @@ public function testViewAction()
{
$this->dispatch('backend/cms/wysiwyg_images/index/target_element_id/page_content/store/undefined/type/image/');
$content = $this->getResponse()->getBody();
- $this->assertNotContains('assertNotContains('assertNotContains('assertStringNotContainsString('assertStringNotContainsString('assertStringNotContainsString('filesystem = $objectManager->get(\Magento\Framework\Filesystem::class);
@@ -121,7 +121,7 @@ public function testExecuteWithWrongPath()
/**
* @inheritdoc
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->get(\Magento\Framework\Filesystem::class);
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/UploadTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/UploadTest.php
index df8994c1a5a91..de5b50c7742ea 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/UploadTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/UploadTest.php
@@ -63,7 +63,7 @@ class UploadTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$directoryName = 'directory1';
@@ -210,7 +210,7 @@ public function testExecuteWithWrongFileName()
/**
* @inheritdoc
*/
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
$filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->get(\Magento\Framework\Filesystem::class);
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Noroute/IndexTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Noroute/IndexTest.php
index 830d9d73865d5..4f5eebf859e53 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Controller/Noroute/IndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Noroute/IndexTest.php
@@ -7,6 +7,7 @@
/**
* Test class for \Magento\Cms\Controller\Page.
*/
+
namespace Magento\Cms\Controller\Noroute;
class IndexTest extends \Magento\TestFramework\TestCase\AbstractController
@@ -18,6 +19,9 @@ class IndexTest extends \Magento\TestFramework\TestCase\AbstractController
public function testDisabledNoRoutePage()
{
$this->dispatch('/test123');
- $this->assertContains('There was no 404 CMS page configured or found.', $this->getResponse()->getBody());
+ $this->assertStringContainsString(
+ 'There was no 404 CMS page configured or found.',
+ $this->getResponse()->getBody()
+ );
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php
index d80644caca086..8d82602b3ac1c 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php
@@ -18,7 +18,7 @@ class PageTest extends \Magento\TestFramework\TestCase\AbstractController
public function testViewAction()
{
$this->dispatch('/enable-cookies');
- $this->assertContains('What are Cookies?', $this->getResponse()->getBody());
+ $this->assertStringContainsString('What are Cookies?', $this->getResponse()->getBody());
}
public function testViewRedirectWithTrailingSlash()
@@ -41,7 +41,7 @@ public function testAddBreadcrumbs()
\Magento\Framework\View\LayoutInterface::class
);
$breadcrumbsBlock = $layout->getBlock('breadcrumbs');
- $this->assertContains($breadcrumbsBlock->toHtml(), $this->getResponse()->getBody());
+ $this->assertStringContainsString($breadcrumbsBlock->toHtml(), $this->getResponse()->getBody());
}
/**
@@ -51,7 +51,7 @@ public function testCreatePageWithSameModuleName()
{
$this->dispatch('/shipping');
$content = $this->getResponse()->getBody();
- $this->assertContains('Shipping Test Page', $content);
+ $this->assertStringContainsString('Shipping Test Page', $content);
}
public static function cmsPageWithSystemRouteFixture()
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/RouterTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/RouterTest.php
index 6895827d31d41..5f5f9dda20c66 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Controller/RouterTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/RouterTest.php
@@ -16,7 +16,7 @@ class RouterTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->markTestIncomplete('MAGETWO-3393');
$this->_model = new \Magento\Cms\Controller\Router(
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Helper/Wysiwyg/ImagesTest.php b/dev/tests/integration/testsuite/Magento/Cms/Helper/Wysiwyg/ImagesTest.php
index 68273ebe6180d..46eb1e98ddc6a 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Helper/Wysiwyg/ImagesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Helper/Wysiwyg/ImagesTest.php
@@ -15,7 +15,7 @@ class ImagesTest extends \PHPUnit\Framework\TestCase
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
}
@@ -93,7 +93,7 @@ function ($actualResult) {
'e3ttZWRpYSB1cmw9Ind5c2l3eWcvaGVsbG8ucG5nIn19/'
);
- $this->assertContains($expectedResult, parse_url($actualResult, PHP_URL_PATH));
+ $this->assertStringContainsString($expectedResult, parse_url($actualResult, PHP_URL_PATH));
}
],
[true, 'wysiwyg/hello.png', false, 'http://example.com/pub/media/wysiwyg/hello.png'],
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/BlockTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/BlockTest.php
index 3925975a0f70e..81c3b022b0963 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Model/BlockTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Model/BlockTest.php
@@ -40,7 +40,7 @@ class BlockTest extends TestCase
*/
private $blockIdentifier;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Page/CustomLayoutManagerTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Page/CustomLayoutManagerTest.php
index 6aa3dcd1c34f9..b9e8036b1300e 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Model/Page/CustomLayoutManagerTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Page/CustomLayoutManagerTest.php
@@ -50,7 +50,7 @@ class CustomLayoutManagerTest extends TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->resultFactory = $objectManager->get(PageResultFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Page/CustomLayoutRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Page/CustomLayoutRepositoryTest.php
index e3422cd81638b..0036c1722fd52 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Model/Page/CustomLayoutRepositoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Page/CustomLayoutRepositoryTest.php
@@ -47,7 +47,7 @@ class CustomLayoutRepositoryTest extends TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->fakeManager = $objectManager->get(CustomLayoutManager::class);
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Page/DataProviderTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Page/DataProviderTest.php
index 2028f5d8a04b6..17188238c5126 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Model/Page/DataProviderTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Page/DataProviderTest.php
@@ -45,7 +45,7 @@ class DataProviderTest extends TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->repo = $objectManager->get(GetPageByIdentifierInterface::class);
@@ -87,7 +87,7 @@ public function testCustomLayoutData(): void
$this->assertNotEmpty($page1Data);
$this->assertNotEmpty($page2Data);
$this->assertEquals('_existing_', $page1Data['layout_update_selected']);
- $this->assertEquals(null, $page2Data['layout_update_selected']);
+ $this->assertNull($page2Data['layout_update_selected']);
$this->assertEquals('test_selected', $page3Data['layout_update_selected']);
}
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/PageRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/PageRepositoryTest.php
index 5e7e0c962fcde..88d84eb4dc80a 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Model/PageRepositoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Model/PageRepositoryTest.php
@@ -32,7 +32,7 @@ class PageRepositoryTest extends TestCase
/**
* @inheritDoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->repo = Bootstrap::getObjectManager()->get(PageRepositoryInterface::class);
$this->retriever = Bootstrap::getObjectManager()->get(GetPageByIdentifierInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/PageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/PageTest.php
index 83e7c678ffc51..3d49c366b4081 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Model/PageTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Model/PageTest.php
@@ -14,7 +14,7 @@
*/
class PageTest extends \PHPUnit\Framework\TestCase
{
- protected function setUp()
+ protected function setUp(): void
{
$user = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\User\Model\User::class
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php
index 983d5657a4cee..3d6cbe98cf160 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/ConfigTest.php
@@ -21,7 +21,7 @@ class ConfigTest extends \PHPUnit\Framework\TestCase
/**
* {@inheritdoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = Bootstrap::getObjectManager();
$this->model = $objectManager->create(\Magento\Cms\Model\Wysiwyg\Config::class);
@@ -74,11 +74,13 @@ public function testTestModuleEnabledModuleIsAbleToModifyConfig()
['configProvider' => $compositeConfigProvider]
);
$config = $model->getConfig();
+ // @phpstan-ignore-next-line
$this->assertEquals(TestModuleWysiwygConfig::CONFIG_HEIGHT, $config['height']);
+ // @phpstan-ignore-next-line
$this->assertEquals(TestModuleWysiwygConfig::CONFIG_CONTENT_CSS, $config['content_css']);
$this->assertArrayHasKey('tinymce4', $config);
$this->assertArrayHasKey('toolbar', $config['tinymce4']);
- $this->assertNotContains(
+ $this->assertStringNotContainsString(
'charmap',
$config['tinymce4']['toolbar'],
'Failed to address that the custom test module removes "charmap" button from the toolbar'
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php
index c77646ca5be1c..5685f9f140a6d 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Model/Wysiwyg/Images/StorageTest.php
@@ -42,7 +42,7 @@ class StorageTest extends \PHPUnit\Framework\TestCase
* @inheritdoc
*/
// phpcs:disable
- public static function setUpBeforeClass()
+ public static function setUpBeforeClass(): void
{
self::$_baseDir = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Cms\Helper\Wysiwyg\Images::class
@@ -58,7 +58,7 @@ public static function setUpBeforeClass()
* @inheritdoc
*/
// phpcs:ignore
- public static function tearDownAfterClass()
+ public static function tearDownAfterClass(): void
{
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Framework\Filesystem\Driver\File::class
@@ -70,7 +70,7 @@ public static function tearDownAfterClass()
/**
* @inheritdoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->filesystem = $this->objectManager->get(\Magento\Framework\Filesystem::class);
@@ -126,11 +126,12 @@ public function testDeleteDirectory(): void
/**
* @return void
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage We cannot delete directory /downloadable.
*/
public function testDeleteDirectoryWithExcludedDirPath(): void
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('We cannot delete directory /downloadable.');
+
$dir = $this->objectManager->get(\Magento\Cms\Helper\Wysiwyg\Images::class)->getCurrentPath() . 'downloadable';
$this->storage->deleteDirectory($dir);
}
@@ -162,11 +163,12 @@ public function testUploadFile(): void
/**
* @return void
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage We can't upload the file to current folder right now. Please try another folder.
*/
public function testUploadFileWithExcludedDirPath(): void
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('We can\'t upload the file to current folder right now. Please try another folder.');
+
$fileName = 'magento_small_image.jpg';
$tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP);
$filePath = $tmpDirectory->getAbsolutePath($fileName);
@@ -194,11 +196,12 @@ public function testUploadFileWithExcludedDirPath(): void
*
* @return void
* @dataProvider testUploadFileWithWrongExtensionDataProvider
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage File validation failed.
*/
public function testUploadFileWithWrongExtension(string $fileName, string $fileType, ?string $storageType): void
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('File validation failed.');
+
$tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP);
$filePath = $tmpDirectory->getAbsolutePath($fileName);
// phpcs:disable
@@ -238,12 +241,13 @@ public function testUploadFileWithWrongExtensionDataProvider(): array
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage File validation failed.
* @return void
*/
public function testUploadFileWithWrongFile(): void
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('File validation failed.');
+
$fileName = 'file.gif';
$tmpDirectory = $this->filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP);
$filePath = $tmpDirectory->getAbsolutePath($fileName);
diff --git a/dev/tests/integration/testsuite/Magento/Cms/Setup/ContentConverterTest.php b/dev/tests/integration/testsuite/Magento/Cms/Setup/ContentConverterTest.php
index 7dbc3d2cc1dbd..4a7c635f72ef3 100644
--- a/dev/tests/integration/testsuite/Magento/Cms/Setup/ContentConverterTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cms/Setup/ContentConverterTest.php
@@ -10,7 +10,7 @@ class ContentConverterTest extends \Magento\TestFramework\TestCase\AbstractContr
/** @var \Magento\Cms\Setup\ContentConverter */
private $converter;
- protected function setUp()
+ protected function setUp(): void
{
$this->converter = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Cms\Setup\ContentConverter::class
diff --git a/dev/tests/integration/testsuite/Magento/CmsUrlRewrite/Plugin/Cms/Model/Store/ViewTest.php b/dev/tests/integration/testsuite/Magento/CmsUrlRewrite/Plugin/Cms/Model/Store/ViewTest.php
index 422cc2958e988..a5934dd98e2a6 100644
--- a/dev/tests/integration/testsuite/Magento/CmsUrlRewrite/Plugin/Cms/Model/Store/ViewTest.php
+++ b/dev/tests/integration/testsuite/Magento/CmsUrlRewrite/Plugin/Cms/Model/Store/ViewTest.php
@@ -39,7 +39,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->urlFinder = $this->objectManager->create(UrlFinderInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/Config/App/Config/Type/SystemTest.php b/dev/tests/integration/testsuite/Magento/Config/App/Config/Type/SystemTest.php
index 075d9f960f29a..14c66b67dcff6 100644
--- a/dev/tests/integration/testsuite/Magento/Config/App/Config/Type/SystemTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/App/Config/Type/SystemTest.php
@@ -24,7 +24,7 @@ class SystemTest extends \PHPUnit\Framework\TestCase
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->system = $this->objectManager->create(System::class);
diff --git a/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormTest.php b/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormTest.php
index e78f4831831ac..aae6ae770063f 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Block/System/Config/FormTest.php
@@ -7,7 +7,9 @@
use Magento\Backend\App\Area\FrontNameResolver;
use Magento\Framework\App\Cache\State;
+use Magento\Framework\Config\FileResolverInterface;
use Magento\Framework\Config\ScopeInterface;
+use Magento\Framework\View\Element\Text;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\Helper\Xpath;
@@ -65,7 +67,7 @@ class FormTest extends \PHPUnit\Framework\TestCase
/** @var string String value stored in DB */
private static $websiteDBString = 'test db value';
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->formFactory = $this->objectManager->create(\Magento\Framework\Data\FormFactory::class);
@@ -83,17 +85,17 @@ public function testDependenceHtml()
)->setCurrentScope(
FrontNameResolver::AREA_CODE
);
- /** @var $block \Magento\Config\Block\System\Config\Form */
- $block = $layout->createBlock(\Magento\Config\Block\System\Config\Form::class, 'block');
+ /** @var $block Form */
+ $block = $layout->createBlock(Form::class, 'block');
- /** @var $childBlock \Magento\Framework\View\Element\Text */
- $childBlock = $layout->addBlock(\Magento\Framework\View\Element\Text::class, 'element_dependence', 'block');
+ /** @var $childBlock Text */
+ $childBlock = $layout->addBlock(Text::class, 'element_dependence', 'block');
$expectedValue = 'dependence_html_relations';
- $this->assertNotContains($expectedValue, $block->toHtml());
+ $this->assertStringNotContainsString($expectedValue, $block->toHtml());
$childBlock->setText($expectedValue);
- $this->assertContains($expectedValue, $block->toHtml());
+ $this->assertStringContainsString($expectedValue, $block->toHtml());
}
/**
@@ -129,7 +131,7 @@ public function testInitFieldsUseDefaultCheckbox(
)->createBlock(
FormStub::class
);
- $block->setScope(\Magento\Config\Block\System\Config\Form::SCOPE_WEBSITES);
+ $block->setScope(Form::SCOPE_WEBSITES);
$block->setStubConfigData($this->configData);
$block->initFields($fieldset, $this->group, $this->section);
@@ -232,7 +234,7 @@ public function testInitFieldsUseConfigPath($fieldId, $isConfigDataEmpty, $confi
)->createBlock(
FormStub::class
);
- $block->setScope(\Magento\Config\Block\System\Config\Form::SCOPE_DEFAULT);
+ $block->setScope(Form::SCOPE_DEFAULT);
$block->setStubConfigData($this->configData);
$block->initFields($fieldset, $this->group, $this->section);
@@ -301,8 +303,8 @@ public function testInitFieldsWithBackendModel(
$this->_setupFieldsInheritCheckbox($fieldId, false, $expectedConfigValue);
if ($isDbOverrideValue) {
- $backendModel = $this->field->getAttribute('backend_model') ? : \Magento\Framework\App\Config\Value::class;
- $path = $this->section->getId() .'/'. $this->group->getId() . '/' . $this->field->getId();
+ $backendModel = $this->field->getAttribute('backend_model') ?: \Magento\Framework\App\Config\Value::class;
+ $path = $this->section->getId() . '/' . $this->group->getId() . '/' . $this->field->getId();
$model = Bootstrap::getObjectManager()->create($backendModel);
$model->setPath($path);
$model->setScopeId($currentScopeCode);
@@ -332,7 +334,7 @@ public function testInitFieldsWithBackendModel(
$fieldsetHtml = $fieldset->getElementHtml();
- $elementId = $this->section->getId() .'_'. $this->group->getId() . '_' . $this->field->getId();
+ $elementId = $this->section->getId() . '_' . $this->group->getId() . '_' . $this->field->getId();
if (is_array($expectedConfigValue)) {
$expectedConfigValue = implode('|', $expectedConfigValue);
}
@@ -396,7 +398,7 @@ protected function _setupFieldsInheritCheckbox($fieldId, $isConfigDataEmpty, $co
$fileIterator = $fileIteratorFactory->create(
[__DIR__ . '/_files/test_system.xml']
);
- $fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($fileIterator));
+ $fileResolverMock->expects($this->any())->method('get')->willReturn($fileIterator);
$objectManager = Bootstrap::getObjectManager();
@@ -440,11 +442,11 @@ public function testInitFormAddsFieldsets()
'section',
'general'
);
- /** @var $block \Magento\Config\Block\System\Config\Form */
+ /** @var $block Form */
$block = Bootstrap::getObjectManager()->get(
\Magento\Framework\View\LayoutInterface::class
)->createBlock(
- \Magento\Config\Block\System\Config\Form::class
+ Form::class
);
$block->initForm();
$expectedIds = [
@@ -509,7 +511,7 @@ private function registerTestConfigXmlMetadata()
$encryptor->encrypt(self::$defaultConfigEncrypted)
);
- $fileResolver = Bootstrap::getObjectManager()->create(\Magento\Framework\Config\FileResolverInterface::class);
+ $fileResolver = Bootstrap::getObjectManager()->create(FileResolverInterface::class);
$directories = $fileResolver->get('config.xml', 'global');
$property = new \ReflectionProperty($directories, 'paths');
@@ -519,7 +521,7 @@ private function registerTestConfigXmlMetadata()
array_merge($property->getValue($directories), [__DIR__ . '/_files/test_config.xml'])
);
- $fileResolverMock = $this->getMockForAbstractClass(\Magento\Framework\Config\FileResolverInterface::class);
+ $fileResolverMock = $this->getMockForAbstractClass(FileResolverInterface::class);
$fileResolverMock->method('get')->willReturn($directories);
$initialReader = Bootstrap::getObjectManager()->create(
@@ -581,7 +583,7 @@ private function setEncryptedValue($encryptedValue)
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->setEncryptedValue('{ENCRYPTED_VALUE}');
diff --git a/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php b/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php
index e59672f1b5e1a..fb9b165847c00 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php
@@ -23,7 +23,7 @@
use Magento\Store\Model\ScopeInterface;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\Framework\App\Config\ReinitableConfigInterface;
-use PHPUnit_Framework_MockObject_MockObject as Mock;
+use PHPUnit\Framework\MockObject\MockObject as Mock;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -89,7 +89,7 @@ class ConfigSetCommandTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
Bootstrap::getInstance()->reinitialize();
$this->objectManager = Bootstrap::getObjectManager();
@@ -115,7 +115,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->writeFile(
$this->configFilePool->getPath(ConfigFilePool::APP_ENV),
@@ -253,7 +253,7 @@ public function testRunExtended(
$value,
$this->scopeConfig->getValue($path, $scope, $scopeCode)
);
- $this->assertSame(null, $this->arrayManager->get($configPath, $this->loadConfig()));
+ $this->assertNull($this->arrayManager->get($configPath, $this->loadConfig()));
$this->runCommand($arguments, $optionsLock, 'Value was saved in app/etc/env.php and locked.');
$this->runCommand($arguments, $optionsLock, 'Value was saved in app/etc/env.php and locked.');
diff --git a/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigShowCommandTest.php b/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigShowCommandTest.php
index 7e78690e7b70c..e7f714250f2c8 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigShowCommandTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigShowCommandTest.php
@@ -67,7 +67,7 @@ class ConfigShowCommandTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->configFilePool = $this->objectManager->get(ConfigFilePool::class);
@@ -125,7 +125,7 @@ public function testExecute($scope, $scopeCode, $resultCode, array $configs)
$commandOutput = $this->commandTester->getDisplay();
foreach ($configValue as $value) {
- $this->assertContains($value, $commandOutput);
+ $this->assertStringContainsString($value, $commandOutput);
}
}
}
@@ -303,7 +303,7 @@ private function loadEnvConfig()
return $this->reader->load(ConfigFilePool::APP_ENV);
}
- public function tearDown()
+ protected function tearDown(): void
{
$_ENV = $this->env;
diff --git a/dev/tests/integration/testsuite/Magento/Config/Controller/Adminhtml/System/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Config/Controller/Adminhtml/System/ConfigTest.php
index f5dbeb2ed12e4..d1702a17ffff8 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Controller/Adminhtml/System/ConfigTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Controller/Adminhtml/System/ConfigTest.php
@@ -22,7 +22,7 @@ class ConfigTest extends \Magento\TestFramework\TestCase\AbstractBackendControll
public function testEditAction()
{
$this->dispatch('backend/admin/system_config/edit');
- $this->assertContains('getResponse()->getBody());
+ $this->assertStringContainsString(' getResponse()->getBody());
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/Admin/RobotsTest.php b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/Admin/RobotsTest.php
index f82ea6d182b3c..8458a26e44659 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/Admin/RobotsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/Admin/RobotsTest.php
@@ -25,7 +25,7 @@ class RobotsTest extends \PHPUnit\Framework\TestCase
/**
* Initialize model
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -98,7 +98,7 @@ protected function _modifyConfig()
/**
* Remove created robots.txt
*/
- protected function tearDown()
+ protected function tearDown(): void
{
require 'Magento/Config/Model/_files/no_robots_txt.php';
}
diff --git a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/BaseurlTest.php b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/BaseurlTest.php
index b44fad54d0a4a..e30ab7cd06e09 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/BaseurlTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/BaseurlTest.php
@@ -74,11 +74,12 @@ public function validationDataProvider()
* @param string $path
* @param string $value
* @magentoDbIsolation enabled
- * @expectedException \Magento\Framework\Exception\LocalizedException
* @dataProvider validationExceptionDataProvider
*/
public function testValidationException($path, $value)
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+
/** @var $model \Magento\Config\Model\Config\Backend\Baseurl */
$model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Config\Model\Config\Backend\Baseurl::class
diff --git a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/Image/AdapterTest.php b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/Image/AdapterTest.php
index 9720b9e559a6d..e88b8f3966954 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/Image/AdapterTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend/Image/AdapterTest.php
@@ -12,7 +12,7 @@ class AdapterTest extends \PHPUnit\Framework\TestCase
*/
protected $_model = null;
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
@@ -22,13 +22,16 @@ protected function setUp()
}
/**
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * expectedExceptionMessage The specified image adapter cannot be used because of some missed dependencies.
* @magentoDbIsolation enabled
* @magentoAppIsolation enabled
*/
public function testExceptionSave()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage(
+ 'The specified image adapter cannot be used because of: Image adapter for \'wrong\' is not setup.'
+ );
+
$this->_model->setValue('wrong')->save();
}
diff --git a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Processor/EnvironmentPlaceholderTest.php b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Processor/EnvironmentPlaceholderTest.php
index 904fd6e42b1fc..52fff0a167550 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Processor/EnvironmentPlaceholderTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Processor/EnvironmentPlaceholderTest.php
@@ -24,7 +24,7 @@ class EnvironmentPlaceholderTest extends \PHPUnit\Framework\TestCase
*/
private $env = [];
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->model = $this->objectManager->get(EnvironmentPlaceholder::class);
@@ -96,7 +96,7 @@ public function testProcess()
);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$_ENV = $this->env;
}
diff --git a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/ReaderTest.php
index eef8e68458d91..4dc1a2dd0c542 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/ReaderTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/ReaderTest.php
@@ -64,14 +64,14 @@ class ReaderTest extends \PHPUnit\Framework\TestCase
private $converter;
/**
- * @var CompilerInterface|\PHPUnit_Framework_MockObject_MockObject
+ * @var CompilerInterface|\PHPUnit\Framework\MockObject\MockObject
*/
private $compiler;
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->fileUtility = Files::init();
diff --git a/dev/tests/integration/testsuite/Magento/Config/Model/ResourceModel/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Config/Model/ResourceModel/ConfigTest.php
index b15b5207f9ebe..8ecc0161e9604 100644
--- a/dev/tests/integration/testsuite/Magento/Config/Model/ResourceModel/ConfigTest.php
+++ b/dev/tests/integration/testsuite/Magento/Config/Model/ResourceModel/ConfigTest.php
@@ -12,7 +12,7 @@ class ConfigTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Config\Model\ResourceModel\Config::class
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Export/RowCustomizerTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Export/RowCustomizerTest.php
index 4630caa592cef..88aa88627476b 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Export/RowCustomizerTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Export/RowCustomizerTest.php
@@ -20,7 +20,7 @@ class RowCustomizerTest extends \PHPUnit\Framework\TestCase
*/
private $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->model = $this->objectManager->create(
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/Product/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/Product/Type/ConfigurableTest.php
index 04769401c147e..a58809fe5e85e 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/Product/Type/ConfigurableTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/Import/Product/Type/ConfigurableTest.php
@@ -34,7 +34,7 @@ class ConfigurableTest extends \PHPUnit\Framework\TestCase
*/
protected $productMetadata;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->model = $this->objectManager->create(\Magento\CatalogImportExport\Model\Import\Product::class);
@@ -97,7 +97,7 @@ public function testConfigurableImport($pathToFile, $productName, $optionSkuList
/** @var \Magento\Catalog\Model\ResourceModel\Product $resource */
$resource = $this->objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class);
$productId = $resource->getIdBySku($productName);
- $this->assertTrue(is_numeric($productId));
+ $this->assertIsNumeric($productId);
/** @var \Magento\Catalog\Model\Product $product */
$product = $this->objectManager->get(ProductRepositoryInterface::class)->getById($productId);
@@ -118,7 +118,7 @@ public function testConfigurableImport($pathToFile, $productName, $optionSkuList
}
$configurableOptionCollection = $product->getExtensionAttributes()->getConfigurableProductOptions();
- $this->assertEquals(1, count($configurableOptionCollection));
+ $this->assertCount(1, $configurableOptionCollection);
foreach ($configurableOptionCollection as $option) {
$optionData = $option->getData();
$this->assertArrayHasKey('product_super_attribute_id', $optionData);
@@ -147,7 +147,7 @@ public function testConfigurableImport($pathToFile, $productName, $optionSkuList
$this->assertEquals('Option 2', $optionData['options'][1]['store_label']);
$this->assertArrayHasKey('values', $optionData);
$valuesData = $optionData['values'];
- $this->assertEquals(2, count($valuesData));
+ $this->assertCount(2, $valuesData);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/ConfigurableTest.php
index aba813148512c..131395e86ca3c 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/ConfigurableTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Cart/Item/Renderer/ConfigurableTest.php
@@ -30,7 +30,7 @@ class ConfigurableTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->block = $this->objectManager->get(LayoutInterface::class)
@@ -63,6 +63,6 @@ public function testGetProductPriceHtml()
$this->block->getCheckoutSession()->getQuote()->getAllVisibleItems()[0]
);
$html = $this->block->getProductPriceHtml($configurableProduct);
- $this->assertContains('$10.00', $html);
+ $this->assertStringContainsString('$10.00', $html);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/ProductList/RelatedTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/ProductList/RelatedTest.php
index 8543b2600138b..89011e1fa193c 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/ProductList/RelatedTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/ProductList/RelatedTest.php
@@ -27,7 +27,7 @@ class RelatedTest extends AbstractLinksTest
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -48,7 +48,7 @@ public function testRenderConfigurableWithLinkedProduct(): void
$this->prepareBlock();
$html = $this->block->toHtml();
$this->assertNotEmpty($html);
- $this->assertContains($relatedProduct->getName(), $html);
+ $this->assertStringContainsString($relatedProduct->getName(), $html);
$this->assertCount(1, $this->block->getItems());
}
@@ -65,7 +65,7 @@ public function testRenderConfigurableWithLinkedProductOnChild(): void
$this->prepareBlock();
$html = $this->block->toHtml();
$this->assertNotEmpty($html);
- $this->assertNotContains($relatedProduct->getName(), $html);
+ $this->assertStringNotContainsString($relatedProduct->getName(), $html);
$this->assertEmpty($this->block->getItems());
}
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/ProductList/UpsellTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/ProductList/UpsellTest.php
index ad24b84533c79..b2df5a40bce62 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/ProductList/UpsellTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/ProductList/UpsellTest.php
@@ -25,7 +25,7 @@ class UpsellTest extends RelatedTest
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableProductPriceTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableProductPriceTest.php
index 977a130eff838..327544911a45d 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableProductPriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableProductPriceTest.php
@@ -47,7 +47,7 @@ class ConfigurableProductPriceTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -63,7 +63,7 @@ protected function setUp()
/**
* @inheritdoc
*/
- protected function tearDown()
+ protected function tearDown(): void
{
$this->registry->unregister('product');
$this->registry->unregister('current_product');
@@ -188,7 +188,7 @@ private function assertPrice(string $priceBlockHtml, float $expectedPrice): void
{
$regexp = '/As low as<\/span>.*';
$regexp .= '\$%.2f<\/span><\/span>/';
- $this->assertRegExp(
+ $this->assertMatchesRegularExpression(
sprintf($regexp, round($expectedPrice, 2), $expectedPrice),
preg_replace('/[\n\r]/', '', $priceBlockHtml)
);
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableTest.php
index ee1f4d25e88da..39ed7965ea9e9 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableTest.php
@@ -67,7 +67,7 @@ class ConfigurableTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->objectManager = Bootstrap::getObjectManager();
@@ -145,9 +145,9 @@ public function testGetJsonConfigWithChildProductsImages(): void
foreach ($products as $simpleProduct) {
$i++;
$resultImage = reset($config['images'][$simpleProduct->getId()]);
- $this->assertContains($simpleProduct->getImage(), $resultImage['thumb']);
- $this->assertContains($simpleProduct->getImage(), $resultImage['img']);
- $this->assertContains($simpleProduct->getImage(), $resultImage['full']);
+ $this->assertStringContainsString($simpleProduct->getImage(), $resultImage['thumb']);
+ $this->assertStringContainsString($simpleProduct->getImage(), $resultImage['img']);
+ $this->assertStringContainsString($simpleProduct->getImage(), $resultImage['full']);
$this->assertTrue($resultImage['isMain']);
$this->assertEquals('image', $resultImage['type']);
$this->assertEquals($i, $resultImage['position']);
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableViewOnCategoryPageTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableViewOnCategoryPageTest.php
index 94aa958b44c26..d577994cdc45b 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableViewOnCategoryPageTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableViewOnCategoryPageTest.php
@@ -36,7 +36,7 @@ class ConfigurableViewOnCategoryPageTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableViewOnProductPageTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableViewOnProductPageTest.php
index 21ba9d2764b91..86788e4c35c75 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableViewOnProductPageTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/ConfigurableViewOnProductPageTest.php
@@ -55,7 +55,7 @@ class ConfigurableViewOnProductPageTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/MultiStoreConfigurableViewOnProductPageTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/MultiStoreConfigurableViewOnProductPageTest.php
index c1adf0ef1d2be..3a6052da3964f 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/MultiStoreConfigurableViewOnProductPageTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/MultiStoreConfigurableViewOnProductPageTest.php
@@ -50,7 +50,7 @@ class MultiStoreConfigurableViewOnProductPageTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/RenderConfigurableOptionsTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/RenderConfigurableOptionsTest.php
index 6a8dea32be620..bfe2de2d90e9c 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/RenderConfigurableOptionsTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Block/Product/View/Type/RenderConfigurableOptionsTest.php
@@ -65,7 +65,7 @@ class RenderConfigurableOptionsTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->configurableHelper = $this->objectManager->get(Data::class);
@@ -100,7 +100,7 @@ public function testRenderConfigurableOptionsBlockWithOneVisibleOption(): void
$this->json->serialize($confAttrData['attributes'])
);
$optionsHtml = $this->getConfigurableOptionsHtml('Configurable product');
- $this->assertRegExp("/\"spConfig\": {\"attributes\":{$attributesJson}/", $optionsHtml);
+ $this->assertMatchesRegularExpression("/\"spConfig\": {\"attributes\":{$attributesJson}/", $optionsHtml);
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/HelperTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/HelperTest.php
index ba684f37175e4..0f409b0ee4ee2 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/HelperTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/HelperTest.php
@@ -91,7 +91,7 @@ class HelperTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->objectManager = Bootstrap::getObjectManager();
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/ProductTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/ProductTest.php
index 833100e3e4740..f5e165734dda5 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/ProductTest.php
@@ -17,7 +17,6 @@
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
use Magento\Eav\Model\Config;
use Magento\Framework\App\Request\Http as HttpRequest;
-use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Message\MessageInterface;
use Magento\Framework\Registry;
use Magento\Framework\Serialize\SerializerInterface;
@@ -60,7 +59,7 @@ class ProductTest extends AbstractBackendController
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
$this->productRepository = $this->_objectManager->get(ProductRepositoryInterface::class);
@@ -120,7 +119,7 @@ public function saveNewProductDataProvider(): array
'simple_1' => [
'name' => 'simple_1',
'sku' => 'simple_1',
- 'price' => '200',
+ 'price' => 200,
'weight' => '1',
'qty' => '100',
'attributes' => ['test_configurable' => 'Option 1'],
@@ -128,7 +127,7 @@ public function saveNewProductDataProvider(): array
'simple_2' => [
'name' => 'simple_2',
'sku' => 'simple_2',
- 'price' => '100',
+ 'price' => 100,
'weight' => '1',
'qty' => '200',
'attributes' => ['test_configurable' => 'Option 2'],
@@ -140,14 +139,14 @@ public function saveNewProductDataProvider(): array
'simple_1' => [
'name' => 'simple_1',
'sku' => 'simple_1',
- 'price' => '100',
+ 'price' => 100,
'qty' => '100',
'attributes' => ['test_configurable' => 'Option 1'],
],
'simple_2' => [
'name' => 'simple_2',
'sku' => 'simple_2',
- 'price' => '100',
+ 'price' => 100,
'qty' => '100',
'attributes' => ['test_configurable' => 'Option 2'],
],
@@ -189,7 +188,7 @@ public function saveExistProductDataProvider(): array
'simple_2' => [
'name' => 'simple_2',
'sku' => 'simple_2',
- 'price' => '100',
+ 'price' => 100,
'weight' => '1',
'qty' => '200',
'attributes' => ['test_configurable' => 'Option 2'],
@@ -202,7 +201,7 @@ public function saveExistProductDataProvider(): array
'simple_2' => [
'name' => 'simple_2',
'sku' => 'simple_2',
- 'price' => '100',
+ 'price' => 100,
'qty' => '100',
'attributes' => ['test_configurable' => 'Option 2'],
],
@@ -218,7 +217,7 @@ public function saveExistProductDataProvider(): array
'simple_1_1' => [
'name' => 'simple_1_1',
'sku' => 'simple_1_1',
- 'price' => '100',
+ 'price' => 100,
'weight' => '1',
'qty' => '200',
'attributes' => [
@@ -229,7 +228,7 @@ public function saveExistProductDataProvider(): array
'simple_1_2' => [
'name' => 'simple_1_2',
'sku' => 'simple_1_2',
- 'price' => '100',
+ 'price' => 100,
'weight' => '1',
'qty' => '200',
'attributes' => [
@@ -245,14 +244,14 @@ public function saveExistProductDataProvider(): array
'simple_2_1' => [
'name' => 'simple_2_1',
'sku' => 'simple_2_1',
- 'price' => '100',
+ 'price' => 100,
'qty' => '100',
'attributes' => ['test_configurable_2' => 'Option 1'],
],
'simple_2_2' => [
'name' => 'simple_2_2',
'sku' => 'simple_2_2',
- 'price' => '100',
+ 'price' => 100,
'qty' => '100',
'attributes' => ['test_configurable_2' => 'Option 2'],
],
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Category/ProductIndexerTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Category/ProductIndexerTest.php
index 203a3fb45bea2..b6a416206a57f 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Category/ProductIndexerTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Category/ProductIndexerTest.php
@@ -37,7 +37,7 @@ class ProductIndexerTest extends \PHPUnit\Framework\TestCase
*/
private $categoryRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->indexer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Indexer\Model\Indexer::class
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/FindByUrlRewriteTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/FindByUrlRewriteTest.php
index 23ab905fa0eab..bad9c7a51bdbd 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/FindByUrlRewriteTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/FindByUrlRewriteTest.php
@@ -46,7 +46,7 @@ class FindByUrlRewriteTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManger = Bootstrap::getObjectManager();
$this->productResource = $this->objectManger->get(ProductResource::class);
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/SaveHandlerTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/SaveHandlerTest.php
index 70cc0136cfb1c..a367d1aee7ad4 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/SaveHandlerTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/SaveHandlerTest.php
@@ -45,7 +45,7 @@ class SaveHandlerTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class);
$this->product = $this->productRepository->get('configurable');
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/AttributeTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/AttributeTest.php
index 9ced06dac8745..5b049420fc2a4 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/AttributeTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/AttributeTest.php
@@ -12,7 +12,7 @@ class AttributeTest extends \PHPUnit\Framework\TestCase
*/
protected $_model;
- protected function setUp()
+ protected function setUp(): void
{
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php
index 6f491b33a3496..52bb7a2f8ab6d 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php
@@ -52,7 +52,7 @@ class PriceTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->priceModel = $this->objectManager->create(Price::class);
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/SalableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/SalableTest.php
index 33c82dce21963..98512954dcda0 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/SalableTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/SalableTest.php
@@ -30,7 +30,7 @@ class SalableTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php
index 0d2043434d359..108230e0d4908 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php
@@ -37,7 +37,7 @@ class ConfigurableTest extends \PHPUnit\Framework\TestCase
*/
private $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->productRepository = Bootstrap::getObjectManager()
->create(ProductRepositoryInterface::class);
@@ -236,7 +236,7 @@ public function testGetConfigurableAttributeCollection()
public function testGetUsedProductIds()
{
$ids = $this->model->getUsedProductIds($this->product);
- $this->assertInternalType('array', $ids);
+ $this->assertIsArray($ids);
$this->assertTrue(2 === count($ids)); // impossible to check actual IDs, they are dynamic in the fixture
}
@@ -247,7 +247,7 @@ public function testGetUsedProductIds()
public function testGetUsedProducts()
{
$products = $this->model->getUsedProducts($this->product);
- $this->assertInternalType('array', $products);
+ $this->assertIsArray($products);
$this->assertTrue(2 === count($products));
foreach ($products as $product) {
$this->assertInstanceOf(\Magento\Catalog\Model\Product::class, $product);
@@ -418,7 +418,7 @@ public function testPrepareForCart()
['qty' => 5, 'super_attribute' => [$attribute['attribute_id'] => $optionValueId]]
);
$result = $this->model->prepareForCart($buyRequest, $this->product);
- $this->assertInternalType('array', $result);
+ $this->assertIsArray($result);
$this->assertTrue(2 === count($result));
foreach ($result as $product) {
$this->assertInstanceOf(\Magento\Catalog\Model\Product::class, $product);
@@ -514,7 +514,7 @@ public function testGetProductsToPurchaseByReqGroups()
{
$result = $this->model->getProductsToPurchaseByReqGroups($this->product);
$this->assertArrayHasKey(0, $result);
- $this->assertInternalType('array', $result[0]);
+ $this->assertIsArray($result[0]);
$this->assertTrue(2 === count($result[0]));
// fixture has 2 simple products
foreach ($result[0] as $product) {
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php
index c3b845694c6a0..beab52c142402 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php
@@ -51,7 +51,7 @@ class VariationHandlerTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
@@ -75,7 +75,7 @@ public function testGenerateSimpleProducts(array $productsData): void
->setSwatchImage('some_test_image.jpg')
->setNewVariationsAttributeSetId($this->product->getDefaultAttributeSetId());
$generatedProducts = $this->variationHandler->generateSimpleProducts($this->product, $productsData);
- $this->assertEquals(3, count($generatedProducts));
+ $this->assertCount(3, $generatedProducts);
foreach ($generatedProducts as $productId) {
$stockItem = $this->stockRegistry->getStockItem($productId);
$product = $this->productRepository->getById($productId);
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/QuickSearchTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/QuickSearchTest.php
index 701fb2c17d966..a0d380023e02f 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/QuickSearchTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/QuickSearchTest.php
@@ -44,7 +44,7 @@ class QuickSearchTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = Bootstrap::getObjectManager();
$this->quickSearchByQuery = $this->objectManager->get(QuickSearchByQuery::class);
@@ -55,8 +55,6 @@ protected function setUp()
/**
* Assert that configurable child products has not found by query using mysql search engine.
*
- * @magentoConfigFixture default/catalog/search/engine mysql
- *
* @return void
*/
public function testChildProductsHasNotFoundedByQuery(): void
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php
index 8add544881c76..7bcb1dcc11a82 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php
@@ -26,7 +26,7 @@ class LowestPriceOptionProviderTest extends \PHPUnit\Framework\TestCase
*/
private $productRepository;
- protected function setUp()
+ protected function setUp(): void
{
$this->storeManager = Bootstrap::getObjectManager()->get(StoreManagerInterface::class);
$this->productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerTest.php
index dc5c07ad8dc2c..33345fd2006d9 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerTest.php
@@ -30,7 +30,7 @@ class SpecialPriceIndexerTest extends \PHPUnit\Framework\TestCase
*/
private $indexerProcessor;
- protected function setUp()
+ protected function setUp(): void
{
$this->productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
$this->productCollectionFactory = Bootstrap::getObjectManager()->get(CollectionFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerWithDimensionTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerWithDimensionTest.php
index 578cb47d14676..6a37f287155d4 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerWithDimensionTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerWithDimensionTest.php
@@ -40,7 +40,7 @@ class SpecialPriceIndexerWithDimensionTest extends \PHPUnit\Framework\TestCase
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
$this->productCollectionFactory = Bootstrap::getObjectManager()->get(CollectionFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceTest.php
index 7edcf55f572f5..71f458d7dad2d 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceTest.php
@@ -26,7 +26,7 @@ class SpecialPriceTest extends \PHPUnit\Framework\TestCase
*/
private $productCollectionFactory;
- protected function setUp()
+ protected function setUp(): void
{
$this->productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
$this->productCollectionFactory = Bootstrap::getObjectManager()->get(CollectionFactory::class);
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php
index 0e191f4a90147..c523f4bf844e2 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php
@@ -39,7 +39,7 @@ class RenderingBasedOnIsProductListFlagTest extends \PHPUnit\Framework\TestCase
*/
private $finalPriceBox;
- protected function setUp()
+ protected function setUp(): void
{
$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
$this->product = $productRepository->get('configurable');
@@ -80,7 +80,7 @@ protected function setUp()
public function testRenderingByDefault()
{
$html = $this->finalPriceBox->toHtml();
- self::assertContains('5.99', $html);
+ self::assertStringContainsString('5.99', $html);
$this->assertGreaterThanOrEqual(
1,
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
@@ -116,7 +116,7 @@ public function testRenderingAccordingToIsProductListFlag($flag, $count)
{
$this->finalPriceBox->setData('is_product_list', $flag);
$html = $this->finalPriceBox->toHtml();
- self::assertContains('5.99', $html);
+ self::assertStringContainsString('5.99', $html);
$this->assertEquals(
1,
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagWithDimensionTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagWithDimensionTest.php
index b2e4fe6af3243..857a9ed290ca1 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagWithDimensionTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagWithDimensionTest.php
@@ -47,7 +47,7 @@ class RenderingBasedOnIsProductListFlagWithDimensionTest extends \PHPUnit\Framew
/**
* Set up
*/
- protected function setUp()
+ protected function setUp(): void
{
$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
$this->product = $productRepository->get('configurable');
@@ -88,7 +88,7 @@ protected function setUp()
public function testRenderingByDefault()
{
$html = $this->finalPriceBox->toHtml();
- self::assertContains('5.99', $html);
+ self::assertStringContainsString('5.99', $html);
$this->assertGreaterThanOrEqual(
1,
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
@@ -124,7 +124,7 @@ public function testRenderingAccordingToIsProductListFlag($flag, $count)
{
$this->finalPriceBox->setData('is_product_list', $flag);
$html = $this->finalPriceBox->toHtml();
- self::assertContains('5.99', $html);
+ self::assertStringContainsString('5.99', $html);
$this->assertEquals(
1,
\Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php
index 676433c0a1e6c..ea96514ebde32 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php
@@ -13,7 +13,7 @@
use PHPUnit\Framework\TestCase;
/**
- * AssociatedProductsTest
+ * Test verifies modifier for configurable associated product
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
@@ -32,7 +32,7 @@ class AssociatedProductsTest extends TestCase
/**
* @inheritdoc
*/
- public function setUp(): void
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->registry = $this->objectManager->get(\Magento\Framework\Registry::class);
@@ -48,8 +48,8 @@ public function testGetProductMatrix($interfaceLocale)
{
$productSku = 'configurable';
$associatedProductsData = [
- [10 => '10.000'],
- [20 => '20.000']
+ [10 => '10.000000'],
+ [20 => '20.000000']
];
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
$productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
@@ -58,7 +58,7 @@ public function testGetProductMatrix($interfaceLocale)
$store = $this->objectManager->create(\Magento\Store\Model\Store::class);
$store->load('admin');
$this->registry->register('current_store', $store);
- /** @var \Magento\Framework\Locale\ResolverInterface|\PHPUnit_Framework_MockObject_MockObject $localeResolver */
+ /** @var \Magento\Framework\Locale\ResolverInterface|\PHPUnit\Framework\MockObject\MockObject $localeResolver */
$localeResolver = $this->getMockBuilder(\Magento\Framework\Locale\ResolverInterface::class)
->setMethods(['getLocale'])
->getMockForAbstractClass();
diff --git a/dev/tests/integration/testsuite/Magento/Contact/Controller/IndexTest.php b/dev/tests/integration/testsuite/Magento/Contact/Controller/IndexTest.php
index c1255ae9b1aad..ff39ffa5bf174 100644
--- a/dev/tests/integration/testsuite/Magento/Contact/Controller/IndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/Contact/Controller/IndexTest.php
@@ -29,7 +29,7 @@ public function testPostAction()
$this->dispatch('contact/index/post');
$this->assertRedirect($this->stringContains('contact/index'));
$this->assertSessionMessages(
- $this->contains(
+ $this->containsEqual(
"Thanks for contacting us with your comments and questions. We'll respond to you very soon."
),
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
@@ -51,7 +51,7 @@ public function testInvalidPostAction($params, $expectedMessage)
$this->dispatch('contact/index/post');
$this->assertRedirect($this->stringContains('contact/index'));
$this->assertSessionMessages(
- $this->contains($expectedMessage),
+ $this->containsEqual($expectedMessage),
\Magento\Framework\Message\MessageInterface::TYPE_ERROR
);
}
diff --git a/dev/tests/integration/testsuite/Magento/Contact/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/Contact/Helper/DataTest.php
index 9e0c7e3e1f1da..5b42f63d29acb 100644
--- a/dev/tests/integration/testsuite/Magento/Contact/Helper/DataTest.php
+++ b/dev/tests/integration/testsuite/Magento/Contact/Helper/DataTest.php
@@ -28,7 +28,7 @@ class DataTest extends \PHPUnit\Framework\TestCase
/**
* Setup customer data
*/
- protected function setUp()
+ protected function setUp(): void
{
$customerIdFromFixture = 1;
$this->contactsHelper = Bootstrap::getObjectManager()->create(\Magento\Contact\Helper\Data::class);
diff --git a/dev/tests/integration/testsuite/Magento/Contact/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Contact/Model/ConfigTest.php
index 5b2e8dad459d1..9ce5e41cbee2a 100644
--- a/dev/tests/integration/testsuite/Magento/Contact/Model/ConfigTest.php
+++ b/dev/tests/integration/testsuite/Magento/Contact/Model/ConfigTest.php
@@ -15,7 +15,7 @@ class ConfigTest extends \PHPUnit\Framework\TestCase
*/
private $configModel;
- protected function setUp()
+ protected function setUp(): void
{
$this->configModel = Bootstrap::getObjectManager()->create(\Magento\Contact\Model\ConfigInterface::class);
}
diff --git a/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/DomainTest.php b/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/DomainTest.php
index d2b68ea76b4e1..392bb9f7f1bad 100644
--- a/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/DomainTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/DomainTest.php
@@ -36,7 +36,7 @@ public function testBeforeSave($value, $exceptionMessage = null)
$this->assertNotNull($domain->getId());
}
} catch (LocalizedException $e) {
- $this->assertContains('Invalid domain name: ', $e->getMessage());
+ $this->assertStringContainsString('Invalid domain name: ', $e->getMessage());
$this->assertEquals($exceptionMessage, $e->getMessage());
$this->assertNull($domain->getId());
}
diff --git a/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/LifetimeTest.php b/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/LifetimeTest.php
index ed1884c1aa8ad..6f29890f3941c 100644
--- a/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/LifetimeTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/LifetimeTest.php
@@ -12,11 +12,12 @@ class LifetimeTest extends \PHPUnit\Framework\TestCase
/**
* Method is not publicly accessible, so it must be called through parent
*
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage Invalid cookie lifetime: must be numeric
*/
public function testBeforeSaveException()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('Invalid cookie lifetime: must be numeric');
+
$invalidCookieLifetime = 'invalid lifetime';
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Cookie\Model\Config\Backend\Lifetime $model */
diff --git a/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/PathTest.php b/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/PathTest.php
index 57bcb997d63f8..bac566f0067d4 100644
--- a/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/PathTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cookie/Model/Config/Backend/PathTest.php
@@ -12,11 +12,12 @@ class PathTest extends \PHPUnit\Framework\TestCase
/**
* Method is not publicly accessible, so it must be called through parent
*
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage Invalid cookie path
*/
public function testBeforeSaveException()
{
+ $this->expectException(\Magento\Framework\Exception\LocalizedException::class);
+ $this->expectExceptionMessage('Invalid cookie path');
+
$invalidPath = 'invalid path';
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Cookie\Model\Config\Backend\Lifetime $model */
diff --git a/dev/tests/integration/testsuite/Magento/Cron/Model/ScheduleTest.php b/dev/tests/integration/testsuite/Magento/Cron/Model/ScheduleTest.php
index 7b64eb36050f6..8df0974c4175e 100644
--- a/dev/tests/integration/testsuite/Magento/Cron/Model/ScheduleTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cron/Model/ScheduleTest.php
@@ -25,7 +25,7 @@ class ScheduleTest extends \PHPUnit\Framework\TestCase
*/
protected $dateTime;
- public function setUp()
+ protected function setUp(): void
{
$this->dateTime = Bootstrap::getObjectManager()->create(DateTime::class);
$this->scheduleFactory = Bootstrap::getObjectManager()->create(ScheduleFactory::class);
@@ -76,14 +76,14 @@ public function testTryLockJobAlreadyLockedSucceeds()
}
/**
- * If there's a job already locked, should not be able to lock another job
+ * If there's a job already has running status, should be able to set this status for another job
*/
public function testTryLockJobOtherLockedFails()
{
$this->createSchedule("test_job", Schedule::STATUS_RUNNING);
$schedule = $this->createSchedule("test_job", Schedule::STATUS_PENDING, 60);
- $this->assertFalse($schedule->tryLockJob());
+ $this->assertTrue($schedule->tryLockJob());
}
/**
diff --git a/dev/tests/integration/testsuite/Magento/Cron/Observer/ProcessCronQueueObserverTest.php b/dev/tests/integration/testsuite/Magento/Cron/Observer/ProcessCronQueueObserverTest.php
index 99be1bcbae379..4ca8ab53ffbad 100644
--- a/dev/tests/integration/testsuite/Magento/Cron/Observer/ProcessCronQueueObserverTest.php
+++ b/dev/tests/integration/testsuite/Magento/Cron/Observer/ProcessCronQueueObserverTest.php
@@ -14,7 +14,7 @@ class ProcessCronQueueObserverTest extends \PHPUnit\Framework\TestCase
*/
private $_model = null;
- protected function setUp()
+ protected function setUp(): void
{
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\App\AreaList::class)
->getArea('crontab')
diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php
index 6d8876012df1e..e88d5d723ef46 100644
--- a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php
+++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php
@@ -28,7 +28,7 @@ class ConfigCollectorTest extends TestCase
/**
* @inheritDoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->collector = Bootstrap::getObjectManager()->get(ConfigCollector::class);
}
diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php
index bbaabba9dd268..453d7bd0947af 100644
--- a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php
+++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php
@@ -24,7 +24,7 @@ class CspWhitelistXmlCollectorTest extends TestCase
/**
* @inheritDoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->collector = Bootstrap::getObjectManager()->get(CspWhitelistXmlCollector::class);
}
diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Mode/ConfigManagerTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Mode/ConfigManagerTest.php
index 44790ef9dbc94..2906e5cd61ccd 100644
--- a/dev/tests/integration/testsuite/Magento/Csp/Model/Mode/ConfigManagerTest.php
+++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Mode/ConfigManagerTest.php
@@ -23,7 +23,7 @@ class ConfigManagerTest extends TestCase
/**
* @inheritDoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->manager = Bootstrap::getObjectManager()->get(ConfigManager::class);
}
diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php
index 93e7833038a42..e9e9ed99ecd7c 100644
--- a/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php
+++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php
@@ -30,7 +30,7 @@ class SimplePolicyHeaderRendererTest extends TestCase
/**
* @inheritDoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->renderer = Bootstrap::getObjectManager()->get(SimplePolicyHeaderRenderer::class);
$this->response = Bootstrap::getObjectManager()->create(HttpResponse::class);
diff --git a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/FetchRatesTest.php b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/FetchRatesTest.php
index 15111b27783d9..b4dc4ef53c87a 100644
--- a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/FetchRatesTest.php
+++ b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/FetchRatesTest.php
@@ -9,7 +9,7 @@
use Magento\Framework\Escaper;
/**
- * Fetch Rates Test
+ * Test for fetchRates action
*/
class FetchRatesTest extends \Magento\TestFramework\TestCase\AbstractBackendController
{
@@ -21,7 +21,7 @@ class FetchRatesTest extends \Magento\TestFramework\TestCase\AbstractBackendCont
/**
* Initial setup
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->escaper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
Escaper::class
@@ -45,7 +45,7 @@ public function testFetchRatesActionWithoutService(): void
$this->dispatch('backend/admin/system_currency/fetchRates');
$this->assertSessionMessages(
- $this->contains('The Import Service is incorrect. Verify the service and try again.'),
+ $this->containsEqual('The Import Service is incorrect. Verify the service and try again.'),
\Magento\Framework\Message\MessageInterface::TYPE_ERROR
);
}
@@ -65,7 +65,7 @@ public function testFetchRatesActionWithNonexistentService(): void
$this->dispatch('backend/admin/system_currency/fetchRates');
$this->assertSessionMessages(
- $this->contains(
+ $this->containsEqual(
$this->escaper->escapeHtml(
"The import model can't be initialized. Verify the model and try again."
)
diff --git a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/IndexTest.php b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/IndexTest.php
index 10207c28c9679..3ef210faea462 100644
--- a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/IndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/IndexTest.php
@@ -33,8 +33,8 @@ public function testIndexAction()
$this->dispatch('backend/admin/system_currency/index');
$this->getResponse()->isSuccess();
$body = $this->getResponse()->getBody();
- $this->assertContains('id="rate-form"', $body);
- $this->assertContains('save primary save-currency-rates', $body);
- $this->assertContains('data-ui-id="page-actions-toolbar-reset-button"', $body);
+ $this->assertStringContainsString('id="rate-form"', $body);
+ $this->assertStringContainsString('save primary save-currency-rates', $body);
+ $this->assertStringContainsString('data-ui-id="page-actions-toolbar-reset-button"', $body);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRatesTest.php b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRatesTest.php
index 536aadd190c0e..af769eb4cdb04 100644
--- a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRatesTest.php
+++ b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRatesTest.php
@@ -23,7 +23,7 @@ class SaveRatesTest extends \Magento\TestFramework\TestCase\AbstractBackendContr
/**
* Initial setup
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->currencyRate = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
\Magento\Directory\Model\Currency::class
@@ -35,15 +35,6 @@ protected function setUp()
parent::setUp();
}
- /**
- * Tear down
- */
- protected function tearDown()
- {
- $this->_model = null;
- parent::tearDown();
- }
-
/**
* Test save action
*
@@ -66,7 +57,7 @@ public function testSaveAction()
$this->dispatch('backend/admin/system_currency/saveRates');
$this->assertSessionMessages(
- $this->contains((string)__('All valid rates have been saved.')),
+ $this->containsEqual((string)__('All valid rates have been saved.')),
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
);
@@ -99,7 +90,7 @@ public function testSaveWithWarningAction()
$this->dispatch('backend/admin/system_currency/saveRates');
$this->assertSessionMessages(
- $this->contains(
+ $this->containsEqual(
$this->escaper->escapeHtml(
(string)__('Please correct the input data for "%1 => %2" rate.', $currencyCode, $currencyTo)
)
diff --git a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/IndexTest.php b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/IndexTest.php
index b893850e1988f..22e02f15dcbed 100644
--- a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/IndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/IndexTest.php
@@ -19,8 +19,8 @@ public function testIndexAction()
$this->dispatch('backend/admin/system_currencysymbol/index');
$body = $this->getResponse()->getBody();
- $this->assertContains('id="currency-symbols-form"', $body);
- $this->assertContains('assertContains('save primary save-currency-symbols', $body);
+ $this->assertStringContainsString('id="currency-symbols-form"', $body);
+ $this->assertStringContainsString('assertStringContainsString('save primary save-currency-symbols', $body);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Model/System/CurrencysymbolTest.php b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Model/System/CurrencysymbolTest.php
index 15f3e7a570538..352f473b85193 100644
--- a/dev/tests/integration/testsuite/Magento/CurrencySymbol/Model/System/CurrencysymbolTest.php
+++ b/dev/tests/integration/testsuite/Magento/CurrencySymbol/Model/System/CurrencysymbolTest.php
@@ -20,14 +20,14 @@ class CurrencysymbolTest extends \PHPUnit\Framework\TestCase
*/
protected $currencySymbolModel;
- protected function setUp()
+ protected function setUp(): void
{
$this->currencySymbolModel = Bootstrap::getObjectManager()->create(
\Magento\CurrencySymbol\Model\System\Currencysymbol::class
);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->currencySymbolModel = null;
Bootstrap::getObjectManager()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class)->reinit();
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Api/AddressRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Customer/Api/AddressRepositoryTest.php
index cf6e82639767e..1ac6caa3aae9a 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Api/AddressRepositoryTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Api/AddressRepositoryTest.php
@@ -33,7 +33,7 @@ class AddressRepositoryTest extends \PHPUnit\Framework\TestCase
/** @var \Magento\Framework\Api\DataObjectHelper */
protected $dataObjectHelper;
- protected function setUp()
+ protected function setUp(): void
{
$this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->repository = $this->_objectManager->create(\Magento\Customer\Api\AddressRepositoryInterface::class);
@@ -78,7 +78,7 @@ protected function setUp()
$this->_expectedAddresses = [$address, $address2];
}
- protected function tearDown()
+ protected function tearDown(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */
@@ -111,11 +111,12 @@ public function testSaveAddressChanges()
* @magentoDataFixture Magento/Customer/_files/customer_address.php
* @magentoDataFixture Magento/Customer/_files/customer_two_addresses.php
* @magentoAppIsolation enabled
- * @expectedException \Magento\Framework\Exception\NoSuchEntityException
- * @expectedExceptionMessage No such entity with addressId = 4200
*/
public function testSaveAddressesIdSetButNotAlreadyExisting()
{
+ $this->expectException(\Magento\Framework\Exception\NoSuchEntityException::class);
+ $this->expectExceptionMessage('No such entity with addressId = 4200');
+
$proposedAddress = $this->_createSecondAddress()->setId(4200);
$this->repository->save($proposedAddress);
}
@@ -135,11 +136,12 @@ public function testGetAddressById()
/**
* @magentoDataFixture Magento/Customer/_files/customer.php
- * @expectedException \Magento\Framework\Exception\NoSuchEntityException
- * @expectedExceptionMessage No such entity with addressId = 12345
*/
public function testGetAddressByIdBadAddressId()
{
+ $this->expectException(\Magento\Framework\Exception\NoSuchEntityException::class);
+ $this->expectExceptionMessage('No such entity with addressId = 12345');
+
$this->repository->getById(12345);
}
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php
index c5b76807f1ff9..3bf7204c2174d 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php
@@ -27,7 +27,7 @@ class AddressTest extends \PHPUnit\Framework\TestCase
*/
protected $objectManager;
- protected function setUp()
+ protected function setUp(): void
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->_customerSession = $this->objectManager->get(\Magento\Customer\Model\Session::class);
@@ -40,7 +40,7 @@ protected function setUp()
$this->objectManager->get(\Magento\Framework\App\ViewInterface::class)->setIsLayoutLoaded(true);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$this->_customerSession->unsCustomerId();
/** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/InfoTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/InfoTest.php
index c8c67bd51a8c7..2aaff151ba69e 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/InfoTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/InfoTest.php
@@ -12,7 +12,7 @@ class InfoTest extends \PHPUnit\Framework\TestCase
*/
protected $_block;
- protected function setUp()
+ protected function setUp(): void
{
$this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Framework\View\LayoutInterface::class
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/DashboardTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/DashboardTest.php
index f66561d4ee869..f5044ef1712ee 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/DashboardTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/DashboardTest.php
@@ -21,7 +21,7 @@ class DashboardTest extends \PHPUnit\Framework\TestCase
/**
* Execute per test initialization.
*/
- public function setUp()
+ protected function setUp(): void
{
$this->customerSession = Bootstrap::getObjectManager()->get(\Magento\Customer\Model\Session::class);
$this->customerRepository = Bootstrap::getObjectManager()->get(
@@ -43,7 +43,7 @@ public function setUp()
/**
* Execute per test cleanup.
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->customerSession->setCustomerId(null);
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/ResetPasswordTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/ResetPasswordTest.php
index cc087e006025d..80d77a3f90b1c 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/ResetPasswordTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/ResetPasswordTest.php
@@ -43,7 +43,7 @@ class ResetPasswordTest extends TestCase
/**
* @inheritdoc
*/
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/BookTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/BookTest.php
index 1ef7d54c5aa78..23ab7ebd689c6 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/BookTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/BookTest.php
@@ -20,9 +20,9 @@ class BookTest extends \PHPUnit\Framework\TestCase
*/
protected $currentCustomer;
- protected function setUp()
+ protected function setUp(): void
{
- /** @var \PHPUnit_Framework_MockObject_MockObject $blockMock */
+ /** @var \PHPUnit\Framework\MockObject\MockObject $blockMock */
$blockMock = $this->getMockBuilder(
\Magento\Framework\View\Element\BlockInterface::class
)->disableOriginalConstructor()->setMethods(
@@ -43,7 +43,7 @@ protected function setUp()
);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php
index edc5acdbdb70e..9c382068ceebc 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/EditTest.php
@@ -22,7 +22,7 @@ class EditTest extends \PHPUnit\Framework\TestCase
/** @var string */
protected $_requestId;
- protected function setUp()
+ protected function setUp(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -48,7 +48,7 @@ protected function setUp()
);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$this->_customerSession->setCustomerId(null);
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/GridTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/GridTest.php
index ac11c6c08bd62..dea1829a3d92f 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/GridTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/GridTest.php
@@ -24,9 +24,9 @@ class GridTest extends \PHPUnit\Framework\TestCase
*/
protected $currentCustomer;
- protected function setUp()
+ protected function setUp(): void
{
- /** @var \PHPUnit_Framework_MockObject_MockObject $blockMock */
+ /** @var \PHPUnit\Framework\MockObject\MockObject $blockMock */
$blockMock = $this->getMockBuilder(
\Magento\Framework\View\Element\BlockInterface::class
)->disableOriginalConstructor()->setMethods(
@@ -40,7 +40,7 @@ protected function setUp()
$this->layout->setBlock('head', $blockMock);
}
- protected function tearDown()
+ protected function tearDown(): void
{
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
/** @var \Magento\Customer\Model\CustomerRegistry $customerRegistry */
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/Renderer/DefaultRendererTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/Renderer/DefaultRendererTest.php
index 9a9433e6812f7..861820fa20eb4 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Block/Address/Renderer/DefaultRendererTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Address/Renderer/DefaultRendererTest.php
@@ -17,7 +17,7 @@ class DefaultRendererTest extends \PHPUnit\Framework\TestCase
*/
protected $_addressConfig;
- public function setUp()
+ protected function setUp(): void
{
$this->_addressConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
\Magento\Customer\Model\Address\Config::class
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/CartTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/CartTest.php
index 34e28838d0e0d..b5abf1de5732b 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/CartTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/CartTest.php
@@ -51,7 +51,7 @@ class CartTest extends \PHPUnit\Framework\TestCase
/**
* @inheritdoc
*/
- public function setUp()
+ protected function setUp(): void
{
$this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -76,7 +76,7 @@ public function setUp()
/**
* @inheritdoc
*/
- public function tearDown()
+ protected function tearDown(): void
{
$this->_coreRegistry->unregister(RegistryConstants::CURRENT_CUSTOMER_ID);
}
@@ -104,12 +104,12 @@ public function testVerifyCollectionWithQuote(int $customerId, bool $guest, bool
->save();
$this->_block->toHtml();
if ($contains) {
- $this->assertContains(
+ $this->assertStringContainsString(
"We couldn't find any records",
$this->_block->getGridParentHtml()
);
} else {
- $this->assertNotContains(
+ $this->assertStringNotContainsString(
"We couldn't find any records",
$this->_block->getGridParentHtml()
);
@@ -154,7 +154,7 @@ public function testGetCustomerId(): void
*/
public function testGetGridUrl(): void
{
- $this->assertContains('/backend/customer/index/cart', $this->_block->getGridUrl());
+ $this->assertStringContainsString('/backend/customer/index/cart', $this->_block->getGridUrl());
}
/**
@@ -175,7 +175,7 @@ public function testGetGridParentHtml(): void
->disableOriginalConstructor()
->getMock();
$this->_block->setCollection($mockCollection);
- $this->assertContains(
+ $this->assertStringContainsString(
" |