Skip to content

Commit 056ad90

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/develop' into MAGETWO-48081-copyright
Conflicts: app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-tab-updater-checkbox.js app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-tab-updater-select.js dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Tab/Reviews.php dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php
2 parents 2d368d0 + 044bada commit 056ad90

File tree

945 files changed

+4731
-1675
lines changed

Some content is hidden

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

945 files changed

+4731
-1675
lines changed

.travis.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ env:
1111
- TEST_SUITE=integration_part_1
1212
- TEST_SUITE=integration_part_2
1313
- TEST_SUITE=integration_integrity
14-
- TEST_SUITE=static_phpcs
15-
- TEST_SUITE=static_annotation
14+
- TEST_SUITE=static
1615
cache:
1716
apt: true
1817
directories:
@@ -21,9 +20,9 @@ cache:
2120
matrix:
2221
exclude:
2322
- php: 5.6
24-
env: TEST_SUITE=static_phpcs
25-
- php: 5.6
26-
env: TEST_SUITE=static_annotation
23+
env: TEST_SUITE=static
24+
- php: 7.0
25+
env: TEST_SUITE=static
2726
before_install:
2827
- sudo apt-get update -qq
2928
- sudo apt-get install -y -qq postfix
@@ -68,6 +67,4 @@ script:
6867
# Integration integrity tests
6968
- sh -c "if [ '$TEST_SUITE' = 'integration_integrity' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.dist testsuite/Magento/Test/Integrity; fi"
7069
# Static tests [Code Style]
71-
- sh -c "if [ '$TEST_SUITE' = 'static_phpcs' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testCodeStyle'; fi"
72-
# Static tests [Code Style]
73-
- sh -c "if [ '$TEST_SUITE' = 'static_annotation' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testAnnotationStandard'; fi"
70+
- sh -c "if [ '$TEST_SUITE' = 'static' ]; then cd dev/tests/static/; php get_github_changes.php --output-file='$TRAVIS_BUILD_DIR/dev/tests/static/testsuite/Magento/Test/_files/changed_files_ce.txt' --base-path='$TRAVIS_BUILD_DIR' --repo='https://github.com/magento/magento2.git' --branch='develop'; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest'; fi"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=master)](https://travis-ci.org/magento/magento2)
1+
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=develop)](https://travis-ci.org/magento/magento2)
22
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
33
<h2>Welcome</h2>
44
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results.

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ class TierPriceTest extends \PHPUnit_Framework_TestCase
3333
*/
3434
protected $tierPrice;
3535

36-
37-
public function setUp()
36+
protected function setUp()
3837
{
3938
$this->groupRepository = $this->getMockBuilder('\Magento\Customer\Api\GroupRepositoryInterface')
4039
->disableOriginalConstructor()

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class WebsiteTest extends \PHPUnit_Framework_TestCase
2525
*/
2626
protected $website;
2727

28-
public function setUp()
28+
protected function setUp()
2929
{
3030
$this->webSiteModel = $this->getMock(
3131
'\Magento\Store\Model\WebSite',

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase
2525
*/
2626
protected $validatorTest;
2727

28-
public function setUp()
28+
protected function setUp()
2929
{
3030
$this->validatorTest = $this->getMockForAbstractClass(
3131
'Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface',

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\A
123123
*/
124124
protected $errorAggregator;
125125

126-
public function setUp()
126+
protected function setUp()
127127
{
128128
parent::setUp();
129129

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ImportTest extends \PHPUnit_Framework_TestCase
2525
*/
2626
protected $advancedPricing;
2727

28-
public function setUp()
28+
protected function setUp()
2929
{
3030
$this->indexer = $this->getMockForAbstractClass('\Magento\Framework\Indexer\IndexerInterface', [], '', false);
3131
$this->import = $this->getMock(

app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class PlaceTest extends \PHPUnit_Framework_TestCase
3333
* @var ObjectManager
3434
*/
3535
protected $objectManager;
36+
3637
/**
3738
* @var Place
3839
*/
@@ -98,7 +99,7 @@ class PlaceTest extends \PHPUnit_Framework_TestCase
9899
*/
99100
protected $checkoutSessionMock;
100101

101-
public function setUp()
102+
protected function setUp()
102103
{
103104
$this->directpostSessionMock = $this
104105
->getMockBuilder('Magento\Authorizenet\Model\Directpost\Session')

app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/SessionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase
2626
*/
2727
protected $storageMock;
2828

29-
public function setUp()
29+
protected function setUp()
3030
{
3131
$this->storageMock = $this
3232
->getMockBuilder('Magento\Framework\Session\StorageInterface')

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php

+13-10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function __construct(
4747
* Retrieve date format
4848
*
4949
* @return string
50+
* @deprecated
5051
*/
5152
protected function _getFormat()
5253
{
@@ -74,16 +75,18 @@ protected function _getFormat()
7475
*/
7576
public function render(\Magento\Framework\DataObject $row)
7677
{
77-
if ($data = $row->getData($this->getColumn()->getIndex())) {
78-
$timezone = $this->getColumn()->getTimezone() !== false ? $this->_localeDate->getConfigTimezone() : 'UTC';
79-
return $this->dateTimeFormatter->formatObject(
80-
$this->_localeDate->date(
81-
new \DateTime(
82-
$data,
83-
new \DateTimeZone($timezone)
84-
)
85-
),
86-
$this->_getFormat()
78+
$format = $this->getColumn()->getFormat();
79+
$date = $this->_getValue($row);
80+
if ($date) {
81+
if (!($date instanceof \DateTimeInterface)) {
82+
$date = new \DateTime($date);
83+
}
84+
return $this->_localeDate->formatDateTime(
85+
$date,
86+
$format ?: \IntlDateFormatter::MEDIUM,
87+
\IntlDateFormatter::NONE,
88+
null,
89+
$this->getColumn()->getTimezone() === false ? 'UTC' : null
8790
);
8891
}
8992
return $this->getColumn()->getDefault();

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ class Datetime extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstra
2020
public function render(\Magento\Framework\DataObject $row)
2121
{
2222
$format = $this->getColumn()->getFormat();
23-
if ($date = $this->_getValue($row)) {
23+
$date = $this->_getValue($row);
24+
if ($date) {
25+
if (!($date instanceof \DateTimeInterface)) {
26+
$date = new \DateTime($date);
27+
}
2428
return $this->_localeDate->formatDateTime(
25-
$date instanceof \DateTimeInterface ? $date : new \DateTime($date),
29+
$date,
2630
$format ?: \IntlDateFormatter::MEDIUM,
2731
$format ?: \IntlDateFormatter::MEDIUM,
2832
null,
29-
$this->getColumn()->getTimezone() !== false ? null : 'UTC'
33+
$this->getColumn()->getTimezone() === false ? 'UTC' : null
3034
);
3135
}
3236
return $this->getColumn()->getDefault();

app/code/Magento/Backend/Model/Auth/Session.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,16 @@ public function isLoggedIn()
177177
*/
178178
public function prolong()
179179
{
180-
$this->setUpdatedAt(time());
180+
$cookieValue = $this->cookieManager->getCookie($this->getName());
181+
if ($cookieValue) {
182+
$this->setUpdatedAt(time());
183+
$cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()
184+
->setPath($this->sessionConfig->getCookiePath())
185+
->setDomain($this->sessionConfig->getCookieDomain())
186+
->setSecure($this->sessionConfig->getCookieSecure())
187+
->setHttpOnly($this->sessionConfig->getCookieHttpOnly());
188+
$this->cookieManager->setPublicCookie($this->getName(), $cookieValue, $cookieMetadata);
189+
}
181190
}
182191

183192
/**

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/ConcatTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ class ConcatTest extends \PHPUnit_Framework_TestCase
1111
{
1212
/** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */
1313
protected $objectManagerHelper;
14+
1415
/** @var \Magento\Backend\Block\Widget\Grid\Column\Renderer\Concat */
1516
protected $renderer;
1617

17-
public function setUp()
18+
protected function setUp()
1819
{
1920
$this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
2021
$this->renderer = $this->objectManagerHelper->getObject(

app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheCommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract class AbstractCacheCommandTest extends \PHPUnit_Framework_TestCase
2020
*/
2121
protected $command;
2222

23-
public function setUp()
23+
protected function setUp()
2424
{
2525
$this->cacheManagerMock = $this->getMock('Magento\Framework\App\Cache\Manager', [], [], '', false);
2626
}

app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheManageCommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ abstract class AbstractCacheManageCommandTest extends AbstractCacheCommandTest
1616
/** @var \Magento\Framework\Event\ManagerInterface | \PHPUnit_Framework_MockObject_MockObject */
1717
protected $eventManagerMock;
1818

19-
public function setUp()
19+
protected function setUp()
2020
{
2121
$this->eventManagerMock = $this->getMockBuilder('\Magento\Framework\Event\ManagerInterface')
2222
->disableOriginalConstructor()

app/code/Magento/Backend/Test/Unit/Console/Command/CacheCleanCommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class CacheCleanCommandTest extends AbstractCacheManageCommandTest
1313
{
14-
public function setUp()
14+
protected function setUp()
1515
{
1616
$this->cacheEventName = 'adminhtml_cache_flush_system';
1717
parent::setUp();

app/code/Magento/Backend/Test/Unit/Console/Command/CacheDisableCommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class CacheDisableCommandTest extends AbstractCacheSetCommandTest
1313
{
14-
public function setUp()
14+
protected function setUp()
1515
{
1616
parent::setUp();
1717
$this->command = new CacheDisableCommand($this->cacheManagerMock);

app/code/Magento/Backend/Test/Unit/Console/Command/CacheEnableCommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class CacheEnableCommandTest extends AbstractCacheSetCommandTest
1313
{
14-
public function setUp()
14+
protected function setUp()
1515
{
1616
parent::setUp();
1717
$this->command = new CacheEnableCommand($this->cacheManagerMock);

app/code/Magento/Backend/Test/Unit/Console/Command/CacheFlushCommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class CacheFlushCommandTest extends AbstractCacheManageCommandTest
1313
{
14-
public function setUp()
14+
protected function setUp()
1515
{
1616
$this->cacheEventName = 'adminhtml_cache_flush_all';
1717
parent::setUp();

app/code/Magento/Backend/Test/Unit/Console/Command/CacheStatusCommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class CacheStatusCommandTest extends AbstractCacheCommandTest
1313
{
14-
public function setUp()
14+
protected function setUp()
1515
{
1616
parent::setUp();
1717
$this->command = new CacheStatusCommand($this->cacheManagerMock);

app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/RefreshStatisticsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class RefreshStatisticsTest extends \PHPUnit_Framework_TestCase
5656
*/
5757
protected $context;
5858

59-
public function setUp()
59+
protected function setUp()
6060
{
6161
$reportTypes = [
6262
'sales' => 'Magento\Sales\Model\ResourceModel\Report\Order'

app/code/Magento/Backend/Test/Unit/Model/AdminPathConfigTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AdminPathConfigTest extends \PHPUnit_Framework_TestCase
3030
*/
3131
protected $adminPathConfig;
3232

33-
public function setUp()
33+
protected function setUp()
3434
{
3535
$this->coreConfig = $this->getMockForAbstractClass(
3636
'Magento\Framework\App\Config\ScopeConfigInterface',

app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php

+51
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,58 @@ public function testIsLoggedInPositive()
162162

163163
public function testProlong()
164164
{
165+
$name = session_name();
166+
$cookie = 'cookie';
167+
$path = '/';
168+
$domain = 'magento2';
169+
$secure = true;
170+
$httpOnly = true;
171+
172+
$cookieMetadata = $this->getMock('Magento\Framework\Stdlib\Cookie\PublicCookieMetadata');
173+
$cookieMetadata->expects($this->once())
174+
->method('setPath')
175+
->with($path)
176+
->will($this->returnSelf());
177+
$cookieMetadata->expects($this->once())
178+
->method('setDomain')
179+
->with($domain)
180+
->will($this->returnSelf());
181+
$cookieMetadata->expects($this->once())
182+
->method('setSecure')
183+
->with($secure)
184+
->will($this->returnSelf());
185+
$cookieMetadata->expects($this->once())
186+
->method('setHttpOnly')
187+
->with($httpOnly)
188+
->will($this->returnSelf());
189+
190+
$this->cookieMetadataFactory->expects($this->once())
191+
->method('createPublicCookieMetadata')
192+
->will($this->returnValue($cookieMetadata));
193+
194+
$this->cookieManager->expects($this->once())
195+
->method('getCookie')
196+
->with($name)
197+
->will($this->returnValue($cookie));
198+
$this->cookieManager->expects($this->once())
199+
->method('setPublicCookie')
200+
->with($name, $cookie, $cookieMetadata);
201+
202+
$this->sessionConfig->expects($this->once())
203+
->method('getCookiePath')
204+
->will($this->returnValue($path));
205+
$this->sessionConfig->expects($this->once())
206+
->method('getCookieDomain')
207+
->will($this->returnValue($domain));
208+
$this->sessionConfig->expects($this->once())
209+
->method('getCookieSecure')
210+
->will($this->returnValue($secure));
211+
$this->sessionConfig->expects($this->once())
212+
->method('getCookieHttpOnly')
213+
->will($this->returnValue($httpOnly));
214+
165215
$this->session->prolong();
216+
166217
$this->assertLessThanOrEqual(time(), $this->session->getUpdatedAt());
167218
}
168219

app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class DownloadTest extends \PHPUnit_Framework_TestCase
8484
*/
8585
protected $resultRedirectMock;
8686

87-
public function setUp()
87+
protected function setUp()
8888
{
8989
$this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface')
9090
->getMock();

app/code/Magento/Backup/Test/Unit/Helper/DataTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DataTest extends \PHPUnit_Framework_TestCase
2121
*/
2222
protected $filesystem;
2323

24-
public function setUp()
24+
protected function setUp()
2525
{
2626
$this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem')->disableOriginalConstructor()
2727
->getMock();

app/code/Magento/Backup/Test/Unit/Model/BackupTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class BackupTest extends \PHPUnit_Framework_TestCase
3838
*/
3939
protected $directoryMock;
4040

41-
public function setUp()
41+
protected function setUp()
4242
{
4343
$this->filesystemMock = $this->getMockBuilder('Magento\Framework\Filesystem')
4444
->disableOriginalConstructor()

app/code/Magento/Braintree/Test/Unit/Gateway/Http/TransferFactoryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class TransferFactoryTest extends \PHPUnit_Framework_TestCase
2929
*/
3030
private $transferBuilder;
3131

32-
public function setUp()
32+
protected function setUp()
3333
{
3434
$this->transferBuilder = $this->getMock(TransferBuilder::class);
3535
$this->transferMock = $this->getMock(TransferInterface::class);

app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class AddressDataBuilderTest extends \PHPUnit_Framework_TestCase
3636
*/
3737
private $subjectReaderMock;
3838

39-
public function setUp()
39+
protected function setUp()
4040
{
4141
$this->paymentDOMock = $this->getMock(PaymentDataObjectInterface::class);
4242
$this->orderMock = $this->getMock(OrderAdapterInterface::class);

app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class CustomerDataBuilderTest extends \PHPUnit_Framework_TestCase
3636
*/
3737
private $subjectReaderMock;
3838

39-
public function setUp()
39+
protected function setUp()
4040
{
4141
$this->paymentDOMock = $this->getMock(PaymentDataObjectInterface::class);
4242
$this->orderMock = $this->getMock(OrderAdapterInterface::class);

0 commit comments

Comments
 (0)