Skip to content

Commit 68d1bed

Browse files
committed
fix #14958 - fix static check
1 parent 11f013c commit 68d1bed

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

app/code/Magento/SalesSequence/Test/Unit/Model/Sequence/DeleteByStoreTest.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected function setUp()
7878
$this->resourceMock = $this->createMock(ResourceConnection::class);
7979
$this->select = $this->createMock(Select::class);
8080
$this->metaFactory = $this->createPartialMock(MetaFactory::class, ['create']);
81-
$this->metaFactory->expects($this->any())->method('create')->willReturn($this->meta);
81+
$this->metaFactory->method('create')->willReturn($this->meta);
8282

8383
$helper = new ObjectManager($this);
8484
$this->deleteByStore = $helper->getObject(
@@ -91,16 +91,22 @@ protected function setUp()
9191
);
9292
}
9393

94+
/**
95+
* @throws \Exception
96+
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
97+
*/
9498
public function testExecute()
9599
{
96100
$profileTableName = 'sales_sequence_profile';
97101
$storeId = 1;
98102
$metadataIds = [1, 2];
99103
$profileIds = [10, 11];
100104
$this->resourceMock->method('getTableName')
101-
->willReturnCallback(static function ($tableName) {
102-
return $tableName;
103-
});
105+
->willReturnCallback(
106+
static function ($tableName) {
107+
return $tableName;
108+
}
109+
);
104110
$this->resourceMock->method('getConnection')
105111
->willReturn($this->connectionMock);
106112
$this->connectionMock
@@ -114,7 +120,6 @@ public function testExecute()
114120

115121
$this->connectionMock->method('fetchCol')
116122
->willReturnCallback(
117-
/** @SuppressWarnings(PHPMD.UnusedFormalParameter) */
118123
static function ($arg, $arg2) use ($metadataIds, $profileIds) {
119124
if (array_key_exists('store', $arg2)) {
120125
return $metadataIds;
@@ -128,13 +133,13 @@ static function ($arg, $arg2) use ($metadataIds, $profileIds) {
128133
->method('delete')
129134
->with($profileTableName, ['profile_id IN (?)' => $profileIds])
130135
->willReturn(2);
131-
$this->resourceSequenceMeta->expects($this->any())
136+
$this->resourceSequenceMeta
132137
->method('load')
133138
->willReturn($this->meta);
134-
$this->connectionMock->expects($this->any())
139+
$this->connectionMock
135140
->method('dropTable')
136141
->willReturn(true);
137-
$this->resourceSequenceMeta->expects($this->any())
142+
$this->resourceSequenceMeta
138143
->method('delete')
139144
->willReturn($this->resourceSequenceMeta);
140145
$this->deleteByStore->execute($storeId);

0 commit comments

Comments
 (0)