File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
app/code/Magento/Customer Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -69,14 +69,14 @@ public function __construct(
69
69
State $ state ,
70
70
CustomerRepositoryInterface $ customerRepository ,
71
71
LoggerInterface $ logger ,
72
- RequestInterface $ request = null
72
+ RequestInterface $ request
73
73
) {
74
74
$ this ->session = $ session ;
75
75
$ this ->notificationStorage = $ notificationStorage ;
76
76
$ this ->state = $ state ;
77
77
$ this ->customerRepository = $ customerRepository ;
78
78
$ this ->logger = $ logger ;
79
- $ this ->request = $ request ?? ObjectManager:: getInstance ()-> get (RequestInterface::class) ;
79
+ $ this ->request = $ request ;
80
80
}
81
81
82
82
/**
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class Visitor extends AbstractModel
38
38
const VISITOR_TYPE_VISITOR = 'v ' ;
39
39
const DEFAULT_ONLINE_MINUTES_INTERVAL = 15 ;
40
40
const XML_PATH_ONLINE_INTERVAL = 'customer/online_customers/online_minutes_interval ' ;
41
- const SECONDS_24_HOURS = 86400 ;
41
+ private const SECONDS_24_HOURS = 86400 ;
42
42
43
43
/**
44
44
* @var string[]
@@ -129,7 +129,7 @@ public function __construct(
129
129
$ this ->scopeConfig = $ scopeConfig ;
130
130
$ this ->dateTime = $ dateTime ;
131
131
$ this ->indexerRegistry = $ indexerRegistry ;
132
- $ this ->requestSafety = $ requestSafety ?? ObjectManager::getInstance ()->create (RequestSafetyInterface::class);
132
+ $ this ->requestSafety = $ requestSafety ?? ObjectManager::getInstance ()->get (RequestSafetyInterface::class);
133
133
}
134
134
135
135
/**
Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ public function testBeforeExecute()
112
112
->method ('remove ' )
113
113
->with (NotificationStorage::UPDATE_CUSTOMER_SESSION , self ::STUB_CUSTOMER_ID );
114
114
115
+ $ this ->sessionMock ->expects ($ this ->once ())->method ('setCustomerData ' )->with ($ customerMock );
116
+ $ this ->sessionMock ->expects ($ this ->once ())->method ('setCustomerGroupId ' )->with ($ customerGroupId );
117
+ $ this ->sessionMock ->expects ($ this ->once ())->method ('regenerateId ' );
118
+
115
119
$ this ->plugin ->beforeExecute ($ this ->actionMock );
116
120
}
117
121
You can’t perform that action at this time.
0 commit comments