Skip to content

Commit 00c625b

Browse files
author
Dmytro Voskoboinikov
committed
MAGETWO-34361: Pull request processing
1 parent c7d40ee commit 00c625b

File tree

3 files changed

+43
-27
lines changed

3 files changed

+43
-27
lines changed

app/code/Magento/Customer/Model/Logger.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ protected function loadLogData($customerId)
103103
['last_visit_at']
104104
)
105105
->where(
106-
'cl.customer_id = ?', $customerId
106+
'cl.customer_id = ?',
107+
$customerId
107108
)
108109
->order(
109110
'cv.visitor_id DESC'

dev/tests/unit/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,57 @@ class PersonalInfoTest extends \PHPUnit_Framework_TestCase
4545
protected function setUp()
4646
{
4747
$customer = $this->getMock(
48-
'Magento\Customer\Api\Data\CustomerInterface', [], [], '', false
48+
'Magento\Customer\Api\Data\CustomerInterface',
49+
[],
50+
[],
51+
'',
52+
false
4953
);
5054
$customer->expects($this->any())->method('getId')->willReturn(1);
5155
$customer->expects($this->any())->method('getStoreId')->willReturn(1);
5256

5357
$customerDataFactory = $this->getMock(
54-
'Magento\Customer\Api\Data\CustomerInterfaceFactory', ['create'], [], '', false
58+
'Magento\Customer\Api\Data\CustomerInterfaceFactory',
59+
['create'],
60+
[],
61+
'',
62+
false
5563
);
5664
$customerDataFactory->expects($this->any())->method('create')->willReturn($customer);
5765

5866
$backendSession = $this->getMock(
59-
'Magento\Backend\Model\Session', ['getCustomerData'], [], '', false
67+
'Magento\Backend\Model\Session',
68+
['getCustomerData'],
69+
[],
70+
'',
71+
false
6072
);
6173
$backendSession->expects($this->any())->method('getCustomerData')->willReturn(['account' => []]);
6274

6375
$this->customerLog = $this->getMock(
64-
'Magento\Customer\Model\Log', ['getLastLoginAt', 'getLastVisitAt', 'getLastLogoutAt'], [], '', false
76+
'Magento\Customer\Model\Log',
77+
['getLastLoginAt', 'getLastVisitAt', 'getLastLogoutAt'],
78+
[],
79+
'',
80+
false
6581
);
6682
$this->customerLog->expects($this->any())->method('loadByCustomer')->willReturnSelf();
6783

6884
$customerLogger = $this->getMock(
69-
'Magento\Customer\Model\Logger', ['get'], [], '', false
85+
'Magento\Customer\Model\Logger',
86+
['get'],
87+
[],
88+
'',
89+
false
7090
);
7191
$customerLogger->expects($this->any())->method('get')->willReturn($this->customerLog);
7292

7393
$dateTime = $this->getMock(
74-
'Magento\Framework\Stdlib\DateTime', ['now'], [], '', false
94+
'Magento\Framework\Stdlib\DateTime',
95+
['now'],
96+
[],
97+
'',
98+
false
7599
);
76100
$dateTime->expects($this->any())->method('now')->willReturn('2015-03-04 12:00:00');
77101

@@ -82,13 +106,14 @@ protected function setUp()
82106
'',
83107
false
84108
);
85-
$this->localeDate
86-
->expects($this->any())
87-
->method('getDefaultTimezonePath')
88-
->willReturn($this->pathToDefaultTimezone);
109+
$this->localeDate->expects($this->any())->method('getDefaultTimezonePath')->willReturn($this->pathToDefaultTimezone);
89110

90111
$this->scopeConfig = $this->getMock(
91-
'Magento\Framework\App\Config', ['getValue'], [], '', false
112+
'Magento\Framework\App\Config',
113+
['getValue'],
114+
[],
115+
'',
116+
false
92117
);
93118

94119
$objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
@@ -117,9 +142,7 @@ public function testGetStoreLastLoginDateTimezone()
117142
)
118143
->willReturn($this->defaultTimezone);
119144

120-
$this->assertEquals(
121-
$this->defaultTimezone, $this->block->getStoreLastLoginDateTimezone()
122-
);
145+
$this->assertEquals($this->defaultTimezone, $this->block->getStoreLastLoginDateTimezone());
123146
}
124147

125148
/**

dev/tests/unit/testsuite/Magento/Customer/Model/LogTest.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,21 @@ protected function setUp()
4646

4747
public function testGetCustomerId()
4848
{
49-
$this->assertEquals(
50-
$this->logData['customer_id'], $this->log->getCustomerId()
51-
);
49+
$this->assertEquals($this->logData['customer_id'], $this->log->getCustomerId());
5250
}
5351

5452
public function testGetLastLoginAt()
5553
{
56-
$this->assertEquals(
57-
$this->logData['last_login_at'], $this->log->getLastLoginAt()
58-
);
54+
$this->assertEquals($this->logData['last_login_at'], $this->log->getLastLoginAt());
5955
}
6056

6157
public function testGetLastVisitAt()
6258
{
63-
$this->assertEquals(
64-
$this->logData['last_visit_at'], $this->log->getLastVisitAt()
65-
);
59+
$this->assertEquals($this->logData['last_visit_at'], $this->log->getLastVisitAt());
6660
}
6761

6862
public function testGetLastLogoutAt()
6963
{
70-
$this->assertEquals(
71-
$this->logData['last_logout_at'], $this->log->getLastLogoutAt()
72-
);
64+
$this->assertEquals($this->logData['last_logout_at'], $this->log->getLastLogoutAt());
7365
}
7466
}

0 commit comments

Comments
 (0)