Skip to content

Commit 150c31c

Browse files
committed
MAGETWO-65287: Remove class, related unit tests, add to obsolete classes
1 parent f1dc91b commit 150c31c

File tree

10 files changed

+3
-322
lines changed

10 files changed

+3
-322
lines changed

app/code/Magento/Authorization/Model/ResourceModel/Rules.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ class Rules extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
2121
*/
2222
protected $_rootResource;
2323

24-
/**
25-
* Acl object cache
26-
*
27-
* @var \Magento\Framework\Acl\CacheInterface
28-
* @deprecated since 2.2 due to native serialization elimination.
29-
* Use data cache \Magento\Framework\Acl\Data\CacheInterface instead.
30-
*/
31-
protected $_aclCache;
32-
3324
/**
3425
* @var \Magento\Framework\Acl\Builder
3526
*/
@@ -50,7 +41,6 @@ class Rules extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
5041
* @param \Magento\Framework\Acl\Builder $aclBuilder
5142
* @param \Psr\Log\LoggerInterface $logger
5243
* @param \Magento\Framework\Acl\RootResource $rootResource
53-
* @param \Magento\Framework\Acl\CacheInterface $aclCache
5444
* @param string $connectionName
5545
* @param \Magento\Framework\Acl\Data\CacheInterface $aclDataCache
5646
*/
@@ -59,14 +49,12 @@ public function __construct(
5949
\Magento\Framework\Acl\Builder $aclBuilder,
6050
\Psr\Log\LoggerInterface $logger,
6151
\Magento\Framework\Acl\RootResource $rootResource,
62-
\Magento\Framework\Acl\CacheInterface $aclCache,
6352
$connectionName = null,
6453
\Magento\Framework\Acl\Data\CacheInterface $aclDataCache = null
6554
) {
6655
$this->_aclBuilder = $aclBuilder;
6756
parent::__construct($context, $connectionName);
6857
$this->_rootResource = $rootResource;
69-
$this->_aclCache = $aclCache;
7058
$this->_logger = $logger;
7159
$this->aclDataCache = $aclDataCache ?: ObjectManager::getInstance()->get(
7260
\Magento\Framework\Acl\Data\CacheInterface::class

app/code/Magento/Authorization/Test/Unit/Model/ResourceModel/RulesTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ class RulesTest extends \PHPUnit_Framework_TestCase
4646
*/
4747
private $rootResourceMock;
4848

49-
/**
50-
* @var \Magento\Framework\Acl\CacheInterface|\PHPUnit_Framework_MockObject_MockObject
51-
*/
52-
private $aclCacheMock;
53-
5449
/**
5550
* @var \Magento\Framework\Acl\Data\CacheInterface|\PHPUnit_Framework_MockObject_MockObject
5651
*/
@@ -117,11 +112,6 @@ protected function setUp()
117112
->setMethods([])
118113
->getMock();
119114

120-
$this->aclCacheMock = $this->getMockBuilder(\Magento\Framework\Acl\CacheInterface::class)
121-
->disableOriginalConstructor()
122-
->setMethods([])
123-
->getMock();
124-
125115
$this->aclDataCacheMock = $this->getMockBuilder(\Magento\Framework\Acl\Data\CacheInterface::class)
126116
->disableOriginalConstructor()
127117
->setMethods([])
@@ -145,7 +135,6 @@ protected function setUp()
145135
$this->aclBuilderMock,
146136
$this->loggerMock,
147137
$this->rootResourceMock,
148-
$this->aclCacheMock,
149138
'connection',
150139
$this->aclDataCacheMock
151140
);

app/code/Magento/User/Model/ResourceModel/User.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@
1717
*/
1818
class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
1919
{
20-
/**
21-
* @var \Magento\Framework\Acl\CacheInterface
22-
* @deprecated since 2.2 due to native serialization elimination.
23-
* Use data cache \Magento\Framework\Acl\Data\CacheInterface instead.
24-
*/
25-
protected $_aclCache;
26-
2720
/**
2821
* Role model
2922
*
@@ -45,22 +38,19 @@ class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
4538
* Construct
4639
*
4740
* @param \Magento\Framework\Model\ResourceModel\Db\Context $context
48-
* @param \Magento\Framework\Acl\CacheInterface $aclCache
4941
* @param \Magento\Authorization\Model\RoleFactory $roleFactory
5042
* @param \Magento\Framework\Stdlib\DateTime $dateTime
5143
* @param string $connectionName
5244
* @param \Magento\Framework\Acl\Data\CacheInterface $aclDataCache
5345
*/
5446
public function __construct(
5547
\Magento\Framework\Model\ResourceModel\Db\Context $context,
56-
\Magento\Framework\Acl\CacheInterface $aclCache,
5748
\Magento\Authorization\Model\RoleFactory $roleFactory,
5849
\Magento\Framework\Stdlib\DateTime $dateTime,
5950
$connectionName = null,
6051
\Magento\Framework\Acl\Data\CacheInterface $aclDataCache = null
6152
) {
6253
parent::__construct($context, $connectionName);
63-
$this->_aclCache = $aclCache;
6454
$this->_roleFactory = $roleFactory;
6555
$this->dateTime = $dateTime;
6656
$this->aclDataCache = $aclDataCache ?: \Magento\Framework\App\ObjectManager::getInstance()->get(

app/code/Magento/User/Test/Unit/Model/ResourceModel/UserTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ class UserTest extends \PHPUnit_Framework_TestCase
2121
/** @var \Magento\User\Model\User|\PHPUnit_framework_MockObject_MockObject */
2222
protected $userMock;
2323

24-
/** @var \Magento\Framework\Acl\CacheInterface|\PHPUnit_Framework_MockObject_MockObject */
25-
protected $aclCacheMock;
26-
2724
/** @var \Magento\Framework\Model\ResourceModel\Db\Context|\PHPUnit_Framework_MockObject_MockObject */
2825
protected $contextMock;
2926

@@ -62,11 +59,6 @@ protected function setUp()
6259
->setMethods([])
6360
->getMock();
6461

65-
$this->aclCacheMock = $this->getMockBuilder(\Magento\Framework\Acl\CacheInterface::class)
66-
->disableOriginalConstructor()
67-
->setMethods([])
68-
->getMock();
69-
7062
$this->roleFactoryMock = $this->getMockBuilder(\Magento\Authorization\Model\RoleFactory::class)
7163
->disableOriginalConstructor()
7264
->setMethods(['create'])
@@ -102,7 +94,6 @@ protected function setUp()
10294
\Magento\User\Model\ResourceModel\User::class,
10395
[
10496
'resource' => $this->resourceMock,
105-
'aclCache' => $this->aclCacheMock,
10697
'roleFactory' => $this->roleFactoryMock,
10798
'dateTime' => $this->dateTimeMock,
10899
'aclDataCache' => $this->aclDataCacheMock,

dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4227,4 +4227,7 @@
42274227
['Magento\Framework\Search\Document', 'Magento\Framework\Api\Search\Document'],
42284228
['Magento\Framework\Search\DocumentField'],
42294229
['Magento\Quote\Setup\Recurring'],
4230+
['Magento\Framework\Acl\Cache'],
4231+
['Magento\Framework\Acl\CacheInterface'],
4232+
['Magento\Framework\Acl\Test\Unit\CacheTest'],
42304233
];

lib/internal/Magento/Framework/Acl/Builder.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,24 @@ class Builder
2525
*/
2626
protected $_loaderPool;
2727

28-
/**
29-
* ACL cache
30-
*
31-
* @var \Magento\Framework\Acl\CacheInterface
32-
* @deprecated
33-
*/
34-
protected $_cache;
35-
3628
/**
3729
* @var \Magento\Framework\AclFactory
3830
*/
3931
protected $_aclFactory;
4032

4133
/**
4234
* @param \Magento\Framework\AclFactory $aclFactory
43-
* @param \Magento\Framework\Acl\CacheInterface $cache
4435
* @param \Magento\Framework\Acl\LoaderInterface $roleLoader
4536
* @param \Magento\Framework\Acl\LoaderInterface $resourceLoader
4637
* @param \Magento\Framework\Acl\LoaderInterface $ruleLoader
4738
*/
4839
public function __construct(
4940
\Magento\Framework\AclFactory $aclFactory,
50-
\Magento\Framework\Acl\CacheInterface $cache,
5141
\Magento\Framework\Acl\LoaderInterface $roleLoader,
5242
\Magento\Framework\Acl\LoaderInterface $resourceLoader,
5343
\Magento\Framework\Acl\LoaderInterface $ruleLoader
5444
) {
5545
$this->_aclFactory = $aclFactory;
56-
$this->_cache = $cache;
5746
$this->_loaderPool = [$roleLoader, $resourceLoader, $ruleLoader];
5847
}
5948

lib/internal/Magento/Framework/Acl/Cache.php

Lines changed: 0 additions & 92 deletions
This file was deleted.

lib/internal/Magento/Framework/Acl/CacheInterface.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

lib/internal/Magento/Framework/Acl/Test/Unit/BuilderTest.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,16 @@ class BuilderTest extends \PHPUnit_Framework_TestCase
3939
*/
4040
protected $_model;
4141

42-
/**
43-
* @var \PHPUnit_Framework_MockObject_MockObject
44-
*/
45-
protected $_aclCacheMock;
46-
4742
protected function setUp()
4843
{
4944
$this->_aclMock = new \Magento\Framework\Acl();
50-
$this->_aclCacheMock = $this->getMock(\Magento\Framework\Acl\CacheInterface::class);
5145
$this->_aclFactoryMock = $this->getMock(\Magento\Framework\AclFactory::class, [], [], '', false);
5246
$this->_aclFactoryMock->expects($this->any())->method('create')->will($this->returnValue($this->_aclMock));
5347
$this->_roleLoader = $this->getMock(\Magento\Framework\Acl\Loader\DefaultLoader::class);
5448
$this->_ruleLoader = $this->getMock(\Magento\Framework\Acl\Loader\DefaultLoader::class);
5549
$this->_resourceLoader = $this->getMock(\Magento\Framework\Acl\Loader\DefaultLoader::class);
5650
$this->_model = new \Magento\Framework\Acl\Builder(
5751
$this->_aclFactoryMock,
58-
$this->_aclCacheMock,
5952
$this->_roleLoader,
6053
$this->_resourceLoader,
6154
$this->_ruleLoader
@@ -64,10 +57,6 @@ protected function setUp()
6457

6558
public function testGetAclUsesLoadersProvidedInConfigurationToPopulateAclIfCacheIsEmpty()
6659
{
67-
$this->_aclCacheMock->expects($this->never())->method('has');
68-
$this->_aclCacheMock->expects($this->never())->method('get');
69-
$this->_aclCacheMock->expects($this->never())->method('save');
70-
$this->_aclCacheMock->expects($this->never())->method('clean');
7160
$this->_ruleLoader->expects($this->once())->method('populateAcl')->with($this->equalTo($this->_aclMock));
7261

7362
$this->_roleLoader->expects($this->once())->method('populateAcl')->with($this->equalTo($this->_aclMock));
@@ -79,13 +68,6 @@ public function testGetAclUsesLoadersProvidedInConfigurationToPopulateAclIfCache
7968

8069
public function testGetAclReturnsAclStoredInCache()
8170
{
82-
/**
83-
* The acl cache of type \Magento\Framework\Acl\CacheInterface is deprecated and should never be called
84-
*/
85-
$this->_aclCacheMock->expects($this->never())->method('has');
86-
$this->_aclCacheMock->expects($this->never())->method('get');
87-
$this->_aclCacheMock->expects($this->never())->method('save');
88-
$this->_aclCacheMock->expects($this->never())->method('clean');
8971
$this->assertEquals($this->_aclMock, $this->_model->getAcl());
9072
$this->assertEquals($this->_aclMock, $this->_model->getAcl());
9173
}

0 commit comments

Comments
 (0)