@@ -78,7 +78,7 @@ protected function setUp()
78
78
$ this ->resourceMock = $ this ->createMock (ResourceConnection::class);
79
79
$ this ->select = $ this ->createMock (Select::class);
80
80
$ 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 );
82
82
83
83
$ helper = new ObjectManager ($ this );
84
84
$ this ->deleteByStore = $ helper ->getObject (
@@ -91,16 +91,22 @@ protected function setUp()
91
91
);
92
92
}
93
93
94
+ /**
95
+ * @throws \Exception
96
+ * @SuppressWarnings(PHPMD.UnusedLocalVariable)
97
+ */
94
98
public function testExecute ()
95
99
{
96
100
$ profileTableName = 'sales_sequence_profile ' ;
97
101
$ storeId = 1 ;
98
102
$ metadataIds = [1 , 2 ];
99
103
$ profileIds = [10 , 11 ];
100
104
$ this ->resourceMock ->method ('getTableName ' )
101
- ->willReturnCallback (static function ($ tableName ) {
102
- return $ tableName ;
103
- });
105
+ ->willReturnCallback (
106
+ static function ($ tableName ) {
107
+ return $ tableName ;
108
+ }
109
+ );
104
110
$ this ->resourceMock ->method ('getConnection ' )
105
111
->willReturn ($ this ->connectionMock );
106
112
$ this ->connectionMock
@@ -114,7 +120,6 @@ public function testExecute()
114
120
115
121
$ this ->connectionMock ->method ('fetchCol ' )
116
122
->willReturnCallback (
117
- /** @SuppressWarnings(PHPMD.UnusedFormalParameter) */
118
123
static function ($ arg , $ arg2 ) use ($ metadataIds , $ profileIds ) {
119
124
if (array_key_exists ('store ' , $ arg2 )) {
120
125
return $ metadataIds ;
@@ -128,13 +133,13 @@ static function ($arg, $arg2) use ($metadataIds, $profileIds) {
128
133
->method ('delete ' )
129
134
->with ($ profileTableName , ['profile_id IN (?) ' => $ profileIds ])
130
135
->willReturn (2 );
131
- $ this ->resourceSequenceMeta -> expects ( $ this -> any ())
136
+ $ this ->resourceSequenceMeta
132
137
->method ('load ' )
133
138
->willReturn ($ this ->meta );
134
- $ this ->connectionMock -> expects ( $ this -> any ())
139
+ $ this ->connectionMock
135
140
->method ('dropTable ' )
136
141
->willReturn (true );
137
- $ this ->resourceSequenceMeta -> expects ( $ this -> any ())
142
+ $ this ->resourceSequenceMeta
138
143
->method ('delete ' )
139
144
->willReturn ($ this ->resourceSequenceMeta );
140
145
$ this ->deleteByStore ->execute ($ storeId );
0 commit comments