Skip to content

Commit 0cbca31

Browse files
author
Stanislav Idolov
committed
MAGETWO-51858: Convert literal class names to \Namespace\Classname::class
1 parent e0e5098 commit 0cbca31

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ private function getProductCategoryLink()
641641
{
642642
if (null === $this->productCategoryLink) {
643643
$this->productCategoryLink = \Magento\Framework\App\ObjectManager::getInstance()
644-
->get('Magento\Catalog\Model\ResourceModel\Product\CategoryLink');
644+
->get(\Magento\Catalog\Model\ResourceModel\Product\CategoryLink::class);
645645
}
646646
return $this->productCategoryLink;
647647
}

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CategoryLinkTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ class CategoryLinkTest extends \PHPUnit_Framework_TestCase
3737

3838
protected function setUp()
3939
{
40-
$this->resourceMock = $this->getMockBuilder('Magento\Framework\App\ResourceConnection')
40+
$this->resourceMock = $this->getMockBuilder(\Magento\Framework\App\ResourceConnection::class)
4141
->disableOriginalConstructor()
4242
->getMock();
43-
$this->metadataPoolMock = $this->getMockBuilder('Magento\Framework\EntityManager\MetadataPool')
43+
$this->metadataPoolMock = $this->getMockBuilder(\Magento\Framework\EntityManager\MetadataPool::class)
4444
->disableOriginalConstructor()
4545
->getMock();
4646

@@ -52,10 +52,10 @@ protected function setUp()
5252

5353
private function prepareAdapter()
5454
{
55-
$this->dbSelectMock = $this->getMockBuilder('Magento\Framework\DB\Select')
55+
$this->dbSelectMock = $this->getMockBuilder(\Magento\Framework\DB\Select::class)
5656
->disableOriginalConstructor()
5757
->getMock();
58-
$this->connectionMock = $this->getMockBuilder('Magento\Framework\DB\Adapter\AdapterInterface')
58+
$this->connectionMock = $this->getMockBuilder(\Magento\Framework\DB\Adapter\AdapterInterface::class)
5959
->getMockForAbstractClass();
6060
$this->connectionMock->expects($this->any())->method('select')->willReturn($this->dbSelectMock);
6161
$this->resourceMock->expects($this->any())
@@ -65,10 +65,10 @@ private function prepareAdapter()
6565

6666
private function prepareMetadata()
6767
{
68-
$categoryLinkMetadata = $this->getMockBuilder('Magento\Framework\EntityManager\EntityMetadataInterface')
68+
$categoryLinkMetadata = $this->getMockBuilder(\Magento\Framework\EntityManager\EntityMetadataInterface::class)
6969
->getMockForAbstractClass();
7070
$categoryLinkMetadata->expects($this->any())->method('getEntityTable')->willReturn('category_link_table');
71-
$categoryEntityMetadata = $this->getMockBuilder('Magento\Framework\EntityManager\EntityMetadataInterface')
71+
$categoryEntityMetadata = $this->getMockBuilder(\Magento\Framework\EntityManager\EntityMetadataInterface::class)
7272
->getMockForAbstractClass();
7373
$categoryEntityMetadata->expects($this->any())->method('getEntityTable')->willReturn('category_entity_table');
7474
$this->metadataPoolMock->expects($this->any())->method('getMetadata')->willReturnMap(
@@ -83,7 +83,7 @@ public function testGetCategoryLinks()
8383
{
8484
$this->prepareAdapter();
8585
$this->prepareMetadata();
86-
$product = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductInterface')->getMockForAbstractClass();
86+
$product = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductInterface::class)->getMockForAbstractClass();
8787
$product->expects($this->any())->method('getId')->willReturn(1);
8888
$this->connectionMock->expects($this->once())->method('fetchAll')->with($this->dbSelectMock)->willReturn(
8989
[
@@ -111,7 +111,7 @@ public function testSaveCategoryLinks($newCategoryLinks, $dbCategoryLinks, $affe
111111
{
112112
$this->prepareAdapter();
113113
$this->prepareMetadata();
114-
$product = $this->getMockBuilder('Magento\Catalog\Api\Data\ProductInterface')->getMockForAbstractClass();
114+
$product = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductInterface::class)->getMockForAbstractClass();
115115
$product->expects($this->any())->method('getId')->willReturn(1);
116116
$this->connectionMock->expects($this->once())
117117
->method('fetchAll')

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Website/LinkTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class LinkTest extends \PHPUnit_Framework_TestCase
3232

3333
protected function setUp()
3434
{
35-
$this->resource = $this->getMock('Magento\Framework\App\ResourceConnection', [], [], '', false);
35+
$this->resource = $this->getMock(\Magento\Framework\App\ResourceConnection::class, [], [], '', false);
3636
$this->connection =
37-
$this->getMock('Magento\Framework\DB\Adapter\AdapterInterface', [], [], '', false);
37+
$this->getMock(\Magento\Framework\DB\Adapter\AdapterInterface::class, [], [], '', false);
3838
$this->dbSelect = $this->getMockBuilder(\Magento\Framework\Db\Select::class)
3939
->disableOriginalConstructor()
4040
->getMock();

0 commit comments

Comments
 (0)