Skip to content

Commit 1470377

Browse files
committed
[Forwardport] magento/magento2#:13040 Customer Login/Logout Issue
1 parent 6606402 commit 1470377

File tree

1 file changed

+8
-86
lines changed

1 file changed

+8
-86
lines changed

app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php

Lines changed: 8 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
use Magento\Customer\Model\Account\Redirect;
1212
use Magento\Customer\Model\Url as CustomerUrl;
1313
use Magento\Framework\Controller\ResultFactory;
14+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1415
use Magento\Framework\Url\HostChecker;
1516
use Magento\Store\Model\ScopeInterface;
16-
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1717

1818
/**
1919
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -300,79 +300,16 @@ public function getRedirectDataProvider()
300300
*/
301301
return [
302302
// Logged In, Redirect by Referer
303-
[
304-
'customer_id' => 1,
305-
'last_customer_id' => 2,
306-
'referer' => 'referer',
307-
'base_url' => 'base',
308-
'before_auth_url' => '',
309-
'after_auth_url' => '',
310-
'account_url' => 'account',
311-
'login_url' => '',
312-
'logout_url' => '',
313-
'dashboard_url' => '',
314-
'is_customer_logged_id_flag' => true,
315-
'redirect_to_dashboard_flag' => false,
316-
],
317-
[
318-
'customer_id' => 1,
319-
'last_customer_id' => 2,
320-
'referer' => 'http://referer.com/',
321-
'base_url' => 'http://base.com/',
322-
'before_auth_url' => '',
323-
'after_auth_url' => '',
324-
'account_url' => 'account',
325-
'login_url' => '',
326-
'logout_url' => '',
327-
'dashboard_url' => 'dashboard',
328-
'is_customer_logged_id_flag' => true,
329-
'redirect_to_dashboard_flag' => false,
330-
],
303+
[1, 2, 'referer', 'base', '', '', 'account', '', '', '', true, false],
304+
[1, 2, 'http://referer.com/', 'http://base.com/', '', '', 'account', '', '', 'dashboard', true, false],
331305
// Logged In, Redirect by AfterAuthUrl
332-
[
333-
'customer_id' => 1,
334-
'last_customer_id' => 2,
335-
'referer' => 'referer',
336-
'base_url' => 'base',
337-
'before_auth_url' => '',
338-
'after_auth_url' => 'defined',
339-
'account_url' => 'account',
340-
'login_url' => '',
341-
'logout_url' => '',
342-
'dashboard_url' => '',
343-
'is_customer_logged_id_flag' => true,
344-
'redirect_to_dashboard_flag' => true,
345-
],
306+
[1, 2, 'referer', 'base', '', 'defined', 'account', '', '', '', true, true],
346307
// Not logged In, Redirect by LoginUrl
347-
[
348-
'customer_id' => 1,
349-
'last_customer_id' => 2,
350-
'referer' => 'referer',
351-
'base_url' => 'base',
352-
'before_auth_url' => '',
353-
'after_auth_url' => '',
354-
'account_url' => 'account',
355-
'login_url' => 'login',
356-
'logout_url' => '',
357-
'dashboard_url' => '',
358-
'is_customer_logged_id_flag' => false,
359-
'redirect_to_dashboard_flag' => true,
360-
],
308+
[1, 2, 'referer', 'base', '', '', 'account', 'login', '', '', false, true],
361309
// Logout, Redirect to Dashboard
362-
[
363-
'customer_id' => 1,
364-
'last_customer_id' => 2,
365-
'referer' => 'referer',
366-
'base_url' => 'base',
367-
'before_auth_url' => 'logout',
368-
'after_auth_url' => '',
369-
'account_url' => 'account',
370-
'login_url' => 'login',
371-
'logout_url' => 'logout',
372-
'dashboard_url' => 'dashboard',
373-
'is_customer_logged_id_flag' => false,
374-
'redirect_to_dashboard_flag' => true,
375-
],
310+
[1, 2, 'referer', 'base', 'logout', '', 'account', 'login', 'logout', 'dashboard', false, true],
311+
// Default redirect
312+
[1, 2, 'referer', 'base', 'defined', '', 'account', 'login', 'logout', 'dashboard', true, true],
376313
// Logout, Without Redirect to Dashboard
377314
[
378315
'customer_id' => 1,
@@ -388,21 +325,6 @@ public function getRedirectDataProvider()
388325
'is_customer_logged_id_flag' => true,
389326
'redirect_to_dashboard_flag' => false,
390327
],
391-
// Default redirect
392-
[
393-
'customer_id' => 1,
394-
'last_customer_id' => 2,
395-
'referer' => 'referer',
396-
'base_url' => 'base',
397-
'before_auth_url' => 'defined',
398-
'after_auth_url' => '',
399-
'account_url' => 'account',
400-
'login_url' => 'login',
401-
'logout_url' => 'logout',
402-
'dashboard_url' => 'dashboard',
403-
'is_customer_logged_id_flag' => true,
404-
'redirect_to_dashboard_flag' => true,
405-
],
406328
];
407329
}
408330

0 commit comments

Comments
 (0)