Skip to content

Commit 7f8eb6e

Browse files
MTO-143: [Test] Captcha and lockout for Edit Account Settings page
- Defects fixed
2 parents be2c1b6 + d4f822d commit 7f8eb6e

File tree

1,920 files changed

+13087
-4795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,920 files changed

+13087
-4795
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ cache:
2626
directories: $HOME/.composer/cache
2727
matrix:
2828
exclude:
29-
- php: 7.0
29+
- php: 5.6.29
3030
env: TEST_SUITE=static
3131
before_install: ./dev/travis/before_install.sh
3232
install: composer install --no-interaction --prefer-dist
3333
before_script: ./dev/travis/before_script.sh
3434
script:
35-
- cd dev/tests/$TEST_SUITE
3635
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
37-
- phpunit $TEST_FILTER
36+
- phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER

PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--- Provide a general summary of the Pull Request in the Title above -->
2+
3+
### Description
4+
<!--- Provide a description of the changes proposed in the pull request -->
5+
6+
### Fixed Issues (if relevant)
7+
<!--- Provide a list of fixed issues in the format magento/magetno2#<issue_number>, if relevant -->
8+
1. magento/magetno2#<issue_number>: Issue title
9+
2. ...
10+
11+
### Manual testing scenarios
12+
<!--- Provide a set of unambiguous steps to test the proposed code change -->
13+
1. ...
14+
2. ...
15+
16+
### Contribution checklist
17+
- [ ] Pull request has a meaningful description of its purpose
18+
- [ ] All commits are accompanied by meaningful commit messages
19+
- [ ] All new or changed code is covered with unit/integration tests (if applicable)
20+
- [ ] All automated tests passed successfully (all builds on Travis CI are green)

app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Store\Model\Store;
1010

1111
/**
12-
* @deprecated
12+
* @deprecated
1313
*/
1414
class Baseurl implements \Magento\Framework\Notification\MessageInterface
1515
{

app/code/Magento/AdminNotification/Setup/InstallSchema.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
120120
$installer->getConnection()->createTable($table);
121121

122122
$installer->endSetup();
123-
124123
}
125124
}

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class WebsiteTest extends \PHPUnit_Framework_TestCase
1313
/**
1414
* @var \Magento\Store\Model\WebSite|\PHPUnit_Framework_MockObject_MockObject
1515
*/
16-
protected $webSiteModel;
16+
protected $webSiteModel;
1717

1818
/**
1919
* @var \Magento\CatalogImportExport\Model\Import\Product\StoreResolver|\PHPUnit_Framework_MockObject_MockObject

app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Postpone.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public function __construct(
5555
$this->notificationTime = $notificationTime;
5656
$this->logger = $logger;
5757
parent::__construct($context);
58-
5958
}
6059

6160
/**

app/code/Magento/Analytics/Cron/CollectData.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\Analytics\Cron;
77

8-
use Magento\Analytics\Model\ExportDataHandler;
8+
use Magento\Analytics\Model\ExportDataHandlerInterface;
99
use Magento\Analytics\Model\SubscriptionStatusProvider;
1010

1111
/**
@@ -16,7 +16,7 @@ class CollectData
1616
/**
1717
* Resource for the handling of a new data collection.
1818
*
19-
* @var ExportDataHandler
19+
* @var ExportDataHandlerInterface
2020
*/
2121
private $exportDataHandler;
2222

@@ -28,11 +28,11 @@ class CollectData
2828
private $subscriptionStatus;
2929

3030
/**
31-
* @param ExportDataHandler $exportDataHandler
31+
* @param ExportDataHandlerInterface $exportDataHandler
3232
* @param SubscriptionStatusProvider $subscriptionStatus
3333
*/
3434
public function __construct(
35-
ExportDataHandler $exportDataHandler,
35+
ExportDataHandlerInterface $exportDataHandler,
3636
SubscriptionStatusProvider $subscriptionStatus
3737
) {
3838
$this->exportDataHandler = $exportDataHandler;
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Analytics\Model\Connector;
7+
8+
use Magento\Analytics\Model\AnalyticsToken;
9+
use Magento\Framework\HTTP\ZendClient;
10+
use Magento\Config\Model\Config;
11+
use Psr\Log\LoggerInterface;
12+
use Magento\Store\Model\Store;
13+
14+
/**
15+
* Command notifies MBI about that data collection was finished.
16+
*/
17+
class NotifyDataChangedCommand implements CommandInterface
18+
{
19+
/**
20+
* @var string
21+
*/
22+
private $notifyDataChangedUrlPath = 'analytics/url/notify_data_changed';
23+
24+
/**
25+
* @var AnalyticsToken
26+
*/
27+
private $analyticsToken;
28+
29+
/**
30+
* @var Http\ClientInterface
31+
*/
32+
private $httpClient;
33+
34+
/**
35+
* @var Config
36+
*/
37+
private $config;
38+
39+
/**
40+
* @var LoggerInterface
41+
*/
42+
private $logger;
43+
44+
/**
45+
* NotifyDataChangedCommand constructor.
46+
* @param AnalyticsToken $analyticsToken
47+
* @param Http\ClientInterface $httpClient
48+
* @param Config $config
49+
* @param LoggerInterface $logger
50+
*/
51+
public function __construct(
52+
AnalyticsToken $analyticsToken,
53+
Http\ClientInterface $httpClient,
54+
Config $config,
55+
LoggerInterface $logger
56+
) {
57+
$this->analyticsToken = $analyticsToken;
58+
$this->httpClient = $httpClient;
59+
$this->config = $config;
60+
$this->logger = $logger;
61+
}
62+
63+
/**
64+
* Notify MBI about that data collection was finished
65+
* @return bool
66+
*/
67+
public function execute()
68+
{
69+
$result = false;
70+
try {
71+
if ($this->analyticsToken->isTokenExist()) {
72+
$this->httpClient->request(
73+
ZendClient::POST,
74+
$this->config->getConfigDataValue($this->notifyDataChangedUrlPath),
75+
$this->getRequestJson(),
76+
['Content-Type: application/json']
77+
);
78+
$result = true;
79+
}
80+
} catch (\Exception $e) {
81+
$this->logger->critical($e);
82+
}
83+
return $result;
84+
}
85+
86+
/**
87+
* Prepares request data in JSON format.
88+
* @return string
89+
*/
90+
private function getRequestJson()
91+
{
92+
return json_encode(
93+
[
94+
"access-token" => $this->analyticsToken->getToken(),
95+
"url" => $this->config->getConfigDataValue(
96+
Store::XML_PATH_SECURE_BASE_URL
97+
),
98+
]
99+
);
100+
}
101+
}

app/code/Magento/Analytics/Model/ExportDataHandler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* Class for the handling of a new data collection for MBI.
1717
*/
18-
class ExportDataHandler
18+
class ExportDataHandler implements ExportDataHandlerInterface
1919
{
2020
/**
2121
* Subdirectory path for all temporary files.
@@ -84,9 +84,7 @@ public function __construct(
8484
}
8585

8686
/**
87-
* Execute collecting new data for MBI.
88-
*
89-
* @return bool
87+
* @inheritdoc
9088
*/
9189
public function prepareExportData()
9290
{
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Analytics\Model;
7+
8+
/**
9+
* The interface represents the type of classes that handling of a new data collection for MBI.
10+
*/
11+
interface ExportDataHandlerInterface
12+
{
13+
/**
14+
* Execute collecting new data for MBI.
15+
*
16+
* @return bool
17+
*/
18+
public function prepareExportData();
19+
}

0 commit comments

Comments
 (0)