diff --git a/.travis.yml b/.travis.yml index e078e89011dc..2604366c3955 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,7 @@ env: - TEST_SUITE=integration_part_1 - TEST_SUITE=integration_part_2 - TEST_SUITE=integration_integrity - - TEST_SUITE=static_phpcs - - TEST_SUITE=static_annotation + - TEST_SUITE=static cache: apt: true directories: @@ -21,9 +20,9 @@ cache: matrix: exclude: - php: 5.6 - env: TEST_SUITE=static_phpcs - - php: 5.6 - env: TEST_SUITE=static_annotation + env: TEST_SUITE=static + - php: 7.0 + env: TEST_SUITE=static before_install: - sudo apt-get update -qq - sudo apt-get install -y -qq postfix @@ -68,6 +67,4 @@ script: # Integration integrity tests - sh -c "if [ '$TEST_SUITE' = 'integration_integrity' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.dist testsuite/Magento/Test/Integrity; fi" # Static tests [Code Style] - - 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" - # Static tests [Code Style] - - 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" + - 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" diff --git a/README.md b/README.md index c61c57430a58..5a1316959d79 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=master)](https://travis-ci.org/magento/magento2) +[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=develop)](https://travis-ci.org/magento/magento2) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

Welcome

Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results. diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php index 42ebab7a79a1..118f70a34f00 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php @@ -33,8 +33,7 @@ class TierPriceTest extends \PHPUnit_Framework_TestCase */ protected $tierPrice; - - public function setUp() + protected function setUp() { $this->groupRepository = $this->getMockBuilder('\Magento\Customer\Api\GroupRepositoryInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php index f274f8911273..179c4378c7d1 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php @@ -25,7 +25,7 @@ class WebsiteTest extends \PHPUnit_Framework_TestCase */ protected $website; - public function setUp() + protected function setUp() { $this->webSiteModel = $this->getMock( '\Magento\Store\Model\WebSite', diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/ValidatorTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/ValidatorTest.php index c4999f613564..df3d282774ca 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/ValidatorTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/ValidatorTest.php @@ -25,7 +25,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase */ protected $validatorTest; - public function setUp() + protected function setUp() { $this->validatorTest = $this->getMockForAbstractClass( 'Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface', diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php index d61e82447970..7cff6cf4278a 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php @@ -123,7 +123,7 @@ class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\A */ protected $errorAggregator; - public function setUp() + protected function setUp() { parent::setUp(); diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php index 0db44e79e6b3..28314b048563 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php @@ -25,7 +25,7 @@ class ImportTest extends \PHPUnit_Framework_TestCase */ protected $advancedPricing; - public function setUp() + protected function setUp() { $this->indexer = $this->getMockForAbstractClass('\Magento\Framework\Indexer\IndexerInterface', [], '', false); $this->import = $this->getMock( diff --git a/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php b/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php index bb423bc8d54d..7fe9f7a4c677 100644 --- a/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php +++ b/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php @@ -33,6 +33,7 @@ class PlaceTest extends \PHPUnit_Framework_TestCase * @var ObjectManager */ protected $objectManager; + /** * @var Place */ @@ -98,7 +99,7 @@ class PlaceTest extends \PHPUnit_Framework_TestCase */ protected $checkoutSessionMock; - public function setUp() + protected function setUp() { $this->directpostSessionMock = $this ->getMockBuilder('Magento\Authorizenet\Model\Directpost\Session') diff --git a/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/SessionTest.php b/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/SessionTest.php index 877e8a2ca67f..7a56d4154cf8 100644 --- a/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/SessionTest.php +++ b/app/code/Magento/Authorizenet/Test/Unit/Model/Directpost/SessionTest.php @@ -26,7 +26,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase */ protected $storageMock; - public function setUp() + protected function setUp() { $this->storageMock = $this ->getMockBuilder('Magento\Framework\Session\StorageInterface') diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php index c427012e7075..52761266b644 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php @@ -47,6 +47,7 @@ public function __construct( * Retrieve date format * * @return string + * @deprecated */ protected function _getFormat() { @@ -74,16 +75,18 @@ protected function _getFormat() */ public function render(\Magento\Framework\DataObject $row) { - if ($data = $row->getData($this->getColumn()->getIndex())) { - $timezone = $this->getColumn()->getTimezone() !== false ? $this->_localeDate->getConfigTimezone() : 'UTC'; - return $this->dateTimeFormatter->formatObject( - $this->_localeDate->date( - new \DateTime( - $data, - new \DateTimeZone($timezone) - ) - ), - $this->_getFormat() + $format = $this->getColumn()->getFormat(); + $date = $this->_getValue($row); + if ($date) { + if (!($date instanceof \DateTimeInterface)) { + $date = new \DateTime($date); + } + return $this->_localeDate->formatDateTime( + $date, + $format ?: \IntlDateFormatter::MEDIUM, + \IntlDateFormatter::NONE, + null, + $this->getColumn()->getTimezone() === false ? 'UTC' : null ); } return $this->getColumn()->getDefault(); diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php index 2ed10e37a0d4..e525272247dd 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php @@ -20,13 +20,17 @@ class Datetime extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstra public function render(\Magento\Framework\DataObject $row) { $format = $this->getColumn()->getFormat(); - if ($date = $this->_getValue($row)) { + $date = $this->_getValue($row); + if ($date) { + if (!($date instanceof \DateTimeInterface)) { + $date = new \DateTime($date); + } return $this->_localeDate->formatDateTime( - $date instanceof \DateTimeInterface ? $date : new \DateTime($date), + $date, $format ?: \IntlDateFormatter::MEDIUM, $format ?: \IntlDateFormatter::MEDIUM, null, - $this->getColumn()->getTimezone() !== false ? null : 'UTC' + $this->getColumn()->getTimezone() === false ? 'UTC' : null ); } return $this->getColumn()->getDefault(); diff --git a/app/code/Magento/Backend/Model/Auth/Session.php b/app/code/Magento/Backend/Model/Auth/Session.php index 6b6c5a300b6b..088d018cde65 100644 --- a/app/code/Magento/Backend/Model/Auth/Session.php +++ b/app/code/Magento/Backend/Model/Auth/Session.php @@ -177,7 +177,16 @@ public function isLoggedIn() */ public function prolong() { - $this->setUpdatedAt(time()); + $cookieValue = $this->cookieManager->getCookie($this->getName()); + if ($cookieValue) { + $this->setUpdatedAt(time()); + $cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata() + ->setPath($this->sessionConfig->getCookiePath()) + ->setDomain($this->sessionConfig->getCookieDomain()) + ->setSecure($this->sessionConfig->getCookieSecure()) + ->setHttpOnly($this->sessionConfig->getCookieHttpOnly()); + $this->cookieManager->setPublicCookie($this->getName(), $cookieValue, $cookieMetadata); + } } /** diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/ConcatTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/ConcatTest.php index db7aef81375a..3cb3eec4139c 100644 --- a/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/ConcatTest.php +++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Renderer/ConcatTest.php @@ -11,10 +11,11 @@ class ConcatTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ protected $objectManagerHelper; + /** @var \Magento\Backend\Block\Widget\Grid\Column\Renderer\Concat */ protected $renderer; - public function setUp() + protected function setUp() { $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->renderer = $this->objectManagerHelper->getObject( diff --git a/app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheCommandTest.php b/app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheCommandTest.php index f49811f72fb2..dea803da79f7 100644 --- a/app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheCommandTest.php +++ b/app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheCommandTest.php @@ -20,7 +20,7 @@ abstract class AbstractCacheCommandTest extends \PHPUnit_Framework_TestCase */ protected $command; - public function setUp() + protected function setUp() { $this->cacheManagerMock = $this->getMock('Magento\Framework\App\Cache\Manager', [], [], '', false); } diff --git a/app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheManageCommandTest.php b/app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheManageCommandTest.php index e0f1e425e994..010b324d5bd2 100644 --- a/app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheManageCommandTest.php +++ b/app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheManageCommandTest.php @@ -16,7 +16,7 @@ abstract class AbstractCacheManageCommandTest extends AbstractCacheCommandTest /** @var \Magento\Framework\Event\ManagerInterface | \PHPUnit_Framework_MockObject_MockObject */ protected $eventManagerMock; - public function setUp() + protected function setUp() { $this->eventManagerMock = $this->getMockBuilder('\Magento\Framework\Event\ManagerInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheCleanCommandTest.php b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheCleanCommandTest.php index ebd3263ef56a..1c72ce9a2c9f 100644 --- a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheCleanCommandTest.php +++ b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheCleanCommandTest.php @@ -11,7 +11,7 @@ class CacheCleanCommandTest extends AbstractCacheManageCommandTest { - public function setUp() + protected function setUp() { $this->cacheEventName = 'adminhtml_cache_flush_system'; parent::setUp(); diff --git a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheDisableCommandTest.php b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheDisableCommandTest.php index e2e9644717bc..feb7a192c824 100644 --- a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheDisableCommandTest.php +++ b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheDisableCommandTest.php @@ -11,7 +11,7 @@ class CacheDisableCommandTest extends AbstractCacheSetCommandTest { - public function setUp() + protected function setUp() { parent::setUp(); $this->command = new CacheDisableCommand($this->cacheManagerMock); diff --git a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheEnableCommandTest.php b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheEnableCommandTest.php index a1413db2806d..b11b217517c8 100644 --- a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheEnableCommandTest.php +++ b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheEnableCommandTest.php @@ -11,7 +11,7 @@ class CacheEnableCommandTest extends AbstractCacheSetCommandTest { - public function setUp() + protected function setUp() { parent::setUp(); $this->command = new CacheEnableCommand($this->cacheManagerMock); diff --git a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheFlushCommandTest.php b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheFlushCommandTest.php index 68881bd2a78e..2257228f90a6 100644 --- a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheFlushCommandTest.php +++ b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheFlushCommandTest.php @@ -11,7 +11,7 @@ class CacheFlushCommandTest extends AbstractCacheManageCommandTest { - public function setUp() + protected function setUp() { $this->cacheEventName = 'adminhtml_cache_flush_all'; parent::setUp(); diff --git a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheStatusCommandTest.php b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheStatusCommandTest.php index e07270ec18a3..57001e04ac7c 100644 --- a/app/code/Magento/Backend/Test/Unit/Console/Command/CacheStatusCommandTest.php +++ b/app/code/Magento/Backend/Test/Unit/Console/Command/CacheStatusCommandTest.php @@ -11,7 +11,7 @@ class CacheStatusCommandTest extends AbstractCacheCommandTest { - public function setUp() + protected function setUp() { parent::setUp(); $this->command = new CacheStatusCommand($this->cacheManagerMock); diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/RefreshStatisticsTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/RefreshStatisticsTest.php index 1859688508a4..1fd0322a2c9f 100644 --- a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/RefreshStatisticsTest.php +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/RefreshStatisticsTest.php @@ -56,7 +56,7 @@ class RefreshStatisticsTest extends \PHPUnit_Framework_TestCase */ protected $context; - public function setUp() + protected function setUp() { $reportTypes = [ 'sales' => 'Magento\Sales\Model\ResourceModel\Report\Order' diff --git a/app/code/Magento/Backend/Test/Unit/Model/AdminPathConfigTest.php b/app/code/Magento/Backend/Test/Unit/Model/AdminPathConfigTest.php index b82135956896..72b42befb215 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/AdminPathConfigTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/AdminPathConfigTest.php @@ -30,7 +30,7 @@ class AdminPathConfigTest extends \PHPUnit_Framework_TestCase */ protected $adminPathConfig; - public function setUp() + protected function setUp() { $this->coreConfig = $this->getMockForAbstractClass( 'Magento\Framework\App\Config\ScopeConfigInterface', diff --git a/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php b/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php index e415f6d378fe..f903c38a44bd 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php @@ -162,7 +162,58 @@ public function testIsLoggedInPositive() public function testProlong() { + $name = session_name(); + $cookie = 'cookie'; + $path = '/'; + $domain = 'magento2'; + $secure = true; + $httpOnly = true; + + $cookieMetadata = $this->getMock('Magento\Framework\Stdlib\Cookie\PublicCookieMetadata'); + $cookieMetadata->expects($this->once()) + ->method('setPath') + ->with($path) + ->will($this->returnSelf()); + $cookieMetadata->expects($this->once()) + ->method('setDomain') + ->with($domain) + ->will($this->returnSelf()); + $cookieMetadata->expects($this->once()) + ->method('setSecure') + ->with($secure) + ->will($this->returnSelf()); + $cookieMetadata->expects($this->once()) + ->method('setHttpOnly') + ->with($httpOnly) + ->will($this->returnSelf()); + + $this->cookieMetadataFactory->expects($this->once()) + ->method('createPublicCookieMetadata') + ->will($this->returnValue($cookieMetadata)); + + $this->cookieManager->expects($this->once()) + ->method('getCookie') + ->with($name) + ->will($this->returnValue($cookie)); + $this->cookieManager->expects($this->once()) + ->method('setPublicCookie') + ->with($name, $cookie, $cookieMetadata); + + $this->sessionConfig->expects($this->once()) + ->method('getCookiePath') + ->will($this->returnValue($path)); + $this->sessionConfig->expects($this->once()) + ->method('getCookieDomain') + ->will($this->returnValue($domain)); + $this->sessionConfig->expects($this->once()) + ->method('getCookieSecure') + ->will($this->returnValue($secure)); + $this->sessionConfig->expects($this->once()) + ->method('getCookieHttpOnly') + ->will($this->returnValue($httpOnly)); + $this->session->prolong(); + $this->assertLessThanOrEqual(time(), $this->session->getUpdatedAt()); } diff --git a/app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php b/app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php index 5c34de4facb8..bee6a05b305e 100644 --- a/app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php +++ b/app/code/Magento/Backup/Test/Unit/Controller/Adminhtml/Index/DownloadTest.php @@ -84,7 +84,7 @@ class DownloadTest extends \PHPUnit_Framework_TestCase */ protected $resultRedirectMock; - public function setUp() + protected function setUp() { $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') ->getMock(); diff --git a/app/code/Magento/Backup/Test/Unit/Helper/DataTest.php b/app/code/Magento/Backup/Test/Unit/Helper/DataTest.php index ebd02a67d793..2e21668d037f 100644 --- a/app/code/Magento/Backup/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Backup/Test/Unit/Helper/DataTest.php @@ -21,7 +21,7 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected $filesystem; - public function setUp() + protected function setUp() { $this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem')->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Backup/Test/Unit/Model/BackupTest.php b/app/code/Magento/Backup/Test/Unit/Model/BackupTest.php index 62b3974846dc..d43af8b18790 100644 --- a/app/code/Magento/Backup/Test/Unit/Model/BackupTest.php +++ b/app/code/Magento/Backup/Test/Unit/Model/BackupTest.php @@ -38,7 +38,7 @@ class BackupTest extends \PHPUnit_Framework_TestCase */ protected $directoryMock; - public function setUp() + protected function setUp() { $this->filesystemMock = $this->getMockBuilder('Magento\Framework\Filesystem') ->disableOriginalConstructor() diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/TransferFactoryTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/TransferFactoryTest.php index 6b1dd5aaa93e..ca8b8577c397 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/TransferFactoryTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/TransferFactoryTest.php @@ -29,7 +29,7 @@ class TransferFactoryTest extends \PHPUnit_Framework_TestCase */ private $transferBuilder; - public function setUp() + protected function setUp() { $this->transferBuilder = $this->getMock(TransferBuilder::class); $this->transferMock = $this->getMock(TransferInterface::class); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php index c325ea31650f..f52a3e47b0df 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php @@ -36,7 +36,7 @@ class AddressDataBuilderTest extends \PHPUnit_Framework_TestCase */ private $subjectReaderMock; - public function setUp() + protected function setUp() { $this->paymentDOMock = $this->getMock(PaymentDataObjectInterface::class); $this->orderMock = $this->getMock(OrderAdapterInterface::class); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php index 04da06af60f3..16bc6502d5d7 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php @@ -36,7 +36,7 @@ class CustomerDataBuilderTest extends \PHPUnit_Framework_TestCase */ private $subjectReaderMock; - public function setUp() + protected function setUp() { $this->paymentDOMock = $this->getMock(PaymentDataObjectInterface::class); $this->orderMock = $this->getMock(OrderAdapterInterface::class); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php index 67369627aedb..c695ad24376b 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php @@ -46,7 +46,7 @@ class KountPaymentDataBuilderTest extends \PHPUnit_Framework_TestCase */ private $subjectReaderMock; - public function setUp() + protected function setUp() { $this->paymentDO = $this->getMock(PaymentDataObjectInterface::class); $this->configMock = $this->getMockBuilder(Config::class) diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php index 640e19ad92d7..47a9a49670eb 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php @@ -15,6 +15,8 @@ /** * Class PaymentDataBuilderTest + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class PaymentDataBuilderTest extends \PHPUnit_Framework_TestCase { @@ -51,7 +53,7 @@ class PaymentDataBuilderTest extends \PHPUnit_Framework_TestCase */ private $orderMock; - public function setUp() + protected function setUp() { $this->paymentDO = $this->getMock(PaymentDataObjectInterface::class); $this->configMock = $this->getMockBuilder(Config::class) diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php index 1db2f862d1e4..239524e04c0e 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php @@ -32,7 +32,7 @@ class RiskDataHandlerTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->subjectReaderMock = $this->getMockBuilder(SubjectReader::class) ->disableOriginalConstructor() diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/CheckboxTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/CheckboxTest.php index 50f86a94bdeb..6fadc2ea3eb5 100644 --- a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/CheckboxTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/CheckboxTest.php @@ -14,7 +14,7 @@ class CheckboxTest extends \PHPUnit_Framework_TestCase */ protected $block; - public function setUp() + protected function setUp() { $this->block = (new ObjectManager($this)) ->getObject('Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Checkbox'); diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/MultiTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/MultiTest.php index 33b9fc790a14..53fe6d8e7db9 100644 --- a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/MultiTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/MultiTest.php @@ -14,7 +14,7 @@ class MultiTest extends \PHPUnit_Framework_TestCase */ protected $block; - public function setUp() + protected function setUp() { $this->block = (new ObjectManager($this)) ->getObject('Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Multi'); diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/RadioTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/RadioTest.php index 2ea428a7c75f..029f57f2f790 100644 --- a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/RadioTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/RadioTest.php @@ -14,7 +14,7 @@ class RadioTest extends \PHPUnit_Framework_TestCase */ protected $block; - public function setUp() + protected function setUp() { $this->block = (new ObjectManager($this)) ->getObject('Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Radio'); diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/SelectTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/SelectTest.php index ef1cdeb34242..22cebbd84d14 100644 --- a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/SelectTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/SelectTest.php @@ -14,7 +14,7 @@ class SelectTest extends \PHPUnit_Framework_TestCase */ protected $block; - public function setUp() + protected function setUp() { $this->block = (new ObjectManager($this)) ->getObject('Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Select'); diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/ExtendTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/ExtendTest.php index 9b053c882da1..d9ecfa28301b 100644 --- a/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/ExtendTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/ExtendTest.php @@ -21,7 +21,7 @@ class ExtendTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes\Extend */ protected $object; - public function setUp() + protected function setUp() { $this->registry = $this->getMockBuilder('Magento\\Framework\\Registry')->disableOriginalConstructor()->getMock( ); diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Plugin/ProductTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Plugin/ProductTest.php index 6b8ebc203ff5..e912d0554f05 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/Plugin/ProductTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/Plugin/ProductTest.php @@ -21,7 +21,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase /** @var MockObject|\Magento\Catalog\Model\Product */ private $product; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Product/Attribute/Source/Price/ViewTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Product/Attribute/Source/Price/ViewTest.php index 18c7077ffb2c..fb6ba5768ca8 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/Product/Attribute/Source/Price/ViewTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/Product/Attribute/Source/Price/ViewTest.php @@ -29,7 +29,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ protected $attribute; - public function setUp() + protected function setUp() { $this->option = $this->getMock('Magento\Eav\Model\ResourceModel\Entity\Attribute\Option', [], [], '', false); $this->optionFactory = $this->getMock( diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/DiscountCalculatorTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/DiscountCalculatorTest.php index abceaa210082..66683f0e1d32 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/DiscountCalculatorTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/DiscountCalculatorTest.php @@ -41,7 +41,7 @@ class DiscountCalculatorTest extends \PHPUnit_Framework_TestCase /** * Test setUp */ - public function setUp() + protected function setUp() { $this->productMock = $this->getMock( 'Magento\Catalog\Model\Product', diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/SpecialPriceTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/SpecialPriceTest.php index e0e51da4d99e..adf3b1ba3af5 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/SpecialPriceTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/SpecialPriceTest.php @@ -34,7 +34,7 @@ class SpecialPriceTest extends \PHPUnit_Framework_TestCase */ protected $priceCurrencyMock; - public function setUp() + protected function setUp() { $this->saleable = $this->getMockBuilder('Magento\Catalog\Model\Product') ->disableOriginalConstructor() diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Render/FinalPriceBoxTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Render/FinalPriceBoxTest.php index fff9ee4e9b35..b64e58bcc6d8 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Render/FinalPriceBoxTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Render/FinalPriceBoxTest.php @@ -21,7 +21,7 @@ class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase */ protected $saleableItem; - public function setUp() + protected function setUp() { $this->saleableItem = $this->getMock('Magento\Framework\Pricing\SaleableInterface'); diff --git a/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php b/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php index 0ac40b7a384e..fede25d36148 100644 --- a/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php +++ b/app/code/Magento/CacheInvalidate/Test/Unit/Model/PurgeCacheTest.php @@ -21,7 +21,7 @@ class PurgeCacheTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\PageCache\Model\Cache\Server */ protected $cacheServer; - public function setUp() + protected function setUp() { $socketFactoryMock = $this->getMock('Magento\CacheInvalidate\Model\SocketFactory', [], [], '', false); $this->socketAdapterMock = $this->getMock('\Zend\Http\Client\Adapter\Socket', [], [], '', false); diff --git a/app/code/Magento/CacheInvalidate/Test/Unit/Observer/FlushAllCacheObserverTest.php b/app/code/Magento/CacheInvalidate/Test/Unit/Observer/FlushAllCacheObserverTest.php index 8ea89dab71fb..f0fafad5467d 100644 --- a/app/code/Magento/CacheInvalidate/Test/Unit/Observer/FlushAllCacheObserverTest.php +++ b/app/code/Magento/CacheInvalidate/Test/Unit/Observer/FlushAllCacheObserverTest.php @@ -16,14 +16,13 @@ class FlushAllCacheObserverTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\PageCache\Model\Config */ protected $configMock; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\CacheInvalidate\Model\PurgeCache */ protected $purgeCache; /** * Set up all mocks and data for test */ - public function setUp() + protected function setUp() { $this->configMock = $this->getMock( 'Magento\PageCache\Model\Config', diff --git a/app/code/Magento/CacheInvalidate/Test/Unit/Observer/InvalidateVarnishObserverTest.php b/app/code/Magento/CacheInvalidate/Test/Unit/Observer/InvalidateVarnishObserverTest.php index 26b7aa966d83..9b59500a8123 100644 --- a/app/code/Magento/CacheInvalidate/Test/Unit/Observer/InvalidateVarnishObserverTest.php +++ b/app/code/Magento/CacheInvalidate/Test/Unit/Observer/InvalidateVarnishObserverTest.php @@ -16,18 +16,16 @@ class InvalidateVarnishObserverTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\PageCache\Model\Config */ protected $configMock; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\CacheInvalidate\Model\PurgeCache */ protected $purgeCache; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\DataObject\ */ protected $observerObject; /** * Set up all mocks and data for test */ - public function setUp() + protected function setUp() { $this->configMock = $this->getMock( 'Magento\PageCache\Model\Config', diff --git a/app/code/Magento/Captcha/Observer/CheckUserLoginObserver.php b/app/code/Magento/Captcha/Observer/CheckUserLoginObserver.php index da1c39c71067..8c909fab7a1a 100644 --- a/app/code/Magento/Captcha/Observer/CheckUserLoginObserver.php +++ b/app/code/Magento/Captcha/Observer/CheckUserLoginObserver.php @@ -160,7 +160,9 @@ public function execute(\Magento\Framework\Event\Observer $observer) $captchaModel = $this->_helper->getCaptcha($formId); $controller = $observer->getControllerAction(); $loginParams = $controller->getRequest()->getPost('login'); - $login = array_key_exists('username', $loginParams) ? $loginParams['username'] : null; + $login = (is_array($loginParams) && array_key_exists('username', $loginParams)) + ? $loginParams['username'] + : null; if ($captchaModel->isRequired($login)) { $word = $this->captchaStringResolver->resolve($controller->getRequest(), $formId); if (!$captchaModel->isCorrect($word)) { diff --git a/app/code/Magento/Captcha/Test/Unit/Cron/DeleteExpiredImagesTest.php b/app/code/Magento/Captcha/Test/Unit/Cron/DeleteExpiredImagesTest.php index 2f76b3cba56c..c03be6c3ee8e 100644 --- a/app/code/Magento/Captcha/Test/Unit/Cron/DeleteExpiredImagesTest.php +++ b/app/code/Magento/Captcha/Test/Unit/Cron/DeleteExpiredImagesTest.php @@ -49,7 +49,7 @@ class DeleteExpiredImagesTest extends \PHPUnit_Framework_TestCase /** * Create mocks and model */ - public function setUp() + protected function setUp() { $this->_helper = $this->getMock('Magento\Captcha\Helper\Data', [], [], '', false); $this->_adminHelper = $this->getMock('Magento\Captcha\Helper\Adminhtml\Data', [], [], '', false); diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Cart/ConfigPluginTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Cart/ConfigPluginTest.php index 379e114c40d2..32345003e3e0 100644 --- a/app/code/Magento/Captcha/Test/Unit/Model/Cart/ConfigPluginTest.php +++ b/app/code/Magento/Captcha/Test/Unit/Model/Cart/ConfigPluginTest.php @@ -17,7 +17,7 @@ class ConfigPluginTest extends \PHPUnit_Framework_TestCase */ protected $configProviderMock; - public function setUp() + protected function setUp() { $this->configProviderMock = $this->getMock('\Magento\Captcha\Model\Checkout\ConfigProvider', [], [], '', false); $this->model = new \Magento\Captcha\Model\Cart\ConfigPlugin( diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php index 8df5a82d939d..dd4a33541104 100644 --- a/app/code/Magento/Catalog/Model/ProductRepository.php +++ b/app/code/Magento/Catalog/Model/ProductRepository.php @@ -512,6 +512,8 @@ public function save(\Magento\Catalog\Api\Data\ProductInterface $product, $saveO if ($tierPrices !== null) { $product->setData('tier_price', $tierPrices); } + unset($this->instances[$product->getSku()]); + unset($this->instancesById[$product->getId()]); $this->resourceModel->save($product); } catch (\Magento\Eav\Model\Entity\Attribute\Exception $exception) { throw \Magento\Framework\Exception\InputException::invalidFieldValue( @@ -535,6 +537,8 @@ public function delete(\Magento\Catalog\Api\Data\ProductInterface $product) $sku = $product->getSku(); $productId = $product->getId(); try { + unset($this->instances[$product->getSku()]); + unset($this->instancesById[$product->getId()]); $this->resourceModel->delete($product); } catch (\Exception $e) { throw new \Magento\Framework\Exception\StateException( diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/CategoryTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/CategoryTest.php index 21ca86f54bd8..ec126f3c4e5a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/CategoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Helper/Form/CategoryTest.php @@ -17,7 +17,7 @@ class CategoryTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->authorization = $this->getMockBuilder('Magento\Framework\AuthorizationInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/AbstractProductTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/AbstractProductTest.php index 7511efb9d02e..7131e8f77a80 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/AbstractProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/AbstractProductTest.php @@ -42,7 +42,7 @@ class AbstractProductTest extends \PHPUnit_Framework_TestCase * Set up mocks and tested class * Child class is used as the tested class is declared abstract */ - public function setUp() + protected function setUp() { $this->productContextMock = $this->getMock( 'Magento\Catalog\Block\Product\Context', diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/CategoriesJsonTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/CategoriesJsonTest.php index 1b12585b46d0..10c0a9c53c25 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/CategoriesJsonTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/CategoriesJsonTest.php @@ -56,7 +56,7 @@ class CategoriesJsonTest extends \PHPUnit_Framework_TestCase */ protected $resultJson; - public function setUp() + protected function setUp() { $this->responseMock = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/ChooserTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/ChooserTest.php index f74d9d0fc72e..7c81b8cb18ea 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/ChooserTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/Widget/ChooserTest.php @@ -51,7 +51,7 @@ class ChooserTest extends \PHPUnit_Framework_TestCase */ protected $resultRaw; - public function setUp() + protected function setUp() { $this->responseMock = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Category/ViewTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Category/ViewTest.php index d7f007d08025..82deb7baba41 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Category/ViewTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Category/ViewTest.php @@ -107,7 +107,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase /** * Set up instances and mock objects */ - public function setUp() + protected function setUp() { $this->request = $this->getMock('Magento\Framework\App\RequestInterface'); $this->response = $this->getMock('Magento\Framework\App\ResponseInterface'); diff --git a/app/code/Magento/Catalog/Test/Unit/Helper/Product/CompareTest.php b/app/code/Magento/Catalog/Test/Unit/Helper/Product/CompareTest.php index b6be20001fa6..d025ebd2f038 100644 --- a/app/code/Magento/Catalog/Test/Unit/Helper/Product/CompareTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Helper/Product/CompareTest.php @@ -48,7 +48,7 @@ class CompareTest extends \PHPUnit_Framework_TestCase */ protected $catalogSessionMock; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Catalog/Test/Unit/Helper/Product/Flat/IndexerTest.php b/app/code/Magento/Catalog/Test/Unit/Helper/Product/Flat/IndexerTest.php index d7f535dec9d4..8109cb673250 100644 --- a/app/code/Magento/Catalog/Test/Unit/Helper/Product/Flat/IndexerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Helper/Product/Flat/IndexerTest.php @@ -39,7 +39,7 @@ class IndexerTest extends \PHPUnit_Framework_TestCase */ protected $_changelogMock; - public function setUp() + protected function setUp() { $contextMock = $this->getMock('Magento\Framework\App\Helper\Context', [], [], '', false); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/ConverterTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/ConverterTest.php index b2f206599a2b..15991c7a0b91 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/ConverterTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Config/ConverterTest.php @@ -12,7 +12,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new \Magento\Catalog\Model\Attribute\Config\Converter(); } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/TreeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/TreeTest.php index 1668de3fe33e..b0105f44f842 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/TreeTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/TreeTest.php @@ -45,7 +45,7 @@ class TreeTest extends \PHPUnit_Framework_TestCase */ protected $node; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php index 61d1d9b63cfd..7acccfcc2a29 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php @@ -48,7 +48,7 @@ class CustomOptionProcessorTest extends \PHPUnit_Framework_TestCase /** @var CustomOptionProcessor */ protected $processor; - public function setUp() + protected function setUp() { $this->objectFactory = $this->getMockBuilder('Magento\Framework\DataObject\Factory') ->setMethods(['create']) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php index ec2686fc3434..e41771ba6245 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php @@ -20,7 +20,7 @@ class CustomOptionTest extends \PHPUnit_Framework_TestCase */ protected $fileProcessor; - public function setUp() + protected function setUp() { $context = $this->getMockBuilder('Magento\Framework\Model\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/AffectCacheTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/AffectCacheTest.php index 723e60e70ac4..d0d3cb3d2fa1 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/AffectCacheTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/AffectCacheTest.php @@ -28,7 +28,7 @@ class AffectCacheTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->subjectMock = $this->getMockForAbstractClass('Magento\Framework\Indexer\ActionInterface', [], '', false, true, true, []); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/AffectCacheTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/AffectCacheTest.php index f733a9e3c17c..a69eb70638a4 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/AffectCacheTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/AffectCacheTest.php @@ -28,7 +28,7 @@ class AffectCacheTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->subjectMock = $this->getMockForAbstractClass('Magento\Framework\Indexer\ActionInterface', [], '', false, true, true, []); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/Action/RowTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/Action/RowTest.php index de00884463d7..18e697706997 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/Action/RowTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/Action/RowTest.php @@ -14,7 +14,7 @@ class RowTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->_model = $objectManager->getObject('Magento\Catalog\Model\Indexer\Product\Eav\Action\Row'); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/Action/RowsTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/Action/RowsTest.php index 02f739dea258..872ae68d45f2 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/Action/RowsTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/Action/RowsTest.php @@ -14,7 +14,7 @@ class RowsTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->_model = $objectManager->getObject('Magento\Catalog\Model\Indexer\Product\Eav\Action\Rows'); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php index 2a6aa7ffeb1d..8dc0004e5d1b 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php @@ -57,7 +57,7 @@ class RowTest extends \PHPUnit_Framework_TestCase */ protected $flatTableBuilder; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowsTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowsTest.php index 1e27375c4a23..e43f8ee575a6 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowsTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowsTest.php @@ -57,7 +57,7 @@ class RowsTest extends \PHPUnit_Framework_TestCase */ protected $_flatTableBuilder; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/ProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/ProcessorTest.php index c823e50c079d..5d4253a00022 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/ProcessorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/ProcessorTest.php @@ -32,7 +32,7 @@ class ProcessorTest extends \PHPUnit_Framework_TestCase */ protected $indexerRegistryMock; - public function setUp() + protected function setUp() { $this->_objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/StateTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/StateTest.php index 60ae4298a3b1..e76ee94475d6 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/StateTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/StateTest.php @@ -17,7 +17,7 @@ class StateTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Action/RowTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Action/RowTest.php index b195b7e940cf..970bc2891d63 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Action/RowTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Action/RowTest.php @@ -14,7 +14,7 @@ class RowTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->_model = $objectManager->getObject('Magento\Catalog\Model\Indexer\Product\Price\Action\Row'); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Action/RowsTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Action/RowsTest.php index 7aa27394bd2b..c52b50ba8f8d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Action/RowsTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Action/RowsTest.php @@ -14,7 +14,7 @@ class RowsTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->_model = $objectManager->getObject('Magento\Catalog\Model\Indexer\Product\Price\Action\Rows'); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Plugin/CustomerGroupTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Plugin/CustomerGroupTest.php index e05178cf4fdd..a1a99ab7a584 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Plugin/CustomerGroupTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Plugin/CustomerGroupTest.php @@ -30,7 +30,7 @@ class CustomerGroupTest extends \PHPUnit_Framework_TestCase */ protected $indexerRegistryMock; - public function setUp() + protected function setUp() { $this->_objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/System/Config/PriceScopeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/System/Config/PriceScopeTest.php index fbcc0eb718cd..cdec8d4b3a8f 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/System/Config/PriceScopeTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/System/Config/PriceScopeTest.php @@ -27,7 +27,7 @@ class PriceScopeTest extends \PHPUnit_Framework_TestCase */ protected $indexerRegistryMock; - public function setUp() + protected function setUp() { $this->_objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -51,7 +51,6 @@ public function setUp() $storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface', [], [], '', false); $configMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); - $this->_model = $this->_objectManager->getObject( 'Magento\Catalog\Model\Indexer\Product\Price\System\Config\PriceScope', [ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layout/DepersonalizePluginTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layout/DepersonalizePluginTest.php index e8192aa75687..f6e1f97aadeb 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Layout/DepersonalizePluginTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Layout/DepersonalizePluginTest.php @@ -32,7 +32,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase */ protected $resultLayout; - public function setUp() + protected function setUp() { $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); $this->catalogSessionMock = $this->getMock('Magento\Catalog\Model\Session', diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php index c5d4ab248ef6..e08d12b93c9c 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/ActionTest.php @@ -47,7 +47,7 @@ class ActionTest extends \PHPUnit_Framework_TestCase */ protected $indexerRegistryMock; - public function setUp() + protected function setUp() { $eventManagerMock = $this->getMock('Magento\Framework\Event\ManagerInterface'); $this->productWebsiteFactory = $this->getMock( diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/EntryConverterPoolTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/EntryConverterPoolTest.php index ce39aaebb64a..b5ff723a7ce8 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/EntryConverterPoolTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/EntryConverterPoolTest.php @@ -28,7 +28,7 @@ class EntryConverterPoolTest extends \PHPUnit_Framework_TestCase */ protected $dataObjectMock; - public function setUp() + protected function setUp() { $this->imageMock = $this->getMock( diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/ImageEntryConverterTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/ImageEntryConverterTest.php index af637fa4600c..0e45b8a2d77b 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/ImageEntryConverterTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/ImageEntryConverterTest.php @@ -37,8 +37,7 @@ class ImageEntryConverterTest extends \PHPUnit_Framework_TestCase */ protected $modelObject; - - public function setUp() + protected function setUp() { $this->mediaGalleryEntryFactoryMock = $this->getMock( diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/CatalogPriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/CatalogPriceTest.php index 37633a218d29..6358d800bdef 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/CatalogPriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/CatalogPriceTest.php @@ -27,7 +27,7 @@ class CatalogPriceTest extends \PHPUnit_Framework_TestCase */ protected $catalogPriceInterfaceMock; - public function setUp() + protected function setUp() { $this->priceFactoryMock = $this->getMock( 'Magento\Catalog\Model\Product\CatalogPriceFactory', diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Type/FileTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Type/FileTest.php index 211a6fc59bfc..7a385fd1fc17 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Type/FileTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Type/FileTest.php @@ -22,7 +22,7 @@ class FileTest extends \PHPUnit_Framework_TestCase */ protected $coreFileStorageDatabase; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/ProductList/ToolbarTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/ProductList/ToolbarTest.php index 9e2d14c12a15..063f85ae4f36 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/ProductList/ToolbarTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/ProductList/ToolbarTest.php @@ -25,7 +25,7 @@ class ToolbarTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') ->disableOriginalConstructor() diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/VisibilityTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/VisibilityTest.php index 793453645edd..d4f731a0cf28 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/VisibilityTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/VisibilityTest.php @@ -14,7 +14,7 @@ class VisibilityTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->_model = $objectManager->getObject('Magento\Catalog\Model\Product\Visibility'); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php index c679df530b62..9bff9496dce3 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php @@ -541,7 +541,7 @@ public function testSaveException() ->willReturn(true); $this->resourceModelMock->expects($this->once())->method('save')->with($this->productMock) ->willThrowException(new \Magento\Eav\Model\Entity\Attribute\Exception(__('123'))); - $this->productMock->expects($this->never())->method('getId'); + $this->productMock->expects($this->once())->method('getId')->willReturn(null); $this->extensibleDataObjectConverterMock ->expects($this->once()) ->method('toNestedArray') @@ -576,7 +576,8 @@ public function testSaveInvalidProductException() public function testDelete() { - $this->productMock->expects($this->once())->method('getSku')->willReturn('product-42'); + $this->productMock->expects($this->exactly(2))->method('getSku')->willReturn('product-42'); + $this->productMock->expects($this->exactly(2))->method('getId')->willReturn(42); $this->resourceModelMock->expects($this->once())->method('delete')->with($this->productMock) ->willReturn(true); $this->assertTrue($this->model->delete($this->productMock)); @@ -588,7 +589,8 @@ public function testDelete() */ public function testDeleteException() { - $this->productMock->expects($this->once())->method('getSku')->willReturn('product-42'); + $this->productMock->expects($this->exactly(2))->method('getSku')->willReturn('product-42'); + $this->productMock->expects($this->exactly(2))->method('getId')->willReturn(42); $this->resourceModelMock->expects($this->once())->method('delete')->with($this->productMock) ->willThrowException(new \Exception()); $this->model->delete($this->productMock); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php index b6793695acbd..9659cba70131 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php @@ -169,7 +169,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { $this->categoryIndexerMock = $this->getMockForAbstractClass('\Magento\Framework\Indexer\IndexerInterface'); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Eav/AttributeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Eav/AttributeTest.php index d0c5fb4470ee..fa59fd635ada 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Eav/AttributeTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Eav/AttributeTest.php @@ -40,7 +40,7 @@ class AttributeTest extends \PHPUnit_Framework_TestCase */ protected $eavConfigMock; - public function setUp() + protected function setUp() { $this->_processor = $this->getMock( 'Magento\Catalog\Model\Indexer\Product\Flat\Processor', diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php index 7536dbf1b3a4..a71d0c95fab1 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php @@ -31,7 +31,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { $entityFactory = $this->getMock('Magento\Framework\Data\Collection\EntityFactory', [], [], '', false); $logger = $this->getMockBuilder('Psr\Log\LoggerInterface') diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/FlatTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/FlatTest.php index efd1d7669371..28c7f8002e5f 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/FlatTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/FlatTest.php @@ -22,7 +22,7 @@ class FlatTest extends \PHPUnit_Framework_TestCase */ protected $_storeManagerInterface; - public function setUp() + protected function setUp() { $this->_store = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/GalleryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/GalleryTest.php index 0b4f90be23f0..9ce9164b62bb 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/GalleryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/GalleryTest.php @@ -48,7 +48,7 @@ class GalleryTest extends \PHPUnit_Framework_TestCase 'metadata' => ['DATA_TYPE' => 'text', 'NULLABLE' => true], ]; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Catalog/Test/Unit/Observer/AddCatalogToTopmenuItemsObserverTest.php b/app/code/Magento/Catalog/Test/Unit/Observer/AddCatalogToTopmenuItemsObserverTest.php index 9d8e6c1f78bc..d44a2482fa97 100644 --- a/app/code/Magento/Catalog/Test/Unit/Observer/AddCatalogToTopmenuItemsObserverTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Observer/AddCatalogToTopmenuItemsObserverTest.php @@ -42,7 +42,7 @@ class AddCatalogToTopmenuItemsObserverTest extends \PHPUnit_Framework_TestCase */ protected $_categoryFlatState; - public function setUp() + protected function setUp() { $this->_catalogCategory = $this->getMock( '\Magento\Catalog\Helper\Category', diff --git a/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php b/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php index fdf43339b1fd..44a9a00716fa 100644 --- a/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php @@ -37,7 +37,7 @@ class MenuCategoryDataTest extends \PHPUnit_Framework_TestCase */ protected $_categoryFlatState; - public function setUp() + protected function setUp() { $this->_catalogCategory = $this->getMock( '\Magento\Catalog\Helper\Category', diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php index 09eb3eefc7be..cb72efc1d75e 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php @@ -56,7 +56,7 @@ class BasePriceTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $qty = 1; $this->saleableItemMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/FinalPriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/FinalPriceTest.php index a7792363feed..be1d6b3e2e11 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/FinalPriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/FinalPriceTest.php @@ -43,7 +43,7 @@ class FinalPriceTest extends \PHPUnit_Framework_TestCase /** * Set up function */ - public function setUp() + protected function setUp() { $this->saleableMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); $this->priceInfoMock = $this->basePriceMock = $this->getMock( diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/SpecialPriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/SpecialPriceTest.php index 42e2a99eebbd..9f1425ff0781 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/SpecialPriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/SpecialPriceTest.php @@ -18,7 +18,7 @@ class SpecialPriceTest extends \PHPUnit_Framework_TestCase */ protected $priceCurrencyMock; - public function setUp() + protected function setUp() { $this->priceCurrencyMock = $this->getMock('\Magento\Framework\Pricing\PriceCurrencyInterface'); diff --git a/app/code/Magento/Catalog/Test/Unit/Webapi/Product/Option/Type/File/ValidatorTest.php b/app/code/Magento/Catalog/Test/Unit/Webapi/Product/Option/Type/File/ValidatorTest.php index e1d36ed15b0e..898a658e6972 100644 --- a/app/code/Magento/Catalog/Test/Unit/Webapi/Product/Option/Type/File/ValidatorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Webapi/Product/Option/Type/File/ValidatorTest.php @@ -36,7 +36,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase /** @var Validator */ protected $validator; - public function setUp() + protected function setUp() { $this->scopeConfig = $this->getMockForAbstractClass( 'Magento\Framework\App\Config\ScopeConfigInterface', diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/SkuProcessorTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/SkuProcessorTest.php index 8822dd13f297..338a400d980c 100644 --- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/SkuProcessorTest.php +++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/SkuProcessorTest.php @@ -19,7 +19,7 @@ class SkuProcessorTest extends \PHPUnit_Framework_TestCase */ protected $skuProcessor; - public function setUp() + protected function setUp() { $this->productFactory = $this->getMock(\Magento\Catalog\Model\ProductFactory::class, [], [], '', false); $this->skuProcessor = $this->getMock( diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php index 1303ae643b01..ad72596df511 100644 --- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php +++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Indexer/Product/Price/Plugin/ImportTest.php @@ -27,7 +27,7 @@ class ImportTest extends \PHPUnit_Framework_TestCase */ protected $indexerRegistryMock; - public function setUp() + protected function setUp() { $this->_objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/RowTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/RowTest.php index 84b595aab149..3c2ebb7f3aef 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/RowTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/RowTest.php @@ -18,7 +18,7 @@ class RowTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->_model = $objectManager->getObject('Magento\CatalogInventory\Model\Indexer\Stock\Action\Row'); diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/RowsTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/RowsTest.php index 93dd08374a3d..794b53972ba7 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/RowsTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/RowsTest.php @@ -18,7 +18,7 @@ class RowsTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->_model = $objectManager->getObject('Magento\CatalogInventory\Model\Indexer\Stock\Action\Rows'); diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Plugin/StoreGroupTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Plugin/StoreGroupTest.php index 4910ef5ffc57..c47bd0b88241 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Plugin/StoreGroupTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Plugin/StoreGroupTest.php @@ -21,7 +21,7 @@ class StoreGroupTest extends \PHPUnit_Framework_TestCase */ protected $_indexerMock; - public function setUp() + protected function setUp() { $this->_indexerMock = $this->getMock( '\Magento\CatalogInventory\Model\Indexer\Stock\Processor', diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/LayerTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/LayerTest.php index 4ce995eea19c..1b58c7b59858 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/LayerTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/LayerTest.php @@ -22,7 +22,7 @@ class LayerTest extends \PHPUnit_Framework_TestCase */ protected $_stockHelperMock; - public function setUp() + protected function setUp() { $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); $this->_stockHelperMock = $this->getMock( diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php index d3df8322bbc4..3dadbe431a8d 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/ProductLinksTest.php @@ -22,7 +22,7 @@ class ProductLinksTest extends \PHPUnit_Framework_TestCase */ protected $stockHelperMock; - public function setUp() + protected function setUp() { $this->configMock = $this->getMock( 'Magento\CatalogInventory\Model\Configuration', @@ -57,7 +57,6 @@ public function testAfterGetProductCollectionShow($status, $callCount) ->method('addInStockFilterToCollection') ->with($collectionMock); - $this->assertEquals($collectionMock, $this->model->afterGetProductCollection($subjectMock, $collectionMock)); } diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QtyProcessorTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QtyProcessorTest.php index 5f8278c48230..9bbf45cef5af 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QtyProcessorTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/Initializer/QtyProcessorTest.php @@ -24,7 +24,7 @@ class QtyProcessorTest extends \PHPUnit_Framework_TestCase */ protected $itemMock; - public function setUp() + protected function setUp() { $this->quoteItemQtyList = $this->getMockBuilder( 'Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\QuoteItemQtyList' diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/StockRegistryTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/StockRegistryTest.php index 4dafc8d1b107..9631e7082761 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/StockRegistryTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/StockRegistryTest.php @@ -20,7 +20,7 @@ class StockRegistryTest extends \PHPUnit_Framework_TestCase */ protected $criteria; - public function setUp() + protected function setUp() { $this->criteria = $this->getMockBuilder('Magento\CatalogInventory\Api\StockItemCriteriaInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php index 22210db2c1f6..b365f0b84b4e 100644 --- a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php +++ b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php @@ -250,16 +250,8 @@ public function save(\Magento\Framework\Model\AbstractModel $object) if ($object->isDeleted()) { return $this->delete($object); } - $this->beginTransaction(); - try { - if (!$this->isModified($object)) { - $this->processNotModifiedSave($object); - $this->commit(); - $object->setHasDataChanges(false); - return $this; - } $object->validateBeforeSave(); $object->beforeSave(); if ($object->isSaveAllowed()) { diff --git a/app/code/Magento/CatalogRule/Test/Unit/Pricing/Price/CatalogRulePriceTest.php b/app/code/Magento/CatalogRule/Test/Unit/Pricing/Price/CatalogRulePriceTest.php index 74788c7f3439..d1def1b1fe5a 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Pricing/Price/CatalogRulePriceTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Pricing/Price/CatalogRulePriceTest.php @@ -76,7 +76,7 @@ class CatalogRulePriceTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->saleableItemMock = $this->getMock( 'Magento\Catalog\Model\Product', diff --git a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml index 001112afad2a..b34ce89d6886 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/layout/catalog_rule_promo_catalog_block.xml @@ -45,6 +45,7 @@ Start date + false from_date col-date col-date @@ -54,6 +55,7 @@ End date + false -- to_date col-date diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Block/ResultTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Block/ResultTest.php index 70ec7b2b1a01..0a8825defde5 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Block/ResultTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Block/ResultTest.php @@ -35,7 +35,7 @@ class ResultTest extends \PHPUnit_Framework_TestCase */ protected $childBlockMock; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false); $this->layerMock = $this->getMock('Magento\Catalog\Model\Layer\Search', [], [], '', false); diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Action/FullTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Action/FullTest.php index a780ac8c704d..31417978f04b 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Action/FullTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Action/FullTest.php @@ -10,12 +10,14 @@ class FullTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Framework\Search\Request\Config|\PHPUnit_Framework_MockObject_MockObject */ protected $searchRequestConfig; + /** @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $storeManager; + /** @var \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\Full */ protected $object; - public function setUp() + protected function setUp() { $resource = $this->getMockBuilder('Magento\Framework\App\ResourceConnection') ->disableOriginalConstructor() diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php index 85d0976e630f..aa1c46410d3a 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/ReaderPluginTest.php @@ -9,12 +9,14 @@ class ReaderPluginTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\CatalogSearch\Model\Search\RequestGenerator|\PHPUnit_Framework_MockObject_MockObject */ protected $requestGenerator; + /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ protected $objectManagerHelper; + /** @var \Magento\CatalogSearch\Model\Search\ReaderPlugin */ protected $object; - public function setUp() + protected function setUp() { $this->requestGenerator = $this->getMockBuilder('Magento\\CatalogSearch\\Model\\Search\\RequestGenerator') ->disableOriginalConstructor() diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGeneratorTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGeneratorTest.php index 02d3c035e56b..949a95e64592 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGeneratorTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGeneratorTest.php @@ -18,7 +18,7 @@ class RequestGeneratorTest extends \PHPUnit_Framework_TestCase /** @var CollectionFactory | \PHPUnit_Framework_MockObject_MockObject */ protected $productAttributeCollectionFactory; - public function setUp() + protected function setUp() { $this->productAttributeCollectionFactory = $this->getMockBuilder('Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory') diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/AfterImportDataObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/AfterImportDataObserverTest.php index 9e2e30904fc9..5fafdc2bc77d 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/AfterImportDataObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/AfterImportDataObserverTest.php @@ -144,7 +144,7 @@ class AfterImportDataObserverTest extends \PHPUnit_Framework_TestCase * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.NPathComplexity) */ - public function setUp() + protected function setUp() { $this->importProduct = $this->getMock( '\Magento\CatalogImportExport\Model\Import\Product', diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ClearProductUrlsObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ClearProductUrlsObserverTest.php index 00227b877297..3db32731bc20 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ClearProductUrlsObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ClearProductUrlsObserverTest.php @@ -77,7 +77,7 @@ class ClearProductUrlsObserverTest extends \PHPUnit_Framework_TestCase /** * @SuppressWarnings(PHPMD.TooManyFields) */ - public function setUp() + protected function setUp() { $this->importProduct = $this->getMock( '\Magento\CatalogImportExport\Model\Import\Product', diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php index da445431a2fa..ff2a32439a2a 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php @@ -18,7 +18,7 @@ class TotalsProcessorTest extends \PHPUnit_Framework_TestCase */ protected $scopeConfigMock; - public function setUp() + protected function setUp() { $this->scopeConfigMock = $this->getMock( '\Magento\Framework\App\Config\ScopeConfigInterface', diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Account/CreateTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Account/CreateTest.php index f2a288f313d4..31f1fffa6753 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Account/CreateTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Account/CreateTest.php @@ -35,7 +35,7 @@ class CreateTest extends \PHPUnit_Framework_TestCase */ protected $orderCustomerService; - public function setUp() + protected function setUp() { $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->checkoutSession = $this->getMock('\Magento\Checkout\Model\Session', ['getLastOrderId'], [], '', false); diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Cart/ConfigureTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Cart/ConfigureTest.php index 8da58ff5e0c2..d16c1a2dc770 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Cart/ConfigureTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Cart/ConfigureTest.php @@ -57,7 +57,7 @@ class ConfigureTest extends \PHPUnit_Framework_TestCase */ protected $cartMock; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('Magento\Framework\App\Action\Context', [], [], '', false); $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Cart/CouponPostTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Cart/CouponPostTest.php index 37a234478180..84013abfc78b 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Cart/CouponPostTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Cart/CouponPostTest.php @@ -70,7 +70,7 @@ class CouponPostTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); $this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Cart/IndexTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Cart/IndexTest.php index f6550e9d1808..0b5fc306fb97 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Cart/IndexTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Cart/IndexTest.php @@ -70,7 +70,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); $this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php index 45811c3eaf0c..19640afccd86 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php @@ -100,7 +100,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase */ protected $resultRedirectMock; - public function setUp() + protected function setUp() { // mock objects $this->objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Checkout/Test/Unit/CustomerData/CartTest.php b/app/code/Magento/Checkout/Test/Unit/CustomerData/CartTest.php index a0cb167dc36b..f7ee1fb11234 100644 --- a/app/code/Magento/Checkout/Test/Unit/CustomerData/CartTest.php +++ b/app/code/Magento/Checkout/Test/Unit/CustomerData/CartTest.php @@ -43,7 +43,7 @@ class CartTest extends \PHPUnit_Framework_TestCase */ protected $layoutMock; - public function setUp() + protected function setUp() { $this->checkoutSessionMock = $this->getMock('\Magento\Checkout\Model\Session', [], [], '', false); $this->catalogUrlMock = $this->getMock( diff --git a/app/code/Magento/Checkout/Test/Unit/Helper/ExpressRedirectTest.php b/app/code/Magento/Checkout/Test/Unit/Helper/ExpressRedirectTest.php index 56404fec996b..eb42b9a37f6c 100644 --- a/app/code/Magento/Checkout/Test/Unit/Helper/ExpressRedirectTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Helper/ExpressRedirectTest.php @@ -34,7 +34,7 @@ class ExpressRedirectTest extends \PHPUnit_Framework_TestCase */ protected $_helper; - public function setUp() + protected function setUp() { $this->_actionFlag = $this->getMockBuilder( 'Magento\Framework\App\ActionFlag' diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php index 6568a2aa577d..0867f9e655c6 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php @@ -36,7 +36,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase /** * SetUp */ - public function setUp() + protected function setUp() { $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); $this->checkoutSessionMock = $this->getMock( diff --git a/app/code/Magento/Checkout/Test/Unit/Model/SessionTest.php b/app/code/Magento/Checkout/Test/Unit/Model/SessionTest.php index 1c45f0b60e36..c5db9b89c828 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/SessionTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/SessionTest.php @@ -25,7 +25,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase */ protected $_session; - public function setUp() + protected function setUp() { $this->_helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); } diff --git a/app/code/Magento/Cms/Model/ResourceModel/Block.php b/app/code/Magento/Cms/Model/ResourceModel/Block.php index 810ded19f607..59c76fc63465 100644 --- a/app/code/Magento/Cms/Model/ResourceModel/Block.php +++ b/app/code/Magento/Cms/Model/ResourceModel/Block.php @@ -236,16 +236,8 @@ public function save(AbstractModel $object) if ($object->isDeleted()) { return $this->delete($object); } - $this->beginTransaction(); - try { - if (!$this->isModified($object)) { - $this->processNotModifiedSave($object); - $this->commit(); - $object->setHasDataChanges(false); - return $this; - } $object->validateBeforeSave(); $object->beforeSave(); if ($object->isSaveAllowed()) { diff --git a/app/code/Magento/Cms/Model/ResourceModel/Page.php b/app/code/Magento/Cms/Model/ResourceModel/Page.php index e0a6c53b5bc3..383c17d75cf1 100644 --- a/app/code/Magento/Cms/Model/ResourceModel/Page.php +++ b/app/code/Magento/Cms/Model/ResourceModel/Page.php @@ -386,16 +386,8 @@ public function save(AbstractModel $object) if ($object->isDeleted()) { return $this->delete($object); } - $this->beginTransaction(); - try { - if (!$this->isModified($object)) { - $this->processNotModifiedSave($object); - $this->commit(); - $object->setHasDataChanges(false); - return $this; - } $object->validateBeforeSave(); $object->beforeSave(); if ($object->isSaveAllowed()) { diff --git a/app/code/Magento/Cms/Setup/UpgradeData.php b/app/code/Magento/Cms/Setup/UpgradeData.php new file mode 100644 index 000000000000..9a7dce65b121 --- /dev/null +++ b/app/code/Magento/Cms/Setup/UpgradeData.php @@ -0,0 +1,243 @@ +pageFactory = $pageFactory; + } + + /** + * Create page + * + * @return Page + */ + private function createPage() + { + return $this->pageFactory->create(); + } + + /** + * Upgrades data for a module + * + * @param ModuleDataSetupInterface $setup + * @param ModuleContextInterface $context + * @return void + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) + { + $setup->startSetup(); + if (version_compare($context->getVersion(), '2.0.1', '<')) { + $newPageContent = << +
+ + Please replace this text with you Privacy Policy. + Please add any additional cookies your website uses below (e.g. Google Analytics). + +
+

+ This privacy policy sets out how this website (hereafter "the Store") uses and protects any information that + you give the Store while using this website. The Store is committed to ensuring that your privacy is protected. + Should we ask you to provide certain information by which you can be identified when using this website, then + you can be assured that it will only be used in accordance with this privacy statement. The Store may change + this policy from time to time by updating this page. You should check this page from time to time to ensure + that you are happy with any changes. +

+

What we collect

+

We may collect the following information:

+
    +
  • name
  • +
  • contact information including email address
  • +
  • demographic information such as postcode, preferences and interests
  • +
  • other information relevant to customer surveys and/or offers
  • +
+

+ For the exhaustive list of cookies we collect see the List of cookies we collect section. +

+

What we do with the information we gather

+

+ We require this information to understand your needs and provide you with a better service, + and in particular for the following reasons: +

+
    +
  • Internal record keeping.
  • +
  • We may use the information to improve our products and services.
  • +
  • + We may periodically send promotional emails about new products, special offers or other information which we + think you may find interesting using the email address which you have provided. +
  • +
  • + From time to time, we may also use your information to contact you for market research purposes. + We may contact you by email, phone, fax or mail. We may use the information to customise the website + according to your interests. +
  • +
+

Security

+

+ We are committed to ensuring that your information is secure. In order to prevent unauthorised access or + disclosure, we have put in place suitable physical, electronic and managerial procedures to safeguard and + secure the information we collect online. +

+

How we use cookies

+

+ A cookie is a small file which asks permission to be placed on your computer's hard drive. + Once you agree, the file is added and the cookie helps analyse web traffic or lets you know when you visit + a particular site. Cookies allow web applications to respond to you as an individual. The web application + can tailor its operations to your needs, likes and dislikes by gathering and remembering information about + your preferences. +

+

+ We use traffic log cookies to identify which pages are being used. This helps us analyse data about web page + traffic and improve our website in order to tailor it to customer needs. We only use this information for + statistical analysis purposes and then the data is removed from the system. +

+

+ Overall, cookies help us provide you with a better website, by enabling us to monitor which pages you find + useful and which you do not. A cookie in no way gives us access to your computer or any information about you, + other than the data you choose to share with us. You can choose to accept or decline cookies. + Most web browsers automatically accept cookies, but you can usually modify your browser setting + to decline cookies if you prefer. This may prevent you from taking full advantage of the website. +

+

Links to other websites

+

+ Our website may contain links to other websites of interest. However, once you have used these links + to leave our site, you should note that we do not have any control over that other website. + Therefore, we cannot be responsible for the protection and privacy of any information which you provide whilst + visiting such sites and such sites are not governed by this privacy statement. + You should exercise caution and look at the privacy statement applicable to the website in question. +

+

Controlling your personal information

+

You may choose to restrict the collection or use of your personal information in the following ways:

+
    +
  • + whenever you are asked to fill in a form on the website, look for the box that you can click to indicate + that you do not want the information to be used by anybody for direct marketing purposes +
  • +
  • + if you have previously agreed to us using your personal information for direct marketing purposes, + you may change your mind at any time by letting us know using our Contact Us information +
  • +
+

+ We will not sell, distribute or lease your personal information to third parties unless we have your permission + or are required by law to do so. We may use your personal information to send you promotional information + about third parties which we think you may find interesting if you tell us that you wish this to happen. +

+

+ You may request details of personal information which we hold about you under the Data Protection Act 1998. + A small fee will be payable. If you would like a copy of the information held on you please email us this + request using our Contact Us information. +

+

+ If you believe that any information we are holding on you is incorrect or incomplete, + please write to or email us as soon as possible, at the above address. + We will promptly correct any information found to be incorrect. +

+

List of cookies we collect

+

The table below lists the cookies we collect and what information they store.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Cookie NameCookie Description
FORM_KEYStores randomly generated key used to prevent forged requests.
PHPSESSIDYour session ID on the server.
GUEST-VIEWAllows guests to view and edit their orders.
PERSISTENT_SHOPPING_CARTA link to information about your cart and viewing history, if you have asked for this.
STFInformation on products you have emailed to friends.
STOREThe store view or language you have selected.
USER_ALLOWED_SAVE_COOKIEIndicates whether a customer allowed to use cookies.
MAGE-CACHE-SESSIDFacilitates caching of content on the browser to make pages load faster.
MAGE-CACHE-STORAGEFacilitates caching of content on the browser to make pages load faster.
MAGE-CACHE-STORAGE-SECTION-INVALIDATIONFacilitates caching of content on the browser to make pages load faster.
MAGE-CACHE-TIMEOUTFacilitates caching of content on the browser to make pages load faster.
SECTION-DATA-IDSFacilitates caching of content on the browser to make pages load faster.
PRIVATE_CONTENT_VERSIONFacilitates caching of content on the browser to make pages load faster.
X-MAGENTO-VARYFacilitates caching of content on the server to make pages load faster.
MAGE-TRANSLATION-FILE-VERSIONFacilitates translation of content to other languages.
MAGE-TRANSLATION-STORAGEFacilitates translation of content to other languages.
+ +EOD; + $privacyAndCookiePolicyPage = $this->createPage()->load(self::PRIVACY_COOKIE_PAGE_ID); + $privacyAndCookiePolicyPage->setContent($newPageContent); + $privacyAndCookiePolicyPage->save(); + } + $setup->endSetup(); + } +} diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/InlineEditTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/InlineEditTest.php index dfb1ecf61d0a..5ff68d688503 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/InlineEditTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Page/InlineEditTest.php @@ -45,7 +45,7 @@ class InlineEditTest extends \PHPUnit_Framework_TestCase /** @var InlineEdit */ protected $controller; - public function setUp() + protected function setUp() { $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Block/InlineEditTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Block/InlineEditTest.php index 2b4ae3088c7f..0d74681bae6c 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Block/InlineEditTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Block/InlineEditTest.php @@ -30,7 +30,7 @@ class InlineEditTest extends \PHPUnit_Framework_TestCase /** @var InlineEdit */ protected $controller; - public function setUp() + protected function setUp() { $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Page/PostDataProcessorTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Page/PostDataProcessorTest.php index 3a084d3d561a..16ba00c1c349 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Page/PostDataProcessorTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Page/PostDataProcessorTest.php @@ -21,7 +21,7 @@ class PostDataProcessorTest extends \PHPUnit_Framework_TestCase /** @var PostDataProcessor */ protected $postDataProcessor; - public function setUp() + protected function setUp() { $this->dateFilter = $this->getMock('Magento\Framework\Stdlib\DateTime\Filter\Date', [], [], '', false); $this->messageManager = $this->getMockForAbstractClass( diff --git a/app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php b/app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php index 5cf9f9615498..b2318d05c725 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/BlockRepositoryTest.php @@ -61,7 +61,7 @@ class BlockRepositoryTest extends \PHPUnit_Framework_TestCase /** * Initialize repository */ - public function setUp() + protected function setUp() { $this->blockResource = $this->getMockBuilder('Magento\Cms\Model\ResourceModel\Block') ->disableOriginalConstructor() diff --git a/app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php b/app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php index fb2a53346d41..903f75176e98 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/PageRepositoryTest.php @@ -61,7 +61,7 @@ class PageRepositoryTest extends \PHPUnit_Framework_TestCase /** * Initialize repository */ - public function setUp() + protected function setUp() { $this->pageResource = $this->getMockBuilder('Magento\Cms\Model\ResourceModel\Page') ->disableOriginalConstructor() diff --git a/app/code/Magento/Cms/etc/module.xml b/app/code/Magento/Cms/etc/module.xml index ced71ecf6c9a..bb3aaf184fd6 100644 --- a/app/code/Magento/Cms/etc/module.xml +++ b/app/code/Magento/Cms/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml index 058179ac951d..8c567b2d23b9 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_page_listing.xml @@ -257,6 +257,7 @@ Magento_Ui/js/grid/columns/date date date + false Custom design from MMM d, y false @@ -270,6 +271,7 @@ Magento_Ui/js/grid/columns/date date date + false Custom design to MMM d, y false diff --git a/app/code/Magento/CmsUrlRewrite/Test/Unit/Plugin/Cms/Model/ResourceModel/PageTest.php b/app/code/Magento/CmsUrlRewrite/Test/Unit/Plugin/Cms/Model/ResourceModel/PageTest.php index f3570efa8f7b..279d3adf3c49 100644 --- a/app/code/Magento/CmsUrlRewrite/Test/Unit/Plugin/Cms/Model/ResourceModel/PageTest.php +++ b/app/code/Magento/CmsUrlRewrite/Test/Unit/Plugin/Cms/Model/ResourceModel/PageTest.php @@ -35,7 +35,7 @@ class PageTest extends \PHPUnit_Framework_TestCase */ protected $closureMock; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Config/Block/System/Config/Form.php b/app/code/Magento/Config/Block/System/Config/Form.php index f544e3d86be4..0204219765dd 100644 --- a/app/code/Magento/Config/Block/System/Config/Form.php +++ b/app/code/Magento/Config/Block/System/Config/Form.php @@ -309,6 +309,17 @@ protected function _initElement( if (array_key_exists($path, $this->_configData)) { $data = $this->_configData[$path]; $inherit = false; + + if ($field->hasBackendModel()) { + $backendModel = $field->getBackendModel(); + $backendModel->setPath($path) + ->setValue($data) + ->setWebsite($this->getWebsiteCode()) + ->setStore($this->getStoreCode()) + ->afterLoad(); + $data = $backendModel->getValue(); + } + } elseif ($field->getConfigPath() !== null) { $data = $this->getConfigValue($field->getConfigPath()); } else { @@ -327,20 +338,6 @@ protected function _initElement( $elementName = $this->_generateElementName($field->getPath(), $fieldPrefix); $elementId = $this->_generateElementId($field->getPath($fieldPrefix)); - if ($field->hasBackendModel()) { - $backendModel = $field->getBackendModel(); - $backendModel->setPath( - $path - )->setValue( - $data - )->setWebsite( - $this->getWebsiteCode() - )->setStore( - $this->getStoreCode() - )->afterLoad(); - $data = $backendModel->getValue(); - } - $dependencies = $field->getDependencies($fieldPrefix, $this->getStoreCode()); $this->_populateDependenciesBlock($dependencies, $elementId, $elementName); @@ -607,6 +604,7 @@ protected function _getAdditionalElementTypes() * Temporary moved those $this->getRequest()->getParam('blabla') from the code accross this block * to getBlala() methods to be later set from controller with setters */ + /** * Enter description here... * diff --git a/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php b/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php index b3632d9df433..b8b6b253eb39 100644 --- a/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php +++ b/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php @@ -390,12 +390,26 @@ public function initGroupDataProvider() [false, [['field' => 'field', 'label' => 'label']], 1], ]; } + /** + * @param array $backendConfigValue + * @param string|bool $configValue + * @param string|null $configPath + * @param bool $inherit + * @param string $expectedValue + * @param int $hasBackendModel + * * @dataProvider initFieldsDataProvider * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function testInitFields($backendConfigValue, $configValue, $configPath, $inherit, $expectedValue) - { + public function testInitFields( + $backendConfigValue, + $configValue, + $configPath, + $inherit, + $expectedValue, + $hasBackendModel + ) { // Parameters initialization $fieldsetMock = $this->getMock( 'Magento\Framework\Data\Form\Element\Fieldset', @@ -477,7 +491,13 @@ public function testInitFields($backendConfigValue, $configValue, $configPath, $ $fieldMock->expects($this->any())->method('getGroupPath')->will($this->returnValue('some/config/path')); $fieldMock->expects($this->once())->method('getSectionId')->will($this->returnValue('some_section')); - $fieldMock->expects($this->once())->method('hasBackendModel')->will($this->returnValue(false)); + $fieldMock->expects( + $this->exactly($hasBackendModel) + )->method( + 'hasBackendModel' + )->will( + $this->returnValue(false) + ); $fieldMock->expects( $this->once() )->method( @@ -556,8 +576,8 @@ public function testInitFields($backendConfigValue, $configValue, $configPath, $ public function initFieldsDataProvider() { return [ - [['section1/group1/field1' => 'some_value'], false, null, false, 'some_value'], - [[], 'Config Value', 'some/config/path', true, 'Config Value'] + [['section1/group1/field1' => 'some_value'], false, null, false, 'some_value', 1], + [[], 'Config Value', 'some/config/path', true, 'Config Value', 0] ]; } } diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Image/LogoTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Image/LogoTest.php index 8ecd759b4021..61d09801adae 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Image/LogoTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/Backend/Image/LogoTest.php @@ -27,7 +27,7 @@ class LogoTest extends \PHPUnit_Framework_TestCase */ private $requestDataMock; - public function setUp() + protected function setUp() { $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->uploaderFactoryMock = $this->getMockBuilder('\Magento\MediaStorage\Model\File\UploaderFactory') diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php index b03466161f13..0401effc7a24 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php @@ -40,7 +40,7 @@ class LinkManagementTest extends \PHPUnit_Framework_TestCase */ protected $dataObjectHelperMock; - public function setUp() + protected function setUp() { $this->productRepository = $this->getMock('\Magento\Catalog\Api\ProductRepositoryInterface'); $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -274,7 +274,6 @@ public function testRemoveChildInvalidChildSku() ->getMock(); $product->expects($this->once())->method('getTypeInstance')->willReturn($productType); - $this->productRepository->expects($this->any())->method('get')->will($this->returnValue($product)); $option = $this->getMockBuilder('\Magento\Catalog\Model\Product') diff --git a/app/code/Magento/Contact/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Contact/Test/Unit/Controller/Index/IndexTest.php index a41c95bec8d4..ed4d4787379b 100644 --- a/app/code/Magento/Contact/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Contact/Test/Unit/Controller/Index/IndexTest.php @@ -36,7 +36,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase */ protected $_url; - public function setUp() + protected function setUp() { $this->_scopeConfig = $this->getMockForAbstractClass( '\Magento\Framework\App\Config\ScopeConfigInterface', diff --git a/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php b/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php index 386645f7ce1a..30543e33b835 100644 --- a/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php +++ b/app/code/Magento/Contact/Test/Unit/Controller/Index/PostTest.php @@ -61,7 +61,7 @@ class PostTest extends \PHPUnit_Framework_TestCase */ protected $_storeManager; - public function setUp() + protected function setUp() { $this->_scopeConfig = $this->getMockForAbstractClass( '\Magento\Framework\App\Config\ScopeConfigInterface', diff --git a/app/code/Magento/Contact/Test/Unit/Controller/IndexTest.php b/app/code/Magento/Contact/Test/Unit/Controller/IndexTest.php index 922d8ce0ec8f..2472f9aee965 100644 --- a/app/code/Magento/Contact/Test/Unit/Controller/IndexTest.php +++ b/app/code/Magento/Contact/Test/Unit/Controller/IndexTest.php @@ -22,7 +22,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase */ protected $_scopeConfig; - public function setUp() + protected function setUp() { $this->_scopeConfig = $this->getMockForAbstractClass( '\Magento\Framework\App\Config\ScopeConfigInterface', diff --git a/app/code/Magento/Contact/Test/Unit/Helper/DataTest.php b/app/code/Magento/Contact/Test/Unit/Helper/DataTest.php index 2c885dfd11c1..9aa1a58be97a 100644 --- a/app/code/Magento/Contact/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Contact/Test/Unit/Helper/DataTest.php @@ -36,7 +36,7 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected $_customerViewHelper; - public function setUp() + protected function setUp() { $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $className = '\Magento\Contact\Helper\Data'; diff --git a/app/code/Magento/Contact/Test/Unit/Model/System/Config/Backend/LinksTest.php b/app/code/Magento/Contact/Test/Unit/Model/System/Config/Backend/LinksTest.php index 81f3c9af7110..1ef0f5fd8f7f 100644 --- a/app/code/Magento/Contact/Test/Unit/Model/System/Config/Backend/LinksTest.php +++ b/app/code/Magento/Contact/Test/Unit/Model/System/Config/Backend/LinksTest.php @@ -14,7 +14,7 @@ class LinksTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = (new ObjectManager($this))->getObject('Magento\Contact\Model\System\Config\Backend\Links'); } diff --git a/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/LifetimeTest.php b/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/LifetimeTest.php index 6a11bf2a0a4b..b61ef86705b4 100644 --- a/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/LifetimeTest.php +++ b/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/LifetimeTest.php @@ -24,7 +24,7 @@ class LifetimeTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Cookie\Model\Config\Backend\Lifetime */ private $model; - public function setUp() + protected function setUp() { $this->validatorMock = $this->getMockBuilder( 'Magento\Framework\Session\Config\Validator\CookieLifetimeValidator' diff --git a/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/PathTest.php b/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/PathTest.php index d30ab4d4f52e..56586181efe2 100644 --- a/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/PathTest.php +++ b/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/PathTest.php @@ -24,7 +24,7 @@ class PathTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Cookie\Model\Config\Backend\Path */ private $model; - public function setUp() + protected function setUp() { $this->validatorMock = $this->getMockBuilder('Magento\Framework\Session\Config\Validator\CookiePathValidator') ->disableOriginalConstructor() diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index 7a206daa34a6..27460006737c 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -100,6 +100,11 @@ class ProcessCronQueueObserver implements ObserverInterface */ protected $timezone; + /** + * @var \Symfony\Component\Process\PhpExecutableFinder + */ + protected $phpExecutableFinder; + /** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param ScheduleFactory $scheduleFactory @@ -109,6 +114,7 @@ class ProcessCronQueueObserver implements ObserverInterface * @param \Magento\Framework\App\Console\Request $request * @param \Magento\Framework\ShellInterface $shell * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone + * @param \Magento\Framework\Process\PhpExecutableFinderFactory $phpExecutableFinderFactory */ public function __construct( \Magento\Framework\ObjectManagerInterface $objectManager, @@ -118,7 +124,8 @@ public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\App\Console\Request $request, \Magento\Framework\ShellInterface $shell, - \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone + \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone, + \Magento\Framework\Process\PhpExecutableFinderFactory $phpExecutableFinderFactory ) { $this->_objectManager = $objectManager; $this->_scheduleFactory = $scheduleFactory; @@ -128,6 +135,7 @@ public function __construct( $this->_request = $request; $this->_shell = $shell; $this->timezone = $timezone; + $this->phpExecutableFinder = $phpExecutableFinderFactory->create(); } /** @@ -147,6 +155,8 @@ public function execute(\Magento\Framework\Event\Observer $observer) $currentTime = $this->timezone->scopeTimeStamp(); $jobGroupsRoot = $this->_config->getJobs(); + $phpPath = $this->phpExecutableFinder->find() ?: 'php'; + foreach ($jobGroupsRoot as $groupId => $jobsRoot) { if ($this->_request->getParam('group') !== null && $this->_request->getParam('group') !== '\'' . ($groupId) . '\'' @@ -160,7 +170,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) ) == 1 )) { $this->_shell->execute( - 'php %s cron:run --group=' . $groupId . ' --' . CLI::INPUT_KEY_BOOTSTRAP . '=' + $phpPath . ' %s cron:run --group=' . $groupId . ' --' . CLI::INPUT_KEY_BOOTSTRAP . '=' . self::STANDALONE_PROCESS_STARTED . '=1', [ BP . '/bin/magento' diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/Reader/XmlTest.php b/app/code/Magento/Cron/Test/Unit/Model/Config/Reader/XmlTest.php index 0f3304c67f3b..30c56734d1ad 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/Reader/XmlTest.php +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/Reader/XmlTest.php @@ -15,7 +15,7 @@ class XmlTest extends \PHPUnit_Framework_TestCase /** * Prepare parameters */ - public function setUp() + protected function setUp() { $fileResolver = $this->getMockBuilder( 'Magento\Framework\App\Config\FileResolver' diff --git a/app/code/Magento/Cron/Test/Unit/Model/Config/XsdTest.php b/app/code/Magento/Cron/Test/Unit/Model/Config/XsdTest.php index 736323fa7e36..cc0881d4546d 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Config/XsdTest.php +++ b/app/code/Magento/Cron/Test/Unit/Model/Config/XsdTest.php @@ -12,7 +12,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase */ protected $_xsdFile; - public function setUp() + protected function setUp() { if (!function_exists('libxml_set_external_entity_loader')) { $this->markTestSkipped('Skipped on HHVM. Will be fixed in MAGETWO-45033'); diff --git a/app/code/Magento/Cron/Test/Unit/Model/Groups/Config/Converter/XmlTest.php b/app/code/Magento/Cron/Test/Unit/Model/Groups/Config/Converter/XmlTest.php index a50f32a42b1f..9083fb31e77a 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/Groups/Config/Converter/XmlTest.php +++ b/app/code/Magento/Cron/Test/Unit/Model/Groups/Config/Converter/XmlTest.php @@ -12,7 +12,7 @@ class XmlTest extends \PHPUnit_Framework_TestCase */ protected $object; - public function setUp() + protected function setUp() { $this->object = new \Magento\Cron\Model\Groups\Config\Converter\Xml(); } diff --git a/app/code/Magento/Cron/Test/Unit/Model/ScheduleTest.php b/app/code/Magento/Cron/Test/Unit/Model/ScheduleTest.php index f983970ee7a2..d0cfadb1a6be 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/ScheduleTest.php +++ b/app/code/Magento/Cron/Test/Unit/Model/ScheduleTest.php @@ -17,7 +17,7 @@ class ScheduleTest extends \PHPUnit_Framework_TestCase protected $resourceJobMock; - public function setUp() + protected function setUp() { $this->helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index cb59fbd19a2e..3d101b88d064 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -75,7 +75,7 @@ class ProcessCronQueueObserverTest extends \PHPUnit_Framework_TestCase /** * Prepare parameters */ - public function setUp() + protected function setUp() { $this->_objectManager = $this->getMockBuilder( 'Magento\Framework\App\ObjectManager' @@ -110,6 +110,18 @@ public function setUp() $this->timezone = $this->getMock('Magento\Framework\Stdlib\DateTime\TimezoneInterface'); $this->timezone->expects($this->any())->method('scopeTimeStamp')->will($this->returnValue(time())); + + $phpExecutableFinder = $this->getMock('Symfony\Component\Process\PhpExecutableFinder', [], [], '', false); + $phpExecutableFinder->expects($this->any())->method('find')->willReturn('php'); + $phpExecutableFinderFactory = $this->getMock( + 'Magento\Framework\Process\PhpExecutableFinderFactory', + [], + [], + '', + false + ); + $phpExecutableFinderFactory->expects($this->any())->method('create')->willReturn($phpExecutableFinder); + $this->_observer = new ProcessCronQueueObserver( $this->_objectManager, $this->_scheduleFactory, @@ -118,7 +130,8 @@ public function setUp() $this->_scopeConfig, $this->_request, $this->_shell, - $this->timezone + $this->timezone, + $phpExecutableFinderFactory ); } diff --git a/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/IndexTest.php b/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/IndexTest.php index 26c2a4a83b04..365db9897454 100644 --- a/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/IndexTest.php +++ b/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/IndexTest.php @@ -57,7 +57,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase */ protected $titleMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php b/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php index 618846230924..6372c737f832 100644 --- a/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php +++ b/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php @@ -57,7 +57,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase */ protected $filterManagerMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/CurrencySymbol/Test/Unit/Observer/CurrencyDisplayOptionsTest.php b/app/code/Magento/CurrencySymbol/Test/Unit/Observer/CurrencyDisplayOptionsTest.php index faf5f7d930cf..d9a9c1833cfe 100644 --- a/app/code/Magento/CurrencySymbol/Test/Unit/Observer/CurrencyDisplayOptionsTest.php +++ b/app/code/Magento/CurrencySymbol/Test/Unit/Observer/CurrencyDisplayOptionsTest.php @@ -37,7 +37,7 @@ class CurrencyDisplayOptionsTest extends \PHPUnit_Framework_TestCase */ private $mockEvent; - public function setUp() + protected function setUp() { $this->mockSymbolFactory = $this->getMock( 'Magento\CurrencySymbol\Model\System\CurrencysymbolFactory', diff --git a/app/code/Magento/Customer/Model/Plugin/CustomerRepository/TransactionWrapper.php b/app/code/Magento/Customer/Model/Plugin/CustomerRepository/TransactionWrapper.php new file mode 100644 index 000000000000..4820ff56d13e --- /dev/null +++ b/app/code/Magento/Customer/Model/Plugin/CustomerRepository/TransactionWrapper.php @@ -0,0 +1,52 @@ +resourceModel = $resourceModel; + } + + /** + * @param \Magento\Customer\Api\CustomerRepositoryInterface $subject + * @param callable $proceed + * @param \Magento\Customer\Api\Data\CustomerInterface $customer + * @param string $passwordHash + * @return \Magento\Customer\Api\Data\CustomerInterface + * @throws \Exception + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundSave( + \Magento\Customer\Api\CustomerRepositoryInterface $subject, + \Closure $proceed, + \Magento\Customer\Api\Data\CustomerInterface $customer, + $passwordHash = null + ) { + $this->resourceModel->beginTransaction(); + try { + /** @var $result \Magento\Customer\Api\Data\CustomerInterface */ + $result = $proceed($customer, $passwordHash); + $this->resourceModel->commit(); + return $result; + } catch (\Exception $e) { + $this->resourceModel->rollBack(); + throw $e; + } + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Block/Account/Dashboard/InfoTest.php b/app/code/Magento/Customer/Test/Unit/Block/Account/Dashboard/InfoTest.php index 7e59b04c4e37..3b10c04f8035 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Account/Dashboard/InfoTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Account/Dashboard/InfoTest.php @@ -54,7 +54,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase */ protected $currentCustomer; - public function setUp() + protected function setUp() { $this->currentCustomer = $this->getMock( 'Magento\Customer\Helper\Session\CurrentCustomer', diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php index 8d4064027a4b..6ffc6631f804 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -44,7 +44,7 @@ class NewsletterTest extends \PHPUnit_Framework_TestCase */ protected $urlBuilderMock; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('\Magento\Backend\Block\Template\Context', [], [], '', false); $this->registryMock = $this->getMock('\Magento\Framework\Registry', [], [], '', false); diff --git a/app/code/Magento/Customer/Test/Unit/Block/Form/Login/InfoTest.php b/app/code/Magento/Customer/Test/Unit/Block/Form/Login/InfoTest.php index 9864407f93dc..def45459ac1d 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Form/Login/InfoTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Form/Login/InfoTest.php @@ -27,7 +27,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase */ protected $coreUrl; - public function setUp() + protected function setUp() { $this->customerUrl = $this->getMockBuilder( 'Magento\Customer\Model\Url' diff --git a/app/code/Magento/Customer/Test/Unit/Block/Form/RegisterTest.php b/app/code/Magento/Customer/Test/Unit/Block/Form/RegisterTest.php index e461f358548a..2fa52d655286 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Form/RegisterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Form/RegisterTest.php @@ -46,7 +46,7 @@ class RegisterTest extends \PHPUnit_Framework_TestCase /** @var Register */ private $_block; - public function setUp() + protected function setUp() { $this->_scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_moduleManager = $this->getMock('Magento\Framework\Module\Manager', [], [], '', false); diff --git a/app/code/Magento/Customer/Test/Unit/Block/Widget/AbstractWidgetTest.php b/app/code/Magento/Customer/Test/Unit/Block/Widget/AbstractWidgetTest.php index a65eae138635..9bfb3799eaac 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Widget/AbstractWidgetTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/AbstractWidgetTest.php @@ -24,7 +24,7 @@ class AbstractWidgetTest extends \PHPUnit_Framework_TestCase /** @var AbstractWidget */ private $_block; - public function setUp() + protected function setUp() { $this->_addressHelper = $this->getMock('Magento\Customer\Helper\Address', [], [], '', false); diff --git a/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php b/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php index 8381c2de8d7d..ec39a2dcea52 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php @@ -56,7 +56,7 @@ class DobTest extends \PHPUnit_Framework_TestCase */ protected $filterFactory; - public function setUp() + protected function setUp() { $zendCacheCore = new \Zend_Cache_Core(); $zendCacheCore->setBackend(new \Zend_Cache_Backend_BlackHole()); diff --git a/app/code/Magento/Customer/Test/Unit/Block/Widget/GenderTest.php b/app/code/Magento/Customer/Test/Unit/Block/Widget/GenderTest.php index 79a92f57da5f..3a42e62a1d36 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Widget/GenderTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/GenderTest.php @@ -36,7 +36,7 @@ class GenderTest extends \PHPUnit_Framework_TestCase /** @var Gender */ private $block; - public function setUp() + protected function setUp() { $this->attribute = $this->getMockBuilder('\Magento\Customer\Api\Data\AttributeMetadataInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php b/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php index 18bc070cc9b9..5e11d60040d1 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/NameTest.php @@ -69,7 +69,7 @@ class NameTest extends \PHPUnit_Framework_TestCase */ protected $_objectManager; - public function setUp() + protected function setUp() { $this->_objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->_escaper = $this->getMock('Magento\Framework\Escaper', [], [], '', false); diff --git a/app/code/Magento/Customer/Test/Unit/Block/Widget/TaxvatTest.php b/app/code/Magento/Customer/Test/Unit/Block/Widget/TaxvatTest.php index a2f7638caf19..dc685adf2d5d 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Widget/TaxvatTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/TaxvatTest.php @@ -29,7 +29,7 @@ class TaxvatTest extends \PHPUnit_Framework_TestCase /** @var Taxvat */ private $_block; - public function setUp() + protected function setUp() { $this->attribute = $this->getMockBuilder('\Magento\Customer\Api\Data\AttributeMetadataInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Customer/Test/Unit/Console/Command/UpgradeHashAlgorithmCommandTest.php b/app/code/Magento/Customer/Test/Unit/Console/Command/UpgradeHashAlgorithmCommandTest.php index 65515e190d50..01fb316feb27 100644 --- a/app/code/Magento/Customer/Test/Unit/Console/Command/UpgradeHashAlgorithmCommandTest.php +++ b/app/code/Magento/Customer/Test/Unit/Console/Command/UpgradeHashAlgorithmCommandTest.php @@ -26,7 +26,7 @@ class UpgradeHashAlgorithmCommandTest extends \PHPUnit_Framework_TestCase */ private $customerCollectionFactory; - public function setUp() + protected function setUp() { $this->customerCollectionFactory = $this->getMockBuilder( 'Magento\Customer\Model\ResourceModel\Customer\CollectionFactory' diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php index 880de81d88ee..d9596b1c8b70 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php @@ -67,7 +67,7 @@ class InlineEditTest extends \PHPUnit_Framework_TestCase /** @var array */ protected $items; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassAssignGroupTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassAssignGroupTest.php index b72fa5e1fc5e..5bc85fe677b6 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassAssignGroupTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassAssignGroupTest.php @@ -70,7 +70,7 @@ class MassAssignGroupTest extends \PHPUnit_Framework_TestCase */ protected $customerRepositoryMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassDeleteTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassDeleteTest.php index cc5bdf5abe68..e4967daf85a5 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassDeleteTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassDeleteTest.php @@ -70,7 +70,7 @@ class MassDeleteTest extends \PHPUnit_Framework_TestCase */ protected $customerRepositoryMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php index 12768e54b95d..6c8207a750c2 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php @@ -75,7 +75,7 @@ class MassSubscribeTest extends \PHPUnit_Framework_TestCase */ protected $subscriberMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php index 11c21db592a7..e12e703878eb 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php @@ -75,7 +75,7 @@ class MassUnsubscribeTest extends \PHPUnit_Framework_TestCase */ protected $subscriberMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ValidateTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ValidateTest.php index cc8ed6c77180..979d41c13bfc 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ValidateTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ValidateTest.php @@ -62,7 +62,7 @@ class ValidateTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Controller\Adminhtml\Index\Validate */ protected $controller; - public function setUp() + protected function setUp() { if (!function_exists('libxml_set_external_entity_loader')) { $this->markTestSkipped('Skipped on HHVM. Will be fixed in MAGETWO-45033'); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ViewfileTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ViewfileTest.php index cc98e33edb8a..3586651d269d 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ViewfileTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/ViewfileTest.php @@ -66,7 +66,7 @@ class ViewfileTest extends \PHPUnit_Framework_TestCase */ protected $requestMock; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->requestMock = $this->getMock('Magento\Framework\App\RequestInterface', [], [], '', false); @@ -185,7 +185,6 @@ public function testExecuteGetParamImage() ] ); - $this->urlDecoderMock->expects($this->once())->method('decode')->with($decodedFile)->willReturn($file); $this->resultRawMock->expects($this->once())->method('setHttpResponseCode')->with(200)->willReturnSelf(); diff --git a/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerAddressTest.php b/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerAddressTest.php index 81977038ddf1..372aeca7a840 100644 --- a/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerAddressTest.php +++ b/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerAddressTest.php @@ -35,7 +35,7 @@ class CurrentCustomerAddressTest extends \PHPUnit_Framework_TestCase /** * Test setup */ - public function setUp() + protected function setUp() { $this->currentCustomerMock = $this->getMockBuilder('Magento\Customer\Helper\Session\CurrentCustomer') ->disableOriginalConstructor() diff --git a/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php b/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php index 10c9e077aa66..3f390e2e3466 100644 --- a/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php +++ b/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php @@ -68,7 +68,7 @@ class CurrentCustomerTest extends \PHPUnit_Framework_TestCase /** * Test setup */ - public function setUp() + protected function setUp() { $this->customerSessionMock = $this->getMock('Magento\Customer\Model\Session', [], [], '', false); $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); diff --git a/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php b/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php index 62715bed080d..b23e5bf4d7a2 100644 --- a/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php +++ b/app/code/Magento/Customer/Test/Unit/Helper/ViewTest.php @@ -18,7 +18,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase /** @var CustomerMetadataInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $customerMetadataService; - public function setUp() + protected function setUp() { $this->context = $this->getMockBuilder('Magento\Framework\App\Helper\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php b/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php index 0561bd7bf0a8..2410bb894ce2 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Account/RedirectTest.php @@ -78,7 +78,7 @@ class RedirectTest extends \PHPUnit_Framework_TestCase */ protected $resultFactory; - public function setUp() + protected function setUp() { $this->request = $this->getMockForAbstractClass('Magento\Framework\App\RequestInterface'); diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/ConverterTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/ConverterTest.php index 50f3efc85d3b..866a3cc622a7 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/Config/ConverterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/Config/ConverterTest.php @@ -12,7 +12,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new \Magento\Customer\Model\Address\Config\Converter(); } diff --git a/app/code/Magento/Customer/Test/Unit/Model/Address/ConfigTest.php b/app/code/Magento/Customer/Test/Unit/Model/Address/ConfigTest.php index a52750579778..9dbec230b432 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Address/ConfigTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Address/ConfigTest.php @@ -47,7 +47,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected $_cacheId = 'cache_id'; - public function setUp() + protected function setUp() { $this->_storeMock = $this->getMock('Magento\Store\Model\Store', [], [], '', false); $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); diff --git a/app/code/Magento/Customer/Test/Unit/Model/AddressRegistryTest.php b/app/code/Magento/Customer/Test/Unit/Model/AddressRegistryTest.php index f12e7c5b3281..9662a48de385 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/AddressRegistryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/AddressRegistryTest.php @@ -19,7 +19,7 @@ class AddressRegistryTest extends \PHPUnit_Framework_TestCase */ private $addressFactory; - public function setUp() + protected function setUp() { $this->addressFactory = $this->getMockBuilder('\Magento\Customer\Model\AddressFactory') ->disableOriginalConstructor() diff --git a/app/code/Magento/Customer/Test/Unit/Model/AddressTest.php b/app/code/Magento/Customer/Test/Unit/Model/AddressTest.php index 77a7cf386d1f..ecdbecce9946 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/AddressTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/AddressTest.php @@ -36,8 +36,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase */ protected $resource; - - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Customer/Test/Unit/Model/App/Action/ContextPluginTest.php b/app/code/Magento/Customer/Test/Unit/Model/App/Action/ContextPluginTest.php index ba0e3c13ca28..2063c756fda1 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/App/Action/ContextPluginTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/App/Action/ContextPluginTest.php @@ -46,7 +46,7 @@ class ContextPluginTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->customerSessionMock = $this->getMock( 'Magento\Customer\Model\Session', diff --git a/app/code/Magento/Customer/Test/Unit/Model/Checkout/ConfigProviderTest.php b/app/code/Magento/Customer/Test/Unit/Model/Checkout/ConfigProviderTest.php index 286405a121d6..f17936c66daa 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Checkout/ConfigProviderTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Checkout/ConfigProviderTest.php @@ -41,7 +41,7 @@ class ConfigProviderTest extends \PHPUnit_Framework_TestCase */ protected $store; - public function setUp() + protected function setUp() { $this->storeManager = $this->getMockForAbstractClass( 'Magento\Store\Model\StoreManagerInterface', diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/BillingTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/BillingTest.php index b8ee30e16f9e..931fe1992225 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/BillingTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/BillingTest.php @@ -14,7 +14,7 @@ class BillingTest extends \PHPUnit_Framework_TestCase */ protected $testable; - public function setUp() + protected function setUp() { $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); /** @var \Psr\Log\LoggerInterface $logger */ diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/PasswordTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/PasswordTest.php index 76a2292c77e5..f6d6a32dccaf 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/PasswordTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/PasswordTest.php @@ -16,7 +16,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase */ protected $testable; - public function setUp() + protected function setUp() { $string = new StringUtils(); $this->testable = new \Magento\Customer\Model\Customer\Attribute\Backend\Password($string); diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/ShippingTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/ShippingTest.php index 1a55d4d0a969..d363c62e89af 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/ShippingTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/ShippingTest.php @@ -15,7 +15,7 @@ class ShippingTest extends \PHPUnit_Framework_TestCase */ protected $testable; - public function setUp() + protected function setUp() { $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); /** @var \Psr\Log\LoggerInterface $logger */ diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/StoreTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/StoreTest.php index 9a0d7f08328d..8fe7a6c0595a 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/StoreTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/StoreTest.php @@ -20,7 +20,7 @@ class StoreTest extends \PHPUnit_Framework_TestCase */ protected $storeManager; - public function setUp() + protected function setUp() { $storeManager = $this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') ->getMock(); diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/WebsiteTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/WebsiteTest.php index cafb2d42a06b..040a79d99cc9 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/WebsiteTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/WebsiteTest.php @@ -20,7 +20,7 @@ class WebsiteTest extends \PHPUnit_Framework_TestCase */ protected $storeManager; - public function setUp() + protected function setUp() { $storeManager = $this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') ->getMock(); diff --git a/app/code/Magento/Customer/Test/Unit/Model/CustomerExtractorTest.php b/app/code/Magento/Customer/Test/Unit/Model/CustomerExtractorTest.php index 2073eb5de3a5..c414d648b217 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/CustomerExtractorTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/CustomerExtractorTest.php @@ -42,7 +42,7 @@ class CustomerExtractorTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Api\Data\GroupInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $customerGroup; - public function setUp() + protected function setUp() { $this->formFactory = $this->getMockForAbstractClass( 'Magento\Customer\Model\Metadata\FormFactory', diff --git a/app/code/Magento/Customer/Test/Unit/Model/CustomerRegistryTest.php b/app/code/Magento/Customer/Test/Unit/Model/CustomerRegistryTest.php index 7c5dc5351a30..029f73b3e30d 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/CustomerRegistryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/CustomerRegistryTest.php @@ -36,7 +36,7 @@ class CustomerRegistryTest extends \PHPUnit_Framework_TestCase const CUSTOMER_EMAIL = 'customer@example.com'; const WEBSITE_ID = 1; - public function setUp() + protected function setUp() { $this->customerFactory = $this->getMockBuilder('Magento\Customer\Model\CustomerFactory') ->setMethods(['create']) diff --git a/app/code/Magento/Customer/Test/Unit/Model/GroupRegistryTest.php b/app/code/Magento/Customer/Test/Unit/Model/GroupRegistryTest.php index 56830cb31053..4fe2efed4c0f 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/GroupRegistryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/GroupRegistryTest.php @@ -20,7 +20,7 @@ class GroupRegistryTest extends \PHPUnit_Framework_TestCase */ private $groupFactory; - public function setUp() + protected function setUp() { $this->groupFactory = $this->getMockBuilder('\Magento\Customer\Model\GroupFactory') ->disableOriginalConstructor() diff --git a/app/code/Magento/Customer/Test/Unit/Model/Indexer/Attribute/FilterTest.php b/app/code/Magento/Customer/Test/Unit/Model/Indexer/Attribute/FilterTest.php index 66c7a288def4..3069daec55ec 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Indexer/Attribute/FilterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Indexer/Attribute/FilterTest.php @@ -31,7 +31,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase /** @var Filter */ protected $model; - public function setUp() + protected function setUp() { $this->resource = $this->getMock('Magento\Framework\App\ResourceConnection', [], [], '', false); $this->connection = $this->getMockForAbstractClass( diff --git a/app/code/Magento/Customer/Test/Unit/Model/Indexer/AttributeProviderTest.php b/app/code/Magento/Customer/Test/Unit/Model/Indexer/AttributeProviderTest.php index ff2a1fdf8624..5671a6f4ac3a 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Indexer/AttributeProviderTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Indexer/AttributeProviderTest.php @@ -21,7 +21,7 @@ class AttributeProviderTest extends \PHPUnit_Framework_TestCase */ protected $object; - public function setUp() + protected function setUp() { $this->eavConfig = $this->getMockBuilder('Magento\Eav\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/Customer/Test/Unit/Model/Layout/DepersonalizePluginTest.php b/app/code/Magento/Customer/Test/Unit/Model/Layout/DepersonalizePluginTest.php index 53261e644c0d..54e2a5434cdf 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Layout/DepersonalizePluginTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Layout/DepersonalizePluginTest.php @@ -55,7 +55,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase /** * SetUp */ - public function setUp() + protected function setUp() { $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); $this->sessionMock = $this->getMock( diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/ElementFactoryTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/ElementFactoryTest.php index 4cbcea51adef..bb74afe09eb1 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/ElementFactoryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/ElementFactoryTest.php @@ -21,7 +21,7 @@ class ElementFactoryTest extends \PHPUnit_Framework_TestCase /** @var ElementFactory */ private $_elementFactory; - public function setUp() + protected function setUp() { $this->_objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->_attributeMetadata = $this->getMock( diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/ValidatorTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/ValidatorTest.php index 1db608d797c8..ccd05a111c8c 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/ValidatorTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/ValidatorTest.php @@ -19,7 +19,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Model\Metadata\ElementFactory | \PHPUnit_Framework_MockObject_MockObject */ protected $attrDataFactoryMock; - public function setUp() + protected function setUp() { $this->attrDataFactoryMock = $this->getMockBuilder( '\Magento\Customer\Model\Metadata\ElementFactory' diff --git a/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerRepository/TransactionWrapperTest.php b/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerRepository/TransactionWrapperTest.php new file mode 100644 index 000000000000..314ea794b499 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerRepository/TransactionWrapperTest.php @@ -0,0 +1,90 @@ +resourceMock = $this->getMock('Magento\Customer\Model\ResourceModel\Customer', [], [], '', false); + $this->subjectMock = $this->getMock('Magento\Customer\Api\CustomerRepositoryInterface', [], [], '', false); + $this->customerMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface', [], [], '', false); + $customerMock = $this->customerMock; + $this->closureMock = function () use ($customerMock) { + return $customerMock; + }; + $this->rollbackClosureMock = function () use ($customerMock) { + throw new \Exception(self::ERROR_MSG); + }; + + $this->model = new \Magento\Customer\Model\Plugin\CustomerRepository\TransactionWrapper($this->resourceMock); + } + + public function testAroundSaveCommit() + { + $this->resourceMock->expects($this->once())->method('beginTransaction'); + $this->resourceMock->expects($this->once())->method('commit'); + + $this->assertEquals( + $this->customerMock, + $this->model->aroundSave($this->subjectMock, $this->closureMock, $this->customerMock, $this->passwordHash) + ); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage error occurred + */ + public function testAroundSaveRollBack() + { + $this->resourceMock->expects($this->once())->method('beginTransaction'); + $this->resourceMock->expects($this->once())->method('rollBack'); + + $this->model->aroundSave( + $this->subjectMock, + $this->rollbackClosureMock, + $this->customerMock, + $this->passwordHash + ); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/Attribute/Backend/RegionTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/Attribute/Backend/RegionTest.php index b5f57d0d7118..5855e004a09d 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/Attribute/Backend/RegionTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Address/Attribute/Backend/RegionTest.php @@ -22,7 +22,7 @@ class RegionTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Directory\Model\Region|\PHPUnit_Framework_MockObject_MockObject */ protected $region; - public function setUp() + protected function setUp() { $this->regionFactory = $this->getMock('Magento\Directory\Model\RegionFactory', ['create'], [], '', false); $this->region = $this->getMock( diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressRepositoryTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressRepositoryTest.php index 60f48c821d5a..50bf0985caf7 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressRepositoryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressRepositoryTest.php @@ -62,7 +62,7 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase */ protected $repository; - public function setUp() + protected function setUp() { $this->addressFactory = $this->getMock('Magento\Customer\Model\AddressFactory', ['create'], [], '', false); $this->addressRegistry = $this->getMock('Magento\Customer\Model\AddressRegistry', [], [], '', false); diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Customer/GridTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Customer/GridTest.php index 1723573f03fd..e1e6a34ba4a8 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Customer/GridTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Customer/GridTest.php @@ -33,7 +33,7 @@ class GridTest extends \PHPUnit_Framework_TestCase /** @var \Zend_Db_Statement_Interface|\PHPUnit_Framework_MockObject_MockObject */ protected $queryResult; - public function setUp() + protected function setUp() { $this->resource = $this->getMock('Magento\Framework\App\ResourceConnection', [], [], '', false); $this->indexerRegistry = $this->getMock('Magento\Framework\Indexer\IndexerRegistry', [], [], '', false); diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php index 4ffff0e920e0..288644dc42c0 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php @@ -87,8 +87,8 @@ class CustomerRepositoryTest extends \PHPUnit_Framework_TestCase * @var \Magento\Customer\Model\ResourceModel\CustomerRepository */ protected $model; - - public function setUp() + + protected function setUp() { $this->customerResourceModel = $this->getMock('Magento\Customer\Model\ResourceModel\Customer', [], [], '', false); diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Group/Grid/ServiceCollectionTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Group/Grid/ServiceCollectionTest.php index fd8279a8cce1..13afff437b45 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Group/Grid/ServiceCollectionTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/Group/Grid/ServiceCollectionTest.php @@ -36,7 +36,7 @@ class ServiceCollectionTest extends \PHPUnit_Framework_TestCase /** @var ServiceCollection */ protected $serviceCollection; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->filterBuilder = $this->objectManager->getObject('Magento\Framework\Api\FilterBuilder'); diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupRepositoryTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupRepositoryTest.php index a7c1fb084826..9d8abd104f44 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupRepositoryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupRepositoryTest.php @@ -71,7 +71,7 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->groupRegistry = $this->getMock( 'Magento\Customer\Model\GroupRegistry', diff --git a/app/code/Magento/Customer/Test/Unit/Observer/LogLastLoginAtObserverTest.php b/app/code/Magento/Customer/Test/Unit/Observer/LogLastLoginAtObserverTest.php index 9fa9b31e7092..e49461074d16 100644 --- a/app/code/Magento/Customer/Test/Unit/Observer/LogLastLoginAtObserverTest.php +++ b/app/code/Magento/Customer/Test/Unit/Observer/LogLastLoginAtObserverTest.php @@ -28,7 +28,7 @@ class LogLastLoginAtObserverTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->loggerMock = $this->getMock('Magento\Customer\Model\Logger', [], [], '', false); $this->logLastLoginAtObserver = new LogLastLoginAtObserver($this->loggerMock); diff --git a/app/code/Magento/Customer/Test/Unit/Observer/LogLastLogoutAtObserverTest.php b/app/code/Magento/Customer/Test/Unit/Observer/LogLastLogoutAtObserverTest.php index 372afc6578c5..2fb3b27b5610 100644 --- a/app/code/Magento/Customer/Test/Unit/Observer/LogLastLogoutAtObserverTest.php +++ b/app/code/Magento/Customer/Test/Unit/Observer/LogLastLogoutAtObserverTest.php @@ -28,7 +28,7 @@ class LogLastLogoutAtObserverTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->loggerMock = $this->getMock('Magento\Customer\Model\Logger', [], [], '', false); $this->logLastLogoutAtObserver = new LogLastLogoutAtObserver($this->loggerMock); diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/ColumnFactoryTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/ColumnFactoryTest.php index 9cea9df13552..f1f91aa57136 100644 --- a/app/code/Magento/Customer/Test/Unit/Ui/Component/ColumnFactoryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/ColumnFactoryTest.php @@ -30,7 +30,7 @@ class ColumnFactoryTest extends \PHPUnit_Framework_TestCase /** @var ColumnFactory */ protected $columnFactory; - public function setUp() + protected function setUp() { $this->context = $this->getMockForAbstractClass( 'Magento\Framework\View\Element\UiComponent\ContextInterface', diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProviderTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProviderTest.php index e38030ca9eed..34075f0af9a3 100644 --- a/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProviderTest.php +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProviderTest.php @@ -46,7 +46,7 @@ class DataProviderTest extends \PHPUnit_Framework_TestCase */ protected $attributeRepository; - public function setUp() + protected function setUp() { $this->reporting = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\DataProvider\Reporting') ->disableOriginalConstructor() diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/AttributeRepositoryTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/AttributeRepositoryTest.php index 5fbe30f45426..e3106318edb6 100644 --- a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/AttributeRepositoryTest.php +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/AttributeRepositoryTest.php @@ -33,7 +33,7 @@ class AttributeRepositoryTest extends \PHPUnit_Framework_TestCase /** @var AttributeRepository */ protected $component; - public function setUp() + protected function setUp() { $this->customerMetadataManagement = $this->getMockForAbstractClass( 'Magento\Customer\Api\CustomerMetadataManagementInterface', diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/ColumnsTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/ColumnsTest.php index 4032527049a5..160f04651441 100644 --- a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/ColumnsTest.php +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/ColumnsTest.php @@ -30,7 +30,7 @@ class ColumnsTest extends \PHPUnit_Framework_TestCase /** @var Columns */ protected $component; - public function setUp() + protected function setUp() { $this->context = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\ContextInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Customer/etc/di.xml b/app/code/Magento/Customer/etc/di.xml index f92caef79f51..feacdff78a15 100644 --- a/app/code/Magento/Customer/etc/di.xml +++ b/app/code/Magento/Customer/etc/di.xml @@ -205,26 +205,6 @@ BillingAddressExpression
- - - LastVisitAtSubSelect - - - - - customer_visitor - last_visit_at - - - e - entity_id - - - - last_visit_at - - - e @@ -319,4 +299,7 @@ + + + diff --git a/app/code/Magento/Customer/etc/indexer.xml b/app/code/Magento/Customer/etc/indexer.xml index 9adc5b9e47aa..7e7921cccc0f 100644 --- a/app/code/Magento/Customer/etc/indexer.xml +++ b/app/code/Magento/Customer/etc/indexer.xml @@ -23,7 +23,6 @@ - diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml index 9df37000836a..0177dda686b6 100644 --- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml +++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml @@ -257,18 +257,6 @@ - - - - Magento_Ui/js/grid/columns/date - dateRange - false - date - Last Logged In - 120 - - - diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js index 3137e732e5c4..40e99946e6e1 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js +++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js @@ -93,10 +93,17 @@ define([ * @return {*} */ ko.extenders.disposableCustomerData = function (target, sectionName) { - storage.remove(sectionName); + var sectionDataIds, newSectionDataIds = {}; target.subscribe(function () { setTimeout(function () { storage.remove(sectionName); + sectionDataIds = $.cookieStorage.get('section_data_ids') || {}; + _.each(sectionDataIds, function (data, name) { + if (name != sectionName) { + newSectionDataIds[name] = data; + } + }); + $.cookieStorage.set('section_data_ids', newSectionDataIds); }, 3000); }); @@ -166,7 +173,9 @@ define([ remove: function (sections) { _.each(sections, function (sectionName) { storage.remove(sectionName); - storageInvalidation.set(sectionName, true); + if (!sectionConfig.isClientSideSection(sectionName)) { + storageInvalidation.set(sectionName, true); + } }); } }; @@ -202,7 +211,7 @@ define([ if (!_.isEmpty(privateContent)) { countryData = this.get('directory-data'); if (_.isEmpty(countryData())) { - countryData(customerData.reload(['directory-data'], false)); + customerData.reload(['directory-data'], false); } } }, @@ -304,7 +313,9 @@ define([ // Invalidate section in cookie (increase version of section with 1000) _.each(sectionsNamesForInvalidation, function (sectionName) { - sectionDataIds[sectionName] += 1000; + if (!sectionConfig.isClientSideSection(sectionName)) { + sectionDataIds[sectionName] += 1000; + } }); $.cookieStorage.set('section_data_ids', sectionDataIds); }, diff --git a/app/code/Magento/Customer/view/frontend/web/js/section-config.js b/app/code/Magento/Customer/view/frontend/web/js/section-config.js index 86e4e830db6d..a4b4a2cc3ba2 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/section-config.js +++ b/app/code/Magento/Customer/view/frontend/web/js/section-config.js @@ -34,12 +34,16 @@ define(['underscore'], function (_) { }, filterClientSideSections: function (sections) { - if (_.isArray(sections)) { + if (Array.isArray(sections)) { return _.difference(sections, clientSideSections); } return sections; }, + isClientSideSection: function (sectionName) { + return _.contains(clientSideSections, sectionName); + }, + 'Magento_Customer/js/section-config': function(options) { baseUrls = options.baseUrls; sections = options.sections; diff --git a/app/code/Magento/Deploy/Model/Filesystem.php b/app/code/Magento/Deploy/Model/Filesystem.php index 0aeb9b9db522..0bc5d358c833 100644 --- a/app/code/Magento/Deploy/Model/Filesystem.php +++ b/app/code/Magento/Deploy/Model/Filesystem.php @@ -8,6 +8,8 @@ use Magento\Framework\App\State; use Magento\Framework\App\DeploymentConfig\Writer; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\LocalizedException; +use Symfony\Component\Console\Output\OutputInterface; /** * Class Filesystem @@ -52,7 +54,7 @@ class Filesystem /** @var \Magento\Store\Model\Config\StoreView */ private $storeView; - /** @var \Magento\Framework\Shell */ + /** @var \Magento\Framework\ShellInterface */ private $shell; /** @var string */ @@ -76,7 +78,7 @@ public function __construct( \Magento\Framework\App\Filesystem\DirectoryList $directoryList, \Magento\Framework\Filesystem\Driver\File $driverFile, \Magento\Store\Model\Config\StoreView $storeView, - \Magento\Framework\Shell $shell + \Magento\Framework\ShellInterface $shell ) { $this->writer = $writer; $this->reader = $reader; @@ -92,11 +94,11 @@ public function __construct( /** * Regenerate static * - * @param \Symfony\Component\Console\Output\OutputInterface $output + * @param OutputInterface $output * @return void */ public function regenerateStatic( - \Symfony\Component\Console\Output\OutputInterface $output + OutputInterface $output ) { // Сlean up /var/generation, /var/di/, /var/view_preprocessed and /pub/static directories $this->cleanupFilesystem( @@ -125,21 +127,26 @@ public function regenerateStatic( /** * Deploy static content * - * @param \Symfony\Component\Console\Output\OutputInterface $output + * @param OutputInterface $output * @return void * @throws \Exception */ protected function deployStaticContent( - \Symfony\Component\Console\Output\OutputInterface $output + OutputInterface $output ) { - $output->writeln('Static content deployment start'); + $output->writeln('Starting static content deployment'); $cmd = $this->functionCallPath . 'setup:static-content:deploy ' . implode(' ', $this->storeView->retrieveLocales()); /** * @todo build a solution that does not depend on exec */ - $execOutput = $this->shell->execute($cmd); + try { + $execOutput = $this->shell->execute($cmd); + } catch (LocalizedException $e) { + $output->writeln('Something went wrong while deploying static content. See the error log for details.'); + throw $e; + } $output->writeln($execOutput); $output->writeln('Static content deployment complete'); } @@ -147,13 +154,13 @@ protected function deployStaticContent( /** * Runs code multi-tenant compiler to generate code and DI information * - * @param \Symfony\Component\Console\Output\OutputInterface $output + * @param OutputInterface $output * @return void + * @throws LocalizedException */ - protected function compile( - \Symfony\Component\Console\Output\OutputInterface $output - ) { - $output->writeln('Start compilation'); + protected function compile(OutputInterface $output) + { + $output->writeln('Starting compilation'); $this->cleanupFilesystem( [ DirectoryList::CACHE, @@ -169,7 +176,12 @@ protected function compile( * * @todo build a solution that does not depend on exec */ - $execOutput = $this->shell->execute($cmd); + try { + $execOutput = $this->shell->execute($cmd); + } catch (LocalizedException $e) { + $output->writeln('Something went wrong while compiling generated code. See the error log for details.'); + throw $e; + } $output->writeln($execOutput); $output->writeln('Compilation complete'); } diff --git a/app/code/Magento/Deploy/etc/di.xml b/app/code/Magento/Deploy/etc/di.xml index c8deb34dcea7..b1a9020ce9af 100644 --- a/app/code/Magento/Deploy/etc/di.xml +++ b/app/code/Magento/Deploy/etc/di.xml @@ -22,4 +22,9 @@
+ + + Magento\Framework\App\Shell + + diff --git a/app/code/Magento/Developer/Test/Unit/Console/Command/DevTestsRunCommandTest.php b/app/code/Magento/Developer/Test/Unit/Console/Command/DevTestsRunCommandTest.php index 0c2659a9488b..52ae1f11bfe1 100644 --- a/app/code/Magento/Developer/Test/Unit/Console/Command/DevTestsRunCommandTest.php +++ b/app/code/Magento/Developer/Test/Unit/Console/Command/DevTestsRunCommandTest.php @@ -23,7 +23,7 @@ class DevTestsRunCommandTest extends \PHPUnit_Framework_TestCase */ private $command; - public function setUp() + protected function setUp() { $this->command = new DevTestsRunCommand(); } diff --git a/app/code/Magento/Developer/Test/Unit/Console/Command/XmlConverterCommandTest.php b/app/code/Magento/Developer/Test/Unit/Console/Command/XmlConverterCommandTest.php index 382a3e9af8e6..c090edd58336 100644 --- a/app/code/Magento/Developer/Test/Unit/Console/Command/XmlConverterCommandTest.php +++ b/app/code/Magento/Developer/Test/Unit/Console/Command/XmlConverterCommandTest.php @@ -34,7 +34,7 @@ class XmlConverterCommandTest extends \PHPUnit_Framework_TestCase */ private $xsltProcessorFactory; - public function setUp() + protected function setUp() { if (!function_exists('libxml_set_external_entity_loader')) { $this->markTestSkipped('Skipped on HHVM. Will be fixed in MAGETWO-45033'); diff --git a/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php b/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php index ef8884d4b1f6..a802fe220041 100644 --- a/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Developer/Test/Unit/Helper/DataTest.php @@ -27,7 +27,7 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected $httpHeaderMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $className = 'Magento\Developer\Helper\Data'; diff --git a/app/code/Magento/Developer/Test/Unit/Model/View/Page/Config/ClientSideLessCompilation/RendererTest.php b/app/code/Magento/Developer/Test/Unit/Model/View/Page/Config/ClientSideLessCompilation/RendererTest.php index 59e10a1c4aac..ae54ee25ae24 100644 --- a/app/code/Magento/Developer/Test/Unit/Model/View/Page/Config/ClientSideLessCompilation/RendererTest.php +++ b/app/code/Magento/Developer/Test/Unit/Model/View/Page/Config/ClientSideLessCompilation/RendererTest.php @@ -19,7 +19,7 @@ class RendererTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\View\Asset\Repository */ private $assetRepo; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $pageConfigMock = $this->getMockBuilder('Magento\Framework\View\Page\Config') diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php index 90ae72d9a3c7..553ad477d90d 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php @@ -49,7 +49,7 @@ class CarrierTest extends \PHPUnit_Framework_TestCase * @return void * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { $this->_helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Directory/Test/Unit/Block/CurrencyTest.php b/app/code/Magento/Directory/Test/Unit/Block/CurrencyTest.php index ca18618e9e13..ce936bd5defd 100644 --- a/app/code/Magento/Directory/Test/Unit/Block/CurrencyTest.php +++ b/app/code/Magento/Directory/Test/Unit/Block/CurrencyTest.php @@ -23,7 +23,7 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase */ protected $urlBuilder; - public function setUp() + protected function setUp() { $this->urlBuilder = $this->getMock( '\Magento\Framework\UrlInterface', diff --git a/app/code/Magento/Directory/Test/Unit/Helper/DataTest.php b/app/code/Magento/Directory/Test/Unit/Helper/DataTest.php index 1bf3fd0faa2e..14f97a985bf9 100644 --- a/app/code/Magento/Directory/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Directory/Test/Unit/Helper/DataTest.php @@ -39,7 +39,7 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected $_object; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); diff --git a/app/code/Magento/Directory/Test/Unit/Model/Country/Postcode/Config/ConverterTest.php b/app/code/Magento/Directory/Test/Unit/Model/Country/Postcode/Config/ConverterTest.php index ca1fe8011133..5f4b788e3c47 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/Country/Postcode/Config/ConverterTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/Country/Postcode/Config/ConverterTest.php @@ -17,7 +17,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $booleanUtilsMock; - public function setUp() + protected function setUp() { $this->booleanUtilsMock = $this->getMock('Magento\Framework\Stdlib\BooleanUtils', [], [], '', false); $this->model = new \Magento\Directory\Model\Country\Postcode\Config\Converter($this->booleanUtilsMock); diff --git a/app/code/Magento/Directory/Test/Unit/Model/Country/Postcode/Config/ReaderTest.php b/app/code/Magento/Directory/Test/Unit/Model/Country/Postcode/Config/ReaderTest.php index 17a9b8dc4507..721a58ffd6b9 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/Country/Postcode/Config/ReaderTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/Country/Postcode/Config/ReaderTest.php @@ -15,7 +15,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase /** * Prepare parameters */ - public function setUp() + protected function setUp() { $fileResolver = $this->getMockBuilder( 'Magento\Framework\App\Config\FileResolver' diff --git a/app/code/Magento/Directory/Test/Unit/Model/CountryTest.php b/app/code/Magento/Directory/Test/Unit/Model/CountryTest.php index 2b9b3a1939d7..0ffd1fb5ea8a 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/CountryTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/CountryTest.php @@ -17,7 +17,7 @@ class CountryTest extends \PHPUnit_Framework_TestCase */ protected $localeListsMock; - public function setUp() + protected function setUp() { $this->localeListsMock = $this->getMock('Magento\Framework\Locale\ListsInterface'); diff --git a/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php b/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php index 8e293391e418..1373a53c0785 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/CurrencyTest.php @@ -22,7 +22,7 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase */ protected $localeCurrencyMock; - public function setUp() + protected function setUp() { $this->localeCurrencyMock = $this->getMock('\Magento\Framework\Locale\CurrencyInterface'); diff --git a/app/code/Magento/Directory/Test/Unit/Model/ObserverTest.php b/app/code/Magento/Directory/Test/Unit/Model/ObserverTest.php index b50be176cfaa..3a6a05853f05 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/ObserverTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/ObserverTest.php @@ -36,7 +36,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Translate\Inline\StateInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $inlineTranslation; - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php b/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php index 7a601a9e79e3..deb96fe20b43 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/PriceCurrencyTest.php @@ -25,7 +25,7 @@ class PriceCurrencyTest extends \PHPUnit_Framework_TestCase */ protected $currencyFactory; - public function setUp() + protected function setUp() { $this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManager') ->disableOriginalConstructor() diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Adminhtml/Sales/Items/Column/Downloadable/NameTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Adminhtml/Sales/Items/Column/Downloadable/NameTest.php index e8d5ce90a764..c3693275cbf8 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Adminhtml/Sales/Items/Column/Downloadable/NameTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Adminhtml/Sales/Items/Column/Downloadable/NameTest.php @@ -28,7 +28,7 @@ class NameTest extends \PHPUnit_Framework_TestCase */ protected $itemsFactory; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $contextMock = $this->getMockBuilder('Magento\Backend\Block\Template\Context') diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Catalog/Product/LinksTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Catalog/Product/LinksTest.php index 5a570915899d..c23a6ce7ae38 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Catalog/Product/LinksTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Catalog/Product/LinksTest.php @@ -38,7 +38,7 @@ class LinksTest extends \PHPUnit_Framework_TestCase */ protected $jsonEncoder; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->layout = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php index a90eea0c4df3..ee38e07df2ae 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/DownloadableTest.php @@ -28,7 +28,7 @@ class DownloadableTest extends \PHPUnit_Framework_TestCase */ protected $itemsFactory; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $contextMock = $this->getMockBuilder('Magento\Backend\Block\Template\Context') diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php index 8264f5adb326..64b3c9b02dff 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Email/Items/Order/DownloadableTest.php @@ -28,7 +28,7 @@ class DownloadableTest extends \PHPUnit_Framework_TestCase */ protected $itemsFactory; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $contextMock = $this->getMockBuilder('Magento\Backend\Block\Template\Context') diff --git a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php index 0c0a904cf978..892735890563 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Block/Sales/Order/Item/Renderer/DownloadableTest.php @@ -28,7 +28,7 @@ class DownloadableTest extends \PHPUnit_Framework_TestCase */ protected $itemsFactory; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $contextMock = $this->getMockBuilder('Magento\Backend\Block\Template\Context') diff --git a/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php b/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php index fe0cb366ee9f..89e8be10ae69 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Helper/DownloadTest.php @@ -28,8 +28,10 @@ class DownloadTest extends \PHPUnit_Framework_TestCase /** @var DownloadableFile|\PHPUnit_Framework_MockObject_MockObject */ protected $_downloadableFileMock; + /** @var \Magento\Framework\Session\SessionManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $sessionManager; + /** @var \Magento\Framework\Filesystem\File\ReadFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $fileReadFactory; @@ -47,7 +49,7 @@ class DownloadTest extends \PHPUnit_Framework_TestCase const URL = 'http://example.com'; - public function setUp() + protected function setUp() { require_once __DIR__ . '/../_files/download_mock.php'; diff --git a/app/code/Magento/Downloadable/Test/Unit/Observer/IsAllowedGuestCheckoutObserverTest.php b/app/code/Magento/Downloadable/Test/Unit/Observer/IsAllowedGuestCheckoutObserverTest.php index 7d72ffcb3798..e42f5a41dfb8 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Observer/IsAllowedGuestCheckoutObserverTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Observer/IsAllowedGuestCheckoutObserverTest.php @@ -26,7 +26,6 @@ class IsAllowedGuestCheckoutObserverTest extends \PHPUnit_Framework_TestCase */ private $resultMock; - /** * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Event */ @@ -46,7 +45,7 @@ class IsAllowedGuestCheckoutObserverTest extends \PHPUnit_Framework_TestCase * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. */ - public function setUp() + protected function setUp() { $this->scopeConfig = $this->getMockBuilder('\Magento\Framework\App\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/Downloadable/Test/Unit/Observer/SaveDownloadableOrderItemObserverTest.php b/app/code/Magento/Downloadable/Test/Unit/Observer/SaveDownloadableOrderItemObserverTest.php index c185421a1e05..91ee031f0d13 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Observer/SaveDownloadableOrderItemObserverTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Observer/SaveDownloadableOrderItemObserverTest.php @@ -72,7 +72,7 @@ class SaveDownloadableOrderItemObserverTest extends \PHPUnit_Framework_TestCase * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. */ - public function setUp() + protected function setUp() { $this->scopeConfig = $this->getMockBuilder('\Magento\Framework\App\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php b/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php index b0a7a4136d8a..a40c7a3e5d15 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Observer/SetLinkStatusObserverTest.php @@ -54,7 +54,7 @@ class SetLinkStatusObserverTest extends \PHPUnit_Framework_TestCase * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. */ - public function setUp() + protected function setUp() { $this->scopeConfig = $this->getMockBuilder('\Magento\Framework\App\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/DownloadableImportExport/Test/Unit/Model/Import/Product/Type/DownloadableTest.php b/app/code/Magento/DownloadableImportExport/Test/Unit/Model/Import/Product/Type/DownloadableTest.php index a64f3dbd98a2..cdf77b1bc65b 100644 --- a/app/code/Magento/DownloadableImportExport/Test/Unit/Model/Import/Product/Type/DownloadableTest.php +++ b/app/code/Magento/DownloadableImportExport/Test/Unit/Model/Import/Product/Type/DownloadableTest.php @@ -73,7 +73,7 @@ class DownloadableTest extends \Magento\ImportExport\Test\Unit\Model\Import\Abst * Set up * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { parent::setUp(); diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/BooleanTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/BooleanTest.php index 1e94762f1dfb..0aa867295542 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/BooleanTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/BooleanTest.php @@ -17,7 +17,7 @@ class BooleanTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->_model = $objectManager->getObject('Magento\Eav\Model\Entity\Attribute\Source\Boolean'); diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php index deb01a12144b..de1a5e6cbae4 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php @@ -20,7 +20,7 @@ class TableTest extends \PHPUnit_Framework_TestCase */ protected $collectionFactory; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php index f96e5ddf0f84..a5805b06f588 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php @@ -69,7 +69,7 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase */ protected $statementMock; - public function setUp() + protected function setUp() { $this->coreEntityFactoryMock = $this->getMock( 'Magento\Framework\Data\Collection\EntityFactory', diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/VersionControl/AbstractCollectionTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/VersionControl/AbstractCollectionTest.php index 15ad1e37d492..c426562e4495 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/VersionControl/AbstractCollectionTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/VersionControl/AbstractCollectionTest.php @@ -25,7 +25,7 @@ class AbstractCollectionTest extends \Magento\Eav\Test\Unit\Model\Entity\Collect */ protected $entitySnapshot; - public function setUp() + protected function setUp() { parent::setUp(); diff --git a/app/code/Magento/Email/Test/Unit/Block/Adminhtml/Template/Edit/FormTest.php b/app/code/Magento/Email/Test/Unit/Block/Adminhtml/Template/Edit/FormTest.php index 99c0d6e01041..683edb425c07 100644 --- a/app/code/Magento/Email/Test/Unit/Block/Adminhtml/Template/Edit/FormTest.php +++ b/app/code/Magento/Email/Test/Unit/Block/Adminhtml/Template/Edit/FormTest.php @@ -28,7 +28,7 @@ class FormTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Email\Model\Template|\PHPUnit_Framework_MockObject_MockObject */ protected $templateMock; - public function setUp() + protected function setUp() { $this->registryMock = $this->getMockBuilder('Magento\Framework\Registry') ->disableOriginalConstructor() diff --git a/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php b/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php index bfd381d29f88..0f5910b607f0 100644 --- a/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/AbstractTemplateTest.php @@ -71,7 +71,7 @@ class AbstractTemplateTest extends \PHPUnit_Framework_TestCase */ private $templateFactory; - public function setUp() + protected function setUp() { $this->design = $this->getMockBuilder('Magento\Framework\View\DesignInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/ConverterTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/Config/ConverterTest.php index 246f07b88e65..26ceae144a72 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/ConverterTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/ConverterTest.php @@ -12,7 +12,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new \Magento\Email\Model\Template\Config\Converter(); } diff --git a/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php b/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php index 3fe540beeac0..6b00b6069667 100644 --- a/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/TemplateTest.php @@ -85,7 +85,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase */ private $templateFactory; - public function setUp() + protected function setUp() { $this->context = $this->getMockBuilder('Magento\Framework\Model\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/EncryptionKey/Test/Unit/Controller/Adminhtml/Crypt/Key/SaveTest.php b/app/code/Magento/EncryptionKey/Test/Unit/Controller/Adminhtml/Crypt/Key/SaveTest.php index 1575f58af750..580609a18399 100644 --- a/app/code/Magento/EncryptionKey/Test/Unit/Controller/Adminhtml/Crypt/Key/SaveTest.php +++ b/app/code/Magento/EncryptionKey/Test/Unit/Controller/Adminhtml/Crypt/Key/SaveTest.php @@ -14,20 +14,26 @@ class SaveTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Framework\Encryption\EncryptorInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $encryptMock; + /** @var \Magento\EncryptionKey\Model\ResourceModel\Key\Change|\PHPUnit_Framework_MockObject_MockObject */ protected $changeMock; + /** @var \Magento\Framework\App\CacheInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $cacheMock; + /** @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $requestMock; + /** @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $managerMock; + /** @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $responseMock; + /** @var \Magento\EncryptionKey\Controller\Adminhtml\Crypt\Key\Save */ protected $model; - public function setUp() + protected function setUp() { $this->encryptMock = $this->getMockBuilder('Magento\Framework\Encryption\EncryptorInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/EncryptionKey/Test/Unit/Model/ResourceModel/Key/ChangeTest.php b/app/code/Magento/EncryptionKey/Test/Unit/Model/ResourceModel/Key/ChangeTest.php index af4dd6477a10..8b01dcfb1567 100644 --- a/app/code/Magento/EncryptionKey/Test/Unit/Model/ResourceModel/Key/ChangeTest.php +++ b/app/code/Magento/EncryptionKey/Test/Unit/Model/ResourceModel/Key/ChangeTest.php @@ -13,28 +13,38 @@ class ChangeTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Framework\Encryption\EncryptorInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $encryptMock; + /** @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject */ protected $filesystemMock; + /** @var \Magento\Config\Model\Config\Structure|\PHPUnit_Framework_MockObject_MockObject */ protected $structureMock; + /** @var \Magento\Framework\App\DeploymentConfig\Writer|\PHPUnit_Framework_MockObject_MockObject */ protected $writerMock; + /** @var \Magento\Framework\DB\Adapter\AdapterInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $adapterMock; + /** @var \Magento\Framework\App\ResourceConnection|\PHPUnit_Framework_MockObject_MockObject */ protected $resourceMock; + /** @var \Magento\Framework\DB\Select|\PHPUnit_Framework_MockObject_MockObject */ protected $selectMock; + /** @var \Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface */ protected $tansactionMock; + /** @var |\PHPUnit_Framework_MockObject_MockObject */ protected $objRelationMock; + /** @var \Magento\Framework\Math\Random|\PHPUnit_Framework_MockObject_MockObject */ protected $randomMock; + /** @var \Magento\EncryptionKey\Model\ResourceModel\Key\Change */ protected $model; - public function setUp() + protected function setUp() { $this->encryptMock = $this->getMockBuilder('Magento\Framework\Encryption\EncryptorInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/Fedex/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Fedex/Test/Unit/Model/CarrierTest.php index 82f5fd06898c..3b43dca19280 100644 --- a/app/code/Magento/Fedex/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Fedex/Test/Unit/Model/CarrierTest.php @@ -47,7 +47,7 @@ class CarrierTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->scope = $this->getMockBuilder( '\Magento\Framework\App\Config\ScopeConfigInterface' diff --git a/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/GiftOptionsTest.php b/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/GiftOptionsTest.php index b26b7ab20419..443476eebf9d 100644 --- a/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/GiftOptionsTest.php +++ b/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/GiftOptionsTest.php @@ -27,7 +27,7 @@ class GiftOptionsTest extends \PHPUnit_Framework_TestCase /** @var array */ protected $jsLayout = ['root' => 'node']; - public function setUp() + protected function setUp() { $this->context = $this->getMock('Magento\Backend\Block\Template\Context', [], [], '', false); $this->jsonEncoderMock = $this->getMock('Magento\Framework\Json\Encoder', [], [], '', false); diff --git a/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/GiftOptionsTest.php b/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/GiftOptionsTest.php index d0a47a7ff3de..b4780102d8ba 100644 --- a/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/GiftOptionsTest.php +++ b/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/GiftOptionsTest.php @@ -28,7 +28,7 @@ class GiftOptionsTest extends \PHPUnit_Framework_TestCase /** @var array */ protected $jsLayout = ['root' => 'node']; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMockBuilder('Magento\Backend\Block\Template\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/ItemIdProcessorTest.php b/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/ItemIdProcessorTest.php index 3b2db5f3e466..d30b815ea0da 100644 --- a/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/ItemIdProcessorTest.php +++ b/app/code/Magento/GiftMessage/Test/Unit/Block/Cart/Item/Renderer/Actions/ItemIdProcessorTest.php @@ -13,7 +13,7 @@ class ItemIdProcessorTest extends \PHPUnit_Framework_TestCase /** @var ItemIdProcessor */ protected $model; - public function setUp() + protected function setUp() { $this->model = new ItemIdProcessor(); } diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Model/ProductTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Model/ProductTest.php index 649d0e3d3bff..6514ba08588d 100644 --- a/app/code/Magento/GroupedProduct/Test/Unit/Model/ProductTest.php +++ b/app/code/Magento/GroupedProduct/Test/Unit/Model/ProductTest.php @@ -159,7 +159,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { $this->categoryIndexerMock = $this->getMockForAbstractClass('\Magento\Framework\Indexer\IndexerInterface'); diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/ConfiguredPriceTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/ConfiguredPriceTest.php index e8ca3f1f1d56..775ea0186e97 100644 --- a/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/ConfiguredPriceTest.php +++ b/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/ConfiguredPriceTest.php @@ -42,8 +42,7 @@ class ConfiguredPriceTest extends \PHPUnit_Framework_TestCase */ protected $priceInfo; - - public function setUp() + protected function setUp() { $this->price = $this->getMockBuilder('Magento\Framework\Pricing\Price\PriceInterface') ->getMock(); diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php index 84aa8886ee85..3382d18a3935 100644 --- a/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php +++ b/app/code/Magento/GroupedProduct/Test/Unit/Pricing/Price/FinalPriceTest.php @@ -34,7 +34,7 @@ class FinalPriceTest extends \PHPUnit_Framework_TestCase /** * Setup */ - public function setUp() + protected function setUp() { $this->saleableItemMock = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); $this->calculatorMock = $this->getMock('Magento\Framework\Pricing\Adjustment\Calculator', [], [], '', false); diff --git a/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php b/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php index ab6ca4ff4f1c..4445e6afa6aa 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Export/FilterTest.php @@ -127,7 +127,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase */ private $dateTimeFormatter; - public function setUp() + protected function setUp() { $this->modelContext = $this->getMock('Magento\Framework\Model\Context', [], [], '', false); $this->registry = $this->getMock('Magento\Framework\Registry', [], [], '', false); diff --git a/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Import/Edit/FormTest.php b/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Import/Edit/FormTest.php index 9f293b731d57..9b0a84f2006a 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Import/Edit/FormTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Block/Adminhtml/Import/Edit/FormTest.php @@ -32,7 +32,7 @@ class FormTest extends \PHPUnit_Framework_TestCase */ protected $form; - public function setUp() + protected function setUp() { $context = $this->getMockBuilder('\Magento\Backend\Block\Template\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index 3b7d713f165a..b6de98deb1bc 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -45,7 +45,7 @@ class ReportTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->context = $this->getMock( 'Magento\Framework\App\Helper\Context', diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/ConverterTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/ConverterTest.php index e34a31ea09cb..f595a036a146 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/ConverterTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/ConverterTest.php @@ -22,7 +22,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $moduleManager; - public function setUp() + protected function setUp() { $this->filePath = realpath(__DIR__) . '/_files/'; $this->moduleManager = $this->getMock('Magento\Framework\Module\Manager', ['isOutputEnabled'], [], '', false); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/AdapterTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/AdapterTest.php index 0e2324942bae..a19a0cbb3ba5 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/AdapterTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/AdapterTest.php @@ -14,7 +14,7 @@ class AdapterTest extends \PHPUnit_Framework_TestCase */ protected $adapter; - public function setUp() + protected function setUp() { $this->adapter = $this->getMock( '\Magento\ImportExport\Model\Import\Adapter', diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/ConverterTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/ConverterTest.php index 8834c5407a32..df036fc15f08 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/ConverterTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/ConverterTest.php @@ -22,7 +22,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $moduleManager; - public function setUp() + protected function setUp() { $this->filePath = realpath(__DIR__) . '/_files/'; $this->moduleManager = $this->getMock('Magento\Framework\Module\Manager', ['isOutputEnabled'], [], '', false); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/ErrorProcessing/ProcessingErrorAggregatorTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/ErrorProcessing/ProcessingErrorAggregatorTest.php index 1c176b078823..3a534ce5adcf 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/ErrorProcessing/ProcessingErrorAggregatorTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/ErrorProcessing/ProcessingErrorAggregatorTest.php @@ -39,7 +39,7 @@ class ProcessingErrorAggregatorTest extends \PHPUnit_Framework_TestCase /** * Preparing mock objects */ - public function setUp() + protected function setUp() { $this->processingErrorFactoryMock = $this->getMock( '\Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorFactory', diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/ErrorProcessing/ProcessingErrorTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/ErrorProcessing/ProcessingErrorTest.php index 0651ab465924..cd6ad66de9ff 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/ErrorProcessing/ProcessingErrorTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/ErrorProcessing/ProcessingErrorTest.php @@ -16,7 +16,7 @@ class ProcessingErrorTest extends \PHPUnit_Framework_TestCase /** * Preparing mock objects */ - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject('\Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError'); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php index 87e51fb76aa1..b0128dc03aff 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Source/ZipTest.php @@ -18,7 +18,7 @@ class ZipTest extends \PHPUnit_Framework_TestCase */ protected $zip; - public function setUp() + protected function setUp() { $this->directory = $this->getMockBuilder('\Magento\Framework\Filesystem\Directory\Write') ->disableOriginalConstructor() diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php index 97ba2374604b..48dbf7bd1e36 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php @@ -108,7 +108,7 @@ class ImportTest extends \Magento\ImportExport\Test\Unit\Model\Import\AbstractIm * * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { parent::setUp(); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Report/CsvTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Report/CsvTest.php index 4e3d7dc65e35..da060b45b344 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Report/CsvTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Report/CsvTest.php @@ -42,7 +42,7 @@ class CsvTest extends \PHPUnit_Framework_TestCase */ protected $csvModel; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -75,7 +75,6 @@ public function setUp() $this->filesystemMock = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false); - $this->csvModel = $objectManager->getObject( '\Magento\ImportExport\Model\Report\Csv', [ diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ResourceModel/HistoryTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ResourceModel/HistoryTest.php index e946de524411..8fcff296935e 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ResourceModel/HistoryTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ResourceModel/HistoryTest.php @@ -25,7 +25,7 @@ class HistoryTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->historyResourceModel = $this->getMock( 'Magento\ImportExport\Model\ResourceModel\History', diff --git a/app/code/Magento/Indexer/Test/Unit/Model/CacheContextTest.php b/app/code/Magento/Indexer/Test/Unit/Model/CacheContextTest.php index 9d0f4530f803..1b0275de0468 100644 --- a/app/code/Magento/Indexer/Test/Unit/Model/CacheContextTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/CacheContextTest.php @@ -16,7 +16,7 @@ class CacheContextTest extends \PHPUnit_Framework_TestCase /** * Set up test */ - public function setUp() + protected function setUp() { $this->context = new \Magento\Framework\Indexer\CacheContext(); } diff --git a/app/code/Magento/Indexer/Test/Unit/Model/Processor/InvalidateCacheTest.php b/app/code/Magento/Indexer/Test/Unit/Model/Processor/InvalidateCacheTest.php index d85d153c134b..0a9ad31ba273 100644 --- a/app/code/Magento/Indexer/Test/Unit/Model/Processor/InvalidateCacheTest.php +++ b/app/code/Magento/Indexer/Test/Unit/Model/Processor/InvalidateCacheTest.php @@ -46,7 +46,7 @@ class InvalidateCacheTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->subjectMock = $this->getMock('Magento\Indexer\Model\Processor', [], [], '', false); $this->contextMock = $this->getMock('Magento\Framework\Indexer\CacheContext', [], [], '', false); diff --git a/app/code/Magento/Integration/Test/Unit/Model/Config/ConverterTest.php b/app/code/Magento/Integration/Test/Unit/Model/Config/ConverterTest.php index 9b76b2f65894..4bb95a82ab9b 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/Config/ConverterTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/Config/ConverterTest.php @@ -17,7 +17,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->model = new Converter(); } diff --git a/app/code/Magento/Integration/Test/Unit/Model/Config/Integration/ConverterTest.php b/app/code/Magento/Integration/Test/Unit/Model/Config/Integration/ConverterTest.php index e30ea0ca882b..fb3ba4450a6c 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/Config/Integration/ConverterTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/Config/Integration/ConverterTest.php @@ -17,7 +17,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->model = new Converter(); } diff --git a/app/code/Magento/Integration/Test/Unit/Model/ConsolidatedConfigTest.php b/app/code/Magento/Integration/Test/Unit/Model/ConsolidatedConfigTest.php index f148f9f5ac88..6f69f0200412 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/ConsolidatedConfigTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/ConsolidatedConfigTest.php @@ -30,7 +30,7 @@ class ConsolidatedConfigTest extends \PHPUnit_Framework_TestCase */ protected $configReaderMock; - public function setUp() + protected function setUp() { $this->configCacheTypeMock = $this->getMockBuilder('Magento\Integration\Model\Cache\TypeConsolidated') ->disableOriginalConstructor() diff --git a/app/code/Magento/Integration/Test/Unit/Model/CredentialsValidatorTest.php b/app/code/Magento/Integration/Test/Unit/Model/CredentialsValidatorTest.php index fca622b6f7bb..94808b6c7a23 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/CredentialsValidatorTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/CredentialsValidatorTest.php @@ -15,7 +15,7 @@ class CredentialsValidatorTest extends \PHPUnit_Framework_TestCase */ protected $credentialsValidator; - public function setUp() + protected function setUp() { $this->credentialsValidator = new \Magento\Integration\Model\CredentialsValidator(); } diff --git a/app/code/Magento/Integration/Test/Unit/Model/IntegrationConfigTest.php b/app/code/Magento/Integration/Test/Unit/Model/IntegrationConfigTest.php index e9449fd737b3..6702e69ef46f 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/IntegrationConfigTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/IntegrationConfigTest.php @@ -28,7 +28,7 @@ class IntegrationConfigTest extends \PHPUnit_Framework_TestCase */ protected $configReaderMock; - public function setUp() + protected function setUp() { $this->configCacheTypeMock = $this->getMockBuilder('Magento\Integration\Model\Cache\TypeIntegration') ->disableOriginalConstructor() diff --git a/app/code/Magento/Integration/Test/Unit/Model/IntegrationTest.php b/app/code/Magento/Integration/Test/Unit/Model/IntegrationTest.php index c083b8f25da9..07d6591261ce 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/IntegrationTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/IntegrationTest.php @@ -35,7 +35,7 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase */ protected $resourceCollectionMock; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock( 'Magento\Framework\Model\Context', diff --git a/app/code/Magento/Integration/Test/Unit/Model/ManagerTest.php b/app/code/Magento/Integration/Test/Unit/Model/ManagerTest.php index b196e5685d3b..e429f87a8153 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/ManagerTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/ManagerTest.php @@ -36,7 +36,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase */ protected $integrationManager; - public function setUp() + protected function setUp() { $this->integrationServiceMock = $this->getMockBuilder( '\Magento\Integration\Api\IntegrationServiceInterface' diff --git a/app/code/Magento/Integration/Test/Unit/Model/Oauth/ConsumerTest.php b/app/code/Magento/Integration/Test/Unit/Model/Oauth/ConsumerTest.php index 328eb1ebe756..beacd2fb5188 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/Oauth/ConsumerTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/Oauth/ConsumerTest.php @@ -63,7 +63,7 @@ class ConsumerTest extends \PHPUnit_Framework_TestCase */ protected $validDataArray; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock( 'Magento\Framework\Model\Context', diff --git a/app/code/Magento/Integration/Test/Unit/Model/Plugin/IntegrationTest.php b/app/code/Magento/Integration/Test/Unit/Model/Plugin/IntegrationTest.php index cd38d44fe22c..e5bc5d3ca74d 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/Plugin/IntegrationTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/Plugin/IntegrationTest.php @@ -44,7 +44,7 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase */ protected $consolidatedConfigMock; - public function setUp() + protected function setUp() { $this->subjectMock = $this->getMock('Magento\Integration\Model\IntegrationService', [], [], '', false); $this->integrationAuthServiceMock = $this->getMock( diff --git a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Integration/CollectionTest.php b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Integration/CollectionTest.php index 55d7d76552c4..ae731fe821ec 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Integration/CollectionTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Integration/CollectionTest.php @@ -20,7 +20,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ protected $collection; - public function setUp() + protected function setUp() { $this->select = $this->getMockBuilder('Magento\Framework\DB\Select') ->disableOriginalConstructor() diff --git a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/ConsumerTest.php b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/ConsumerTest.php index 5ee415dfed27..f83ae4b12286 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/ConsumerTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/ConsumerTest.php @@ -30,7 +30,7 @@ class ConsumerTest extends \PHPUnit_Framework_TestCase */ protected $consumerResource; - public function setUp() + protected function setUp() { $this->consumerMock = $this->getMock( 'Magento\Integration\Model\Oauth\Consumer', diff --git a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/NonceTest.php b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/NonceTest.php index 9aa51c79260d..53c0c806bb22 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/NonceTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/NonceTest.php @@ -25,7 +25,7 @@ class NonceTest extends \PHPUnit_Framework_TestCase */ protected $nonceResource; - public function setUp() + protected function setUp() { $this->connectionMock = $this->getMock('Magento\Framework\DB\Adapter\Pdo\Mysql', [], [], '', false); diff --git a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/Token/CollectionTest.php b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/Token/CollectionTest.php index 6809db5f575d..c45de375e1d7 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/Token/CollectionTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/Token/CollectionTest.php @@ -20,7 +20,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ protected $collection; - public function setUp() + protected function setUp() { $this->select = $this->getMockBuilder('Magento\Framework\DB\Select') ->disableOriginalConstructor() diff --git a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/TokenTest.php b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/TokenTest.php index 60ecbebd32ea..b3f37d08e83b 100644 --- a/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/TokenTest.php +++ b/app/code/Magento/Integration/Test/Unit/Model/ResourceModel/Oauth/TokenTest.php @@ -25,7 +25,7 @@ class TokenTest extends \PHPUnit_Framework_TestCase */ protected $tokenResource; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->connectionMock = $this->getMock('Magento\Framework\DB\Adapter\Pdo\Mysql', [], [], '', false); diff --git a/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php b/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php index 3ad89207c912..5f8b988f2ff6 100644 --- a/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php +++ b/app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php @@ -55,7 +55,7 @@ class OauthTest extends \PHPUnit_Framework_TestCase const REQUEST_URL = 'http://magento.ll'; - public function setUp() + protected function setUp() { $this->_consumerFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\ConsumerFactory') ->disableOriginalConstructor() diff --git a/app/code/Magento/Marketplace/Test/Unit/Block/PartnersTest.php b/app/code/Magento/Marketplace/Test/Unit/Block/PartnersTest.php index 15a8a57178bc..928875512fd4 100644 --- a/app/code/Magento/Marketplace/Test/Unit/Block/PartnersTest.php +++ b/app/code/Magento/Marketplace/Test/Unit/Block/PartnersTest.php @@ -13,7 +13,7 @@ class PartnersTest extends \PHPUnit_Framework_TestCase */ private $partnersBlockMock; - public function setUp() + protected function setUp() { $this->partnersBlockMock = $this->getPartnersBlockMock( [ diff --git a/app/code/Magento/Marketplace/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Marketplace/Test/Unit/Controller/Index/IndexTest.php index 861894b5955f..0dc02f46cbdb 100644 --- a/app/code/Magento/Marketplace/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Marketplace/Test/Unit/Controller/Index/IndexTest.php @@ -13,7 +13,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase */ private $indexControllerMock; - public function setUp() + protected function setUp() { $this->indexControllerMock = $this->getControllerIndexMock(['getResultPageFactory']); } diff --git a/app/code/Magento/Marketplace/Test/Unit/Controller/Partners/IndexTest.php b/app/code/Magento/Marketplace/Test/Unit/Controller/Partners/IndexTest.php index 4be940307773..933249686c3e 100644 --- a/app/code/Magento/Marketplace/Test/Unit/Controller/Partners/IndexTest.php +++ b/app/code/Magento/Marketplace/Test/Unit/Controller/Partners/IndexTest.php @@ -13,7 +13,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase */ private $partnersControllerMock; - public function setUp() + protected function setUp() { $this->partnersControllerMock = $this->getControllerIndexMock( [ diff --git a/app/code/Magento/Marketplace/Test/Unit/Helper/CacheTest.php b/app/code/Magento/Marketplace/Test/Unit/Helper/CacheTest.php index d1bca025bb8b..fa9a5eb60268 100644 --- a/app/code/Magento/Marketplace/Test/Unit/Helper/CacheTest.php +++ b/app/code/Magento/Marketplace/Test/Unit/Helper/CacheTest.php @@ -13,7 +13,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase */ private $cacheHelperMock; - public function setUp() + protected function setUp() { $this->cacheHelperMock = $this->getCacheHelperMock(['getCache']); } @@ -52,7 +52,6 @@ public function testSavePartnersToCache() $this->cacheHelperMock->savePartnersToCache([]); } - /** * Gets cache helper mock * diff --git a/app/code/Magento/Marketplace/Test/Unit/Model/PartnersTest.php b/app/code/Magento/Marketplace/Test/Unit/Model/PartnersTest.php index 3bd26da613ce..79667ced4385 100644 --- a/app/code/Magento/Marketplace/Test/Unit/Model/PartnersTest.php +++ b/app/code/Magento/Marketplace/Test/Unit/Model/PartnersTest.php @@ -33,7 +33,7 @@ class PartnersTest extends \PHPUnit_Framework_TestCase } }'; - public function setUp() + protected function setUp() { $this->partnersModelMock = $this->getPartnersModelMock( [ diff --git a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/MediaTest.php b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/MediaTest.php index 64f53cb28873..5f2292567080 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/MediaTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/MediaTest.php @@ -23,7 +23,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase /** @var Media */ protected $helper; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->dirMock = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\ReadInterface') diff --git a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/Storage/DatabaseTest.php b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/Storage/DatabaseTest.php index f6759f458402..1f8826718ad5 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/Storage/DatabaseTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/Storage/DatabaseTest.php @@ -30,7 +30,7 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase /** @var Database */ protected $helper; - public function setUp() + protected function setUp() { $this->dbStorageFactoryMock = $this->getMockBuilder('Magento\MediaStorage\Model\File\Storage\DatabaseFactory') ->disableOriginalConstructor() diff --git a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/StorageTest.php b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/StorageTest.php index 78ed745a09f1..a15671f49933 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/Helper/File/StorageTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/Helper/File/StorageTest.php @@ -29,7 +29,7 @@ class StorageTest extends \PHPUnit_Framework_TestCase /** @var Storage */ protected $helper; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $className = 'Magento\MediaStorage\Helper\File\Storage'; diff --git a/app/code/Magento/MediaStorage/Test/Unit/Model/Asset/Plugin/CleanMergedJsCssTest.php b/app/code/Magento/MediaStorage/Test/Unit/Model/Asset/Plugin/CleanMergedJsCssTest.php index de6cc0daedd3..ae087a152529 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/Model/Asset/Plugin/CleanMergedJsCssTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/Model/Asset/Plugin/CleanMergedJsCssTest.php @@ -32,7 +32,7 @@ class CleanMergedJsCssTest extends \Magento\Framework\TestFramework\Unit\BaseTes */ private $model; - public function setUp() + protected function setUp() { parent::setUp(); $this->filesystemMock = $this->basicMock('\Magento\Framework\Filesystem'); diff --git a/app/code/Magento/Msrp/Test/Unit/Model/Product/Attribute/Source/Type/PriceTest.php b/app/code/Magento/Msrp/Test/Unit/Model/Product/Attribute/Source/Type/PriceTest.php index 5687195c3021..62966face393 100644 --- a/app/code/Magento/Msrp/Test/Unit/Model/Product/Attribute/Source/Type/PriceTest.php +++ b/app/code/Magento/Msrp/Test/Unit/Model/Product/Attribute/Source/Type/PriceTest.php @@ -14,7 +14,7 @@ class PriceTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->_model = $objectManager->getObject('Magento\Msrp\Model\Product\Attribute\Source\Type\Price'); diff --git a/app/code/Magento/Multishipping/Test/Unit/Helper/DataTest.php b/app/code/Magento/Multishipping/Test/Unit/Helper/DataTest.php index 45b9f5650cbb..d6abf2533a3f 100644 --- a/app/code/Magento/Multishipping/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Multishipping/Test/Unit/Helper/DataTest.php @@ -38,7 +38,7 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected $checkoutSessionMock; - public function setUp() + protected function setUp() { $this->quoteMock = $this->getMock('\Magento\Quote\Model\Quote', [], [], '', false); diff --git a/app/code/Magento/Multishipping/Test/Unit/Model/Payment/Method/Specification/EnabledTest.php b/app/code/Magento/Multishipping/Test/Unit/Model/Payment/Method/Specification/EnabledTest.php index 801f6e0653e3..c00d96f887e6 100644 --- a/app/code/Magento/Multishipping/Test/Unit/Model/Payment/Method/Specification/EnabledTest.php +++ b/app/code/Magento/Multishipping/Test/Unit/Model/Payment/Method/Specification/EnabledTest.php @@ -24,7 +24,7 @@ class EnabledTest extends \PHPUnit_Framework_TestCase */ protected $paymentConfigMock; - public function setUp() + protected function setUp() { $this->paymentConfigMock = $this->getMock('\Magento\Payment\Model\Config', [], [], '', false); $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/CounterTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/CounterTest.php index c1ee82b9a14a..42939d7e7ed6 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/CounterTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/CounterTest.php @@ -58,7 +58,7 @@ class CounterTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->productManagement = $this->getMockBuilder('Magento\Catalog\Api\ProductManagementInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportCountsTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportCountsTest.php index 0c35f8d4318a..99480b70c579 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportCountsTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportCountsTest.php @@ -67,7 +67,7 @@ class ReportCountsTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->configMock = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportModulesInfoTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportModulesInfoTest.php index a76f893d690d..0dd899a9ec22 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportModulesInfoTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportModulesInfoTest.php @@ -47,7 +47,7 @@ class ReportModulesInfoTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportNewRelicCronTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportNewRelicCronTest.php index ddbf7315d343..622ce4d30531 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportNewRelicCronTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Cron/ReportNewRelicCronTest.php @@ -62,7 +62,7 @@ class ReportNewRelicCronTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/CheckConfigTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/CheckConfigTest.php index df1be3f04cab..5e53f5145379 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/CheckConfigTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/CheckConfigTest.php @@ -37,7 +37,7 @@ class CheckConfigTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentAdminsTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentAdminsTest.php index 6ab46e08be7c..cfe95e926bc0 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentAdminsTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentAdminsTest.php @@ -47,7 +47,7 @@ class ReportConcurrentAdminsTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentAdminsToNewRelicTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentAdminsToNewRelicTest.php index 1e045a9bfac7..e744543c5ed7 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentAdminsToNewRelicTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentAdminsToNewRelicTest.php @@ -37,7 +37,7 @@ class ReportConcurrentAdminsToNewRelicTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentUsersTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentUsersTest.php index d21abb070a0f..28acdf8801ca 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentUsersTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentUsersTest.php @@ -57,7 +57,7 @@ class ReportConcurrentUsersTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentUsersToNewRelicTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentUsersToNewRelicTest.php index 9b964e84ed0b..7d2165c14d43 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentUsersToNewRelicTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportConcurrentUsersToNewRelicTest.php @@ -47,7 +47,7 @@ class ReportConcurrentUsersToNewRelicTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportOrderPlacedTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportOrderPlacedTest.php index ae513c742dc3..a42bab55866b 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportOrderPlacedTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportOrderPlacedTest.php @@ -37,7 +37,7 @@ class ReportOrderPlacedTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportOrderPlacedToNewRelicTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportOrderPlacedToNewRelicTest.php index 7642fc5c9355..3a2138b42ce3 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportOrderPlacedToNewRelicTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportOrderPlacedToNewRelicTest.php @@ -32,7 +32,7 @@ class ReportOrderPlacedToNewRelicTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductDeletedTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductDeletedTest.php index ef9ea1c3e1c1..0e3217656665 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductDeletedTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductDeletedTest.php @@ -42,7 +42,7 @@ class ReportProductDeletedTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductDeletedToNewRelicTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductDeletedToNewRelicTest.php index cfc53f4d9cf9..7e841d59edca 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductDeletedToNewRelicTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductDeletedToNewRelicTest.php @@ -32,7 +32,7 @@ class ReportProductDeletedToNewRelicTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedTest.php index 0bf53dc352b4..f219462a10fb 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedTest.php @@ -42,7 +42,7 @@ class ReportProductSavedTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedToNewRelicTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedToNewRelicTest.php index 1e9d6f6053fb..7f6c81ae50a9 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedToNewRelicTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportProductSavedToNewRelicTest.php @@ -33,7 +33,7 @@ class ReportProductSavedToNewRelicTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportSystemCacheFlushTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportSystemCacheFlushTest.php index 124dcef3dd6d..8c6c1ea32d86 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportSystemCacheFlushTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportSystemCacheFlushTest.php @@ -42,7 +42,7 @@ class ReportSystemCacheFlushTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportSystemCacheFlushToNewRelicTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportSystemCacheFlushToNewRelicTest.php index 2a7660e19905..87fce27b73a7 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportSystemCacheFlushToNewRelicTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Observer/ReportSystemCacheFlushToNewRelicTest.php @@ -42,7 +42,7 @@ class ReportSystemCacheFlushToNewRelicTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\NewRelicReporting\Model\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/Newsletter/Test/Unit/Block/Adminhtml/Queue/PreviewTest.php b/app/code/Magento/Newsletter/Test/Unit/Block/Adminhtml/Queue/PreviewTest.php index 6819e5b845a7..dae38205e1d7 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Block/Adminhtml/Queue/PreviewTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Block/Adminhtml/Queue/PreviewTest.php @@ -42,7 +42,7 @@ class PreviewTest extends \PHPUnit_Framework_TestCase */ protected $preview; - public function setUp() + protected function setUp() { $context = $this->getMock('Magento\Backend\Block\Template\Context', [], [], '', false); $eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php index 52b7452bf2cd..5a89e77644e3 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php @@ -27,7 +27,7 @@ class CustomerPluginTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->subscriberFactory = $this->getMockBuilder('\Magento\Newsletter\Model\SubscriberFactory') ->disableOriginalConstructor() diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/QueueTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/QueueTest.php index 90048c836827..b110bf7f3023 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/QueueTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/QueueTest.php @@ -57,7 +57,7 @@ class QueueTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->templateFilter = $this->getMockBuilder('\Magento\Newsletter\Model\Template\Filter') ->disableOriginalConstructor() diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php index fdf4abf5b87b..39f06d20f2e6 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php @@ -62,7 +62,7 @@ class SubscriberTest extends \PHPUnit_Framework_TestCase */ protected $subscriber; - public function setUp() + protected function setUp() { $this->newsletterData = $this->getMock('Magento\Newsletter\Helper\Data', [], [], '', false); $this->scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/Template/FilterTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/Template/FilterTest.php index 8202b3a5a090..e267ddd3d7b5 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/Template/FilterTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/Template/FilterTest.php @@ -22,7 +22,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase */ protected $appState; - public function setUp() + protected function setUp() { $scopeConfig = $this->getMockForAbstractClass( '\Magento\Framework\App\Config\ScopeConfigInterface', diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php index 0bf24fdf4c48..9aacaa5d2fac 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/TemplateTest.php @@ -88,7 +88,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase */ private $filterFactory; - public function setUp() + protected function setUp() { $this->context = $this->getMockBuilder('Magento\Framework\Model\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/PageCache/Test/Unit/App/CacheIdentifierPluginTest.php b/app/code/Magento/PageCache/Test/Unit/App/CacheIdentifierPluginTest.php index a99ac6c68e9d..8fbcae237b1a 100644 --- a/app/code/Magento/PageCache/Test/Unit/App/CacheIdentifierPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/App/CacheIdentifierPluginTest.php @@ -36,7 +36,7 @@ class CacheIdentifierPluginTest extends \PHPUnit_Framework_TestCase /** * Set up data for test */ - public function setUp() + protected function setUp() { $this->designExceptionsMock = $this->getMock( 'Magento\Framework\View\DesignExceptions', diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php index fa7717a90241..61a4766bb387 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php @@ -58,7 +58,7 @@ class BuiltinPluginTest extends \PHPUnit_Framework_TestCase /** * SetUp */ - public function setUp() + protected function setUp() { $this->configMock = $this->getMock('Magento\PageCache\Model\Config', [], [], '', false); $this->versionMock = $this->getMock('Magento\Framework\App\PageCache\Version', [], [], '', false); diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php index a2a0ec524ba1..a5cbb156a2fe 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php @@ -53,7 +53,7 @@ class VarnishPluginTest extends \PHPUnit_Framework_TestCase /** * SetUp */ - public function setUp() + protected function setUp() { $this->configMock = $this->getMock('Magento\PageCache\Model\Config', [], [], '', false); $this->versionMock = $this->getMock('Magento\Framework\App\PageCache\Version', [], [], '', false); diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/PageCachePluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/PageCachePluginTest.php index d9b1e1322e74..449a9d98dba5 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/App/PageCachePluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/App/PageCachePluginTest.php @@ -18,7 +18,7 @@ class PageCachePluginTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\PageCache\Cache*/ private $subjectMock; - public function setUp() + protected function setUp() { $this->plugin = (new ObjectManager($this))->getObject('\Magento\PageCache\Model\App\PageCachePlugin'); $this->subjectMock = $this->getMockBuilder('\Magento\Framework\App\PageCache\Cache') diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php index 4e947b8fc778..4f1eb32b412c 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/Cache/ServerTest.php @@ -23,7 +23,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\UrlInterface */ protected $urlBuilderMock; - public function setUp() + protected function setUp() { $this->configMock = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); $this->loggerMock = $this->getMock('Magento\Framework\Cache\InvalidateLogger', [], [], '', false); diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Cache/TypeTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Cache/TypeTest.php index 26340e6dbe78..577ac0f0ca93 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/Cache/TypeTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/Cache/TypeTest.php @@ -16,7 +16,7 @@ class TypeTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\Cache\Type\FrontendPool */ protected $cacheFrontendPoolMock; - public function setUp() + protected function setUp() { $this->eventManagerMock = $this->getMockBuilder('Magento\Framework\Event\ManagerInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/PageCache/Test/Unit/Model/ConfigTest.php b/app/code/Magento/PageCache/Test/Unit/Model/ConfigTest.php index 2e8fe07ab3b6..30ac1c5784e2 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/ConfigTest.php @@ -32,7 +32,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase /** * setUp all mocks and data function */ - public function setUp() + protected function setUp() { $readFactoryMock = $this->getMock('Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); $this->_coreConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Layout/DepersonalizePluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Layout/DepersonalizePluginTest.php index 3aa6175ab5e8..21017ddcfa61 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/Layout/DepersonalizePluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/Layout/DepersonalizePluginTest.php @@ -41,7 +41,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase /** * SetUp */ - public function setUp() + protected function setUp() { $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); $this->eventManagerMock = $this->getMock('Magento\Framework\Event\Manager', [], [], '', false); diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php index 0c68d726d3fc..010493d2035a 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php @@ -27,7 +27,7 @@ class LayoutPluginTest extends \PHPUnit_Framework_TestCase */ protected $configMock; - public function setUp() + protected function setUp() { $this->layoutMock = $this->getMockForAbstractClass( 'Magento\Framework\View\Layout', diff --git a/app/code/Magento/PageCache/Test/Unit/Observer/FlushAllCacheTest.php b/app/code/Magento/PageCache/Test/Unit/Observer/FlushAllCacheTest.php index f05b547e9ff4..37833413d71b 100644 --- a/app/code/Magento/PageCache/Test/Unit/Observer/FlushAllCacheTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Observer/FlushAllCacheTest.php @@ -29,7 +29,7 @@ class FlushAllCacheTest extends \PHPUnit_Framework_TestCase /** * Set up all mocks and data for test */ - public function setUp() + protected function setUp() { $this->_configMock = $this->getMock( 'Magento\PageCache\Model\Config', diff --git a/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php b/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php index 8947d83d698f..1fcbff4fbf9c 100644 --- a/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Observer/FlushCacheByTagsTest.php @@ -26,7 +26,7 @@ class FlushCacheByTagsTest extends \PHPUnit_Framework_TestCase /** * Set up all mocks and data for test */ - public function setUp() + protected function setUp() { $this->_configMock = $this->getMock( 'Magento\PageCache\Model\Config', diff --git a/app/code/Magento/PageCache/Test/Unit/Observer/InvalidateCacheIfChangedTest.php b/app/code/Magento/PageCache/Test/Unit/Observer/InvalidateCacheIfChangedTest.php index 71f9f9137598..9e6af2285729 100644 --- a/app/code/Magento/PageCache/Test/Unit/Observer/InvalidateCacheIfChangedTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Observer/InvalidateCacheIfChangedTest.php @@ -26,7 +26,7 @@ class InvalidateCacheIfChangedTest extends \PHPUnit_Framework_TestCase /** * Set up all mocks and data for test */ - public function setUp() + protected function setUp() { $this->configMock = $this->getMock( 'Magento\PageCache\Model\Config', diff --git a/app/code/Magento/PageCache/Test/Unit/Observer/InvalidateCacheTest.php b/app/code/Magento/PageCache/Test/Unit/Observer/InvalidateCacheTest.php index 6c4827998b58..c9ba860113f5 100644 --- a/app/code/Magento/PageCache/Test/Unit/Observer/InvalidateCacheTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Observer/InvalidateCacheTest.php @@ -25,7 +25,7 @@ class InvalidateCacheTest extends \PHPUnit_Framework_TestCase /** * Set up all mocks and data for test */ - public function setUp() + protected function setUp() { $this->_configMock = $this->getMock( 'Magento\PageCache\Model\Config', diff --git a/app/code/Magento/PageCache/Test/Unit/Observer/ProcessLayoutRenderElementTest.php b/app/code/Magento/PageCache/Test/Unit/Observer/ProcessLayoutRenderElementTest.php index 9a20eb22b7f3..9f18dbfa2dfc 100644 --- a/app/code/Magento/PageCache/Test/Unit/Observer/ProcessLayoutRenderElementTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Observer/ProcessLayoutRenderElementTest.php @@ -32,7 +32,7 @@ class ProcessLayoutRenderElementTest extends \PHPUnit_Framework_TestCase /** * Set up all mocks and data for test */ - public function setUp() + protected function setUp() { $this->_configMock = $this->getMock( 'Magento\PageCache\Model\Config', diff --git a/app/code/Magento/PageCache/Test/Unit/Observer/RegisterFormKeyFromCookieTest.php b/app/code/Magento/PageCache/Test/Unit/Observer/RegisterFormKeyFromCookieTest.php index 58866fe5b8ba..7ea33970ae6e 100644 --- a/app/code/Magento/PageCache/Test/Unit/Observer/RegisterFormKeyFromCookieTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Observer/RegisterFormKeyFromCookieTest.php @@ -44,7 +44,7 @@ class RegisterFormKeyFromCookieTest extends \PHPUnit_Framework_TestCase /** * Set up all mocks and data for test */ - public function setUp() + protected function setUp() { $this->cookieFormKey = $this->getMockBuilder( 'Magento\Framework\App\PageCache\FormKey' diff --git a/app/code/Magento/Payment/Test/Unit/Block/Info/CcTest.php b/app/code/Magento/Payment/Test/Unit/Block/Info/CcTest.php index 299e290833de..744beb6634a8 100644 --- a/app/code/Magento/Payment/Test/Unit/Block/Info/CcTest.php +++ b/app/code/Magento/Payment/Test/Unit/Block/Info/CcTest.php @@ -28,7 +28,7 @@ class CcTest extends \PHPUnit_Framework_TestCase */ protected $localeDate; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->paymentConfig = $this->getMock('Magento\Payment\Model\Config', [], [], '', false); diff --git a/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php b/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php index d2f023dcceb7..97286561fad4 100644 --- a/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php +++ b/app/code/Magento/Payment/Test/Unit/Block/Info/SubstitutionTest.php @@ -25,7 +25,7 @@ class SubstitutionTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseCheckoutTest.php b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseCheckoutTest.php index 6e30ba078742..d64efadbeb2f 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseCheckoutTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseCheckoutTest.php @@ -15,7 +15,7 @@ class CanUseCheckoutTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new CanUseCheckout(); } diff --git a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountry/CountryProviderTest.php b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountry/CountryProviderTest.php index b3dd5c981724..dd33a4c0b877 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountry/CountryProviderTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountry/CountryProviderTest.php @@ -17,7 +17,7 @@ class CountryProviderTest extends \PHPUnit_Framework_TestCase */ protected $directoryMock; - public function setUp() + protected function setUp() { $this->directoryMock = $this->getMock('Magento\Directory\Helper\Data', [], [], '', false, false); $this->model = new \Magento\Payment\Model\Checks\CanUseForCountry\CountryProvider($this->directoryMock); diff --git a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountryTest.php b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountryTest.php index 52ca47dc50e0..2742f152b4f7 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountryTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountryTest.php @@ -25,7 +25,7 @@ class CanUseForCountryTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->countryProvider = $this->getMock( 'Magento\Payment\Model\Checks\CanUseForCountry\CountryProvider', diff --git a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCurrencyTest.php b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCurrencyTest.php index 34be0350ed2c..a3b6c6db899a 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCurrencyTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCurrencyTest.php @@ -20,7 +20,7 @@ class CanUseForCurrencyTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new CanUseForCurrency(); } diff --git a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseInternalTest.php b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseInternalTest.php index 0f63be65e617..54f69431ff4a 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseInternalTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseInternalTest.php @@ -15,7 +15,7 @@ class CanUseInternalTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new CanUseInternal(); } diff --git a/app/code/Magento/Payment/Test/Unit/Model/Checks/SpecificationFactoryTest.php b/app/code/Magento/Payment/Test/Unit/Model/Checks/SpecificationFactoryTest.php index b6bef4df19d7..898076d54f18 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Checks/SpecificationFactoryTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Checks/SpecificationFactoryTest.php @@ -20,7 +20,7 @@ class SpecificationFactoryTest extends \PHPUnit_Framework_TestCase */ protected $_compositeFactory; - public function setUp() + protected function setUp() { $this->_compositeFactory = $this->getMockBuilder( 'Magento\Payment\Model\Checks\CompositeFactory' diff --git a/app/code/Magento/Payment/Test/Unit/Model/Config/ConverterTest.php b/app/code/Magento/Payment/Test/Unit/Model/Config/ConverterTest.php index 39bb6b5168e6..23a58d9b834b 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Config/ConverterTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Config/ConverterTest.php @@ -17,7 +17,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase /** @var array */ protected $_targetArray; - public function setUp() + protected function setUp() { $this->_model = new \Magento\Payment\Model\Config\Converter(); } diff --git a/app/code/Magento/Payment/Test/Unit/Model/Config/SchemaLocatorTest.php b/app/code/Magento/Payment/Test/Unit/Model/Config/SchemaLocatorTest.php index 66518e14d13a..665d5c6e882c 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Config/SchemaLocatorTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Config/SchemaLocatorTest.php @@ -16,7 +16,7 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase const MODULE_DIR_PATH = '/path/to/payment/schema'; - public function setUp() + protected function setUp() { $moduleReader = $this->getMockBuilder( 'Magento\Framework\Module\Dir\Reader' diff --git a/app/code/Magento/Payment/Test/Unit/Model/Config/Source/AllmethodsTest.php b/app/code/Magento/Payment/Test/Unit/Model/Config/Source/AllmethodsTest.php index e8fecc843e06..67de175ca014 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Config/Source/AllmethodsTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Config/Source/AllmethodsTest.php @@ -24,7 +24,7 @@ class AllmethodsTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_paymentData = $this->getMockBuilder( 'Magento\Payment\Helper\Data' diff --git a/app/code/Magento/Payment/Test/Unit/Model/Config/Source/CctypeTest.php b/app/code/Magento/Payment/Test/Unit/Model/Config/Source/CctypeTest.php index c54d558263f7..87d32873be24 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Config/Source/CctypeTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Config/Source/CctypeTest.php @@ -22,7 +22,7 @@ class CctypeTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_paymentConfig = $this->getMockBuilder( 'Magento\Payment\Model\Config' diff --git a/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php b/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php index e12e3dbde2cc..6de6726db31b 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php @@ -59,7 +59,7 @@ class AdapterTest extends \PHPUnit_Framework_TestCase */ private $adapter; - public function setUp() + protected function setUp() { $this->eventManager = $this->getMock( 'Magento\Framework\Event\ManagerInterface' diff --git a/app/code/Magento/Payment/Test/Unit/Model/Method/SubstitutionTest.php b/app/code/Magento/Payment/Test/Unit/Model/Method/SubstitutionTest.php index 2a82caf48ce4..1edfea43da25 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Method/SubstitutionTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Method/SubstitutionTest.php @@ -18,7 +18,7 @@ class SubstitutionTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $this->objectManager->getObject('Magento\Payment\Model\Method\Substitution'); diff --git a/app/code/Magento/Payment/Test/Unit/Model/Source/CctypeTest.php b/app/code/Magento/Payment/Test/Unit/Model/Source/CctypeTest.php index a1417cb079b6..6380e7013d5f 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Source/CctypeTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Source/CctypeTest.php @@ -43,7 +43,7 @@ class CctypeTest extends \PHPUnit_Framework_TestCase */ protected $_expectedToOptionsArray = [['value' => 'allowed_cc_type', 'label' => 'name']]; - public function setUp() + protected function setUp() { $this->_paymentConfig = $this->getMockBuilder( 'Magento\Payment\Model\Config' diff --git a/app/code/Magento/Payment/Test/Unit/Model/Source/InvoiceTest.php b/app/code/Magento/Payment/Test/Unit/Model/Source/InvoiceTest.php index 76043a482e98..5b0a89f9ce0f 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Source/InvoiceTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Source/InvoiceTest.php @@ -15,7 +15,7 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new Invoice(); } diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php index 98a7fd48f726..57ecd1ec8cfb 100644 --- a/app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Block/Billing/AgreementsTest.php @@ -59,7 +59,7 @@ class AgreementsTest extends \PHPUnit_Framework_TestCase */ private $block; - public function setUp() + protected function setUp() { $this->context = $this->getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false); $this->escaper = $this->getMock('Magento\Framework\Escaper', [], [], '', false); diff --git a/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php b/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php index 3e2a42c92e0a..c260f192303f 100644 --- a/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php @@ -48,7 +48,7 @@ class BackendTest extends \PHPUnit_Framework_TestCase */ private $helper; - public function setUp() + protected function setUp() { $this->context = $this->getMockBuilder('Magento\Framework\App\Helper\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/Paypal/Test/Unit/Helper/DataTest.php b/app/code/Magento/Paypal/Test/Unit/Helper/DataTest.php index d2ca61e893f2..91d44cb7a82d 100644 --- a/app/code/Magento/Paypal/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Helper/DataTest.php @@ -22,7 +22,7 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected $_helper; - public function setUp() + protected function setUp() { $this->_paymentDataMock = $this->getMockBuilder( 'Magento\Payment\Helper\Data' diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Handler/FraudHandlerTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Handler/FraudHandlerTest.php index 5b0c0a190409..d5b7dbddb089 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Handler/FraudHandlerTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Handler/FraudHandlerTest.php @@ -33,7 +33,7 @@ class FraudHandlerTest extends \PHPUnit_Framework_TestCase */ private $paypalInfoManagerMock; - public function setUp() + protected function setUp() { $this->paymentMock = $this->getMockBuilder('Magento\Payment\Model\InfoInterface') ->getMock(); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/PayflowExpressTest.php b/app/code/Magento/Paypal/Test/Unit/Model/PayflowExpressTest.php index 6797822e5f12..69893da9cf41 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/PayflowExpressTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/PayflowExpressTest.php @@ -26,7 +26,7 @@ class PayflowExpressTest extends \PHPUnit_Framework_TestCase */ const TRANSPORT_PAYFLOW_TXN_ID = 'Payflow pro transaction key'; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $proFactory = $this->getMockBuilder( diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Report/Settlement/RowTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Report/Settlement/RowTest.php index 0a0266ab6c52..f42779836794 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Report/Settlement/RowTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Report/Settlement/RowTest.php @@ -15,7 +15,7 @@ class RowTest extends \PHPUnit_Framework_TestCase */ protected $row; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->row = $objectManagerHelper->getObject('Magento\Paypal\Model\Report\Settlement\Row'); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/ResourceModel/Billing/AgreementTest.php b/app/code/Magento/Paypal/Test/Unit/Model/ResourceModel/Billing/AgreementTest.php index bed06a65edc0..34625c2ec434 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/ResourceModel/Billing/AgreementTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/ResourceModel/Billing/AgreementTest.php @@ -38,7 +38,7 @@ class AgreementTest extends \PHPUnit_Framework_TestCase */ protected $resourceConnectionMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManagerHelper($this); $contextMock = $this->getMockBuilder('Magento\Framework\Model\ResourceModel\Db\Context') diff --git a/app/code/Magento/Paypal/Test/Unit/Model/System/Config/Source/BmlPositionTest.php b/app/code/Magento/Paypal/Test/Unit/Model/System/Config/Source/BmlPositionTest.php index 70abbaa57984..c75557847b27 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/System/Config/Source/BmlPositionTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/System/Config/Source/BmlPositionTest.php @@ -12,7 +12,7 @@ class BmlPositionTest extends \PHPUnit_Framework_TestCase /** @var BmlPosition */ protected $model; - public function setUp() + protected function setUp() { $this->model = new BmlPosition(); } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/System/Config/Source/YesnoshortcutTest.php b/app/code/Magento/Paypal/Test/Unit/Model/System/Config/Source/YesnoshortcutTest.php index ac90215bc8b0..5ed81fc731cd 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/System/Config/Source/YesnoshortcutTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/System/Config/Source/YesnoshortcutTest.php @@ -14,7 +14,7 @@ class YesnoshortcutTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new Yesnoshortcut(); } diff --git a/app/code/Magento/Persistent/Test/Unit/Observer/PreventExpressCheckoutObserverTest.php b/app/code/Magento/Persistent/Test/Unit/Observer/PreventExpressCheckoutObserverTest.php index b8ecc14d4828..9757383858c6 100644 --- a/app/code/Magento/Persistent/Test/Unit/Observer/PreventExpressCheckoutObserverTest.php +++ b/app/code/Magento/Persistent/Test/Unit/Observer/PreventExpressCheckoutObserverTest.php @@ -54,7 +54,7 @@ class PreventExpressCheckoutObserverTest extends \PHPUnit_Framework_TestCase */ protected $_expressRedirectHelper; - public function setUp() + protected function setUp() { $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/ProductVideo/Test/Unit/Block/Adminhtml/Product/Edit/NewVideoTest.php b/app/code/Magento/ProductVideo/Test/Unit/Block/Adminhtml/Product/Edit/NewVideoTest.php index 181890f3fb80..d03de27ea9ab 100644 --- a/app/code/Magento/ProductVideo/Test/Unit/Block/Adminhtml/Product/Edit/NewVideoTest.php +++ b/app/code/Magento/ProductVideo/Test/Unit/Block/Adminhtml/Product/Edit/NewVideoTest.php @@ -48,7 +48,7 @@ class NewVideoTest extends \PHPUnit_Framework_TestCase */ protected $block; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('\Magento\Backend\Block\Template\Context', [], [], '', false); $this->mediaHelper = $this->getMock('\Magento\ProductVideo\Helper\Media', [], [], '', false); diff --git a/app/code/Magento/ProductVideo/Test/Unit/Block/Product/View/GalleryTest.php b/app/code/Magento/ProductVideo/Test/Unit/Block/Product/View/GalleryTest.php index bc3b1c63d6ab..e4140227e905 100644 --- a/app/code/Magento/ProductVideo/Test/Unit/Block/Product/View/GalleryTest.php +++ b/app/code/Magento/ProductVideo/Test/Unit/Block/Product/View/GalleryTest.php @@ -49,7 +49,7 @@ class GalleryTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('\Magento\Catalog\Block\Product\Context', [], [], '', false); $this->arrayUtilsMock = $this->getMock('\Magento\Framework\Stdlib\ArrayUtils', [], [], '', false); diff --git a/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php b/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php index 46e128488707..c6123d1a301b 100644 --- a/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php +++ b/app/code/Magento/ProductVideo/Test/Unit/Controller/Adminhtml/Product/Gallery/RetrieveImageTest.php @@ -69,7 +69,7 @@ class RetrieveImageTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('\Magento\Backend\App\Action\Context', [], [], '', false); $this->rawFactoryMock = diff --git a/app/code/Magento/ProductVideo/Test/Unit/Model/Plugin/Catalog/Product/Gallery/CreateHandlerTest.php b/app/code/Magento/ProductVideo/Test/Unit/Model/Plugin/Catalog/Product/Gallery/CreateHandlerTest.php index 5238e5fe9dba..5c4032b9bcc7 100644 --- a/app/code/Magento/ProductVideo/Test/Unit/Model/Plugin/Catalog/Product/Gallery/CreateHandlerTest.php +++ b/app/code/Magento/ProductVideo/Test/Unit/Model/Plugin/Catalog/Product/Gallery/CreateHandlerTest.php @@ -37,7 +37,7 @@ class CreateHandlerTest extends \PHPUnit_Framework_TestCase */ protected $mediaGalleryCreateHandler; - public function setUp() + protected function setUp() { $this->product = $this->getMock( 'Magento\Catalog\Model\Product', diff --git a/app/code/Magento/ProductVideo/Test/Unit/Model/Plugin/Catalog/Product/Gallery/ReadHandlerTest.php b/app/code/Magento/ProductVideo/Test/Unit/Model/Plugin/Catalog/Product/Gallery/ReadHandlerTest.php index 145b79aeff65..48c0470c09aa 100644 --- a/app/code/Magento/ProductVideo/Test/Unit/Model/Plugin/Catalog/Product/Gallery/ReadHandlerTest.php +++ b/app/code/Magento/ProductVideo/Test/Unit/Model/Plugin/Catalog/Product/Gallery/ReadHandlerTest.php @@ -38,7 +38,7 @@ class ReadHandlerTest extends \PHPUnit_Framework_TestCase */ protected $mediaGalleryReadHandler; - public function setUp() + protected function setUp() { $this->product = $this->getMock( 'Magento\Catalog\Model\Product', diff --git a/app/code/Magento/ProductVideo/Test/Unit/Model/Product/Attribute/Media/ExternalVideoEntryConverterTest.php b/app/code/Magento/ProductVideo/Test/Unit/Model/Product/Attribute/Media/ExternalVideoEntryConverterTest.php index b5484edef1e2..624e2c4dc395 100644 --- a/app/code/Magento/ProductVideo/Test/Unit/Model/Product/Attribute/Media/ExternalVideoEntryConverterTest.php +++ b/app/code/Magento/ProductVideo/Test/Unit/Model/Product/Attribute/Media/ExternalVideoEntryConverterTest.php @@ -49,7 +49,7 @@ class ExternalVideoEntryConverterTest extends \PHPUnit_Framework_TestCase */ protected $modelObject; - public function setUp() + protected function setUp() { $this->mediaGalleryEntryFactoryMock = $this->getMock( diff --git a/app/code/Magento/ProductVideo/Test/Unit/Model/Product/Attribute/Media/VideoEntryTest.php b/app/code/Magento/ProductVideo/Test/Unit/Model/Product/Attribute/Media/VideoEntryTest.php index 67e7ef0ab83e..5139da358f4d 100644 --- a/app/code/Magento/ProductVideo/Test/Unit/Model/Product/Attribute/Media/VideoEntryTest.php +++ b/app/code/Magento/ProductVideo/Test/Unit/Model/Product/Attribute/Media/VideoEntryTest.php @@ -18,7 +18,7 @@ class VideoEntryTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->modelObject = $this->getMock( diff --git a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php index f94d9676f16d..d47748c1df3e 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php @@ -60,7 +60,7 @@ class CartTotalRepositoryTest extends \PHPUnit_Framework_TestCase */ protected $totalsConverterMock; - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); $this->totalsFactoryMock = $this->getMock( diff --git a/app/code/Magento/Quote/Test/Unit/Model/Cart/Totals/ItemConverterTest.php b/app/code/Magento/Quote/Test/Unit/Model/Cart/Totals/ItemConverterTest.php index ee95fbc13d56..0d18bd4c0322 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Cart/Totals/ItemConverterTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Cart/Totals/ItemConverterTest.php @@ -33,7 +33,7 @@ class ItemConverterTest extends \PHPUnit_Framework_TestCase */ private $model; - public function setUp() + protected function setUp() { $this->configPoolMock = $this->getMock('Magento\Catalog\Helper\Product\ConfigurationPool', [], [], '', false); $this->eventManagerMock = $this->getMock('Magento\Framework\Event\ManagerInterface'); diff --git a/app/code/Magento/Quote/Test/Unit/Model/CustomerManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/CustomerManagementTest.php index 4f1d3033a573..c77b0ae69d0c 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/CustomerManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/CustomerManagementTest.php @@ -14,26 +14,32 @@ class CustomerManagementTest extends \PHPUnit_Framework_TestCase * @var \Magento\Quote\Model\CustomerManagement */ protected $customerManagement; + /** * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $customerRepositoryMock; + /** * @var \Magento\Customer\Api\AccountManagementInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $accountManagementMock; + /** * @var \Magento\Customer\Api\AddressRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $customerAddressRepositoryMock; + /** * @var \Magento\Quote\Model\Quote|\PHPUnit_Framework_MockObject_MockObject */ protected $quoteMock; + /** * @var \Magento\Quote\Model\Quote\Address|\PHPUnit_Framework_MockObject_MockObject */ protected $quoteAddressMock; + /** * @var \Magento\Customer\Api\Data\CustomerInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -44,7 +50,7 @@ class CustomerManagementTest extends \PHPUnit_Framework_TestCase */ protected $customerAddressMock; - public function setUp() + protected function setUp() { $this->customerRepositoryMock = $this->getMockForAbstractClass( 'Magento\Customer\Api\CustomerRepositoryInterface', diff --git a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestCartTotalRepositoryTest.php b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestCartTotalRepositoryTest.php index 4dbae8f121da..1f4eb01ca4d0 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestCartTotalRepositoryTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestCartTotalRepositoryTest.php @@ -43,7 +43,7 @@ class GuestCartTotalRepositoryTest extends \PHPUnit_Framework_TestCase */ protected $cartId; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php index 18598ba4b1c5..a22d10aee931 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/CompareTest.php @@ -36,7 +36,7 @@ class CompareTest extends \PHPUnit_Framework_TestCase /** * test setUp */ - public function setUp() + protected function setUp() { $this->itemMock = $this->getMock( 'Magento\Quote\Model\Quote\Item', diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/ToOrderItemTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/ToOrderItemTest.php index d5e2c9f51dea..bf05b030f414 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/ToOrderItemTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Item/ToOrderItemTest.php @@ -45,7 +45,7 @@ class ToOrderItemTest extends \PHPUnit_Framework_TestCase */ protected $orderItemMock; - public function setUp() + protected function setUp() { $this->orderItemFactoryMock = $this->getMock( 'Magento\Sales\Api\Data\OrderItemInterfaceFactory', diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/Payment/ToOrderPaymentTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/Payment/ToOrderPaymentTest.php index 8c05f44b5cb5..4bd0595fe911 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/Payment/ToOrderPaymentTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/Payment/ToOrderPaymentTest.php @@ -41,7 +41,7 @@ class ToOrderPaymentTest extends \PHPUnit_Framework_TestCase */ protected $converter; - public function setUp() + protected function setUp() { $this->paymentMock = $this->getMock( 'Magento\Quote\Model\Quote\Payment', diff --git a/app/code/Magento/Quote/Test/Unit/Model/QuoteAddressValidatorTest.php b/app/code/Magento/Quote/Test/Unit/Model/QuoteAddressValidatorTest.php index 5a3aaf33f130..cc5d4a8dc701 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/QuoteAddressValidatorTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/QuoteAddressValidatorTest.php @@ -38,7 +38,7 @@ class QuoteAddressValidatorTest extends \PHPUnit_Framework_TestCase */ protected $customerSessionMock; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php b/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php index 06368f2b50ea..4a710ef72381 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/ItemTest.php @@ -55,7 +55,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase /** * Mock class dependencies */ - public function setUp() + protected function setUp() { $this->resourceMock = $this->getMock('Magento\Framework\App\ResourceConnection', [], [], '', false); $this->quoteItemMock = $this->getMock('Magento\Quote\Model\Quote\Item', [], [], '', false); diff --git a/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/QuoteAddressTest.php b/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/QuoteAddressTest.php index 05af2f1c24f7..4d2ca4785ef9 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/QuoteAddressTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/ResourceModel/Quote/QuoteAddressTest.php @@ -50,7 +50,7 @@ class QuoteAddressTest extends \PHPUnit_Framework_TestCase /** * Init */ - public function setUp() + protected function setUp() { $this->addressMock = $this->getMock( 'Magento\Quote\Model\Quote\Address', diff --git a/app/code/Magento/Quote/Test/Unit/Model/Webapi/ParamOverriderCartIdTest.php b/app/code/Magento/Quote/Test/Unit/Model/Webapi/ParamOverriderCartIdTest.php index 47ba62d3a56c..1f05e619fdfc 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Webapi/ParamOverriderCartIdTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Webapi/ParamOverriderCartIdTest.php @@ -27,7 +27,7 @@ class ParamOverriderCartIdTest extends \PHPUnit_Framework_TestCase */ private $userContext; - public function setUp() + protected function setUp() { $this->userContext = $this->getMockBuilder('Magento\Authorization\Model\UserContextInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Reports/Test/Unit/Observer/CatalogProductCompareAddProductObserverTest.php b/app/code/Magento/Reports/Test/Unit/Observer/CatalogProductCompareAddProductObserverTest.php index d5cc278d8d67..15519568452d 100644 --- a/app/code/Magento/Reports/Test/Unit/Observer/CatalogProductCompareAddProductObserverTest.php +++ b/app/code/Magento/Reports/Test/Unit/Observer/CatalogProductCompareAddProductObserverTest.php @@ -50,7 +50,7 @@ class CatalogProductCompareAddProductObserverTest extends \PHPUnit_Framework_Tes /** * {@inheritDoc} */ - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -105,7 +105,6 @@ public function setUp() ); } - /** * @param bool $isLoggedIn * @param string $userKey diff --git a/app/code/Magento/Reports/Test/Unit/Observer/CatalogProductViewObserverTest.php b/app/code/Magento/Reports/Test/Unit/Observer/CatalogProductViewObserverTest.php index e1ee285f2faf..9af77378d374 100644 --- a/app/code/Magento/Reports/Test/Unit/Observer/CatalogProductViewObserverTest.php +++ b/app/code/Magento/Reports/Test/Unit/Observer/CatalogProductViewObserverTest.php @@ -60,7 +60,7 @@ class CatalogProductViewObserverTest extends \PHPUnit_Framework_TestCase /** * {@inheritDoc} */ - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -181,7 +181,6 @@ public function testCatalogProductViewVisitor() 'store_id' => $storeId, ]; - $expectedEventData = [ 'event_type_id' => \Magento\Reports\Model\Event::EVENT_PRODUCT_VIEW, 'object_id' => $productId, diff --git a/app/code/Magento/Reports/Test/Unit/Observer/CustomerLoginObserverTest.php b/app/code/Magento/Reports/Test/Unit/Observer/CustomerLoginObserverTest.php index f528a330ece2..de5031a368d5 100644 --- a/app/code/Magento/Reports/Test/Unit/Observer/CustomerLoginObserverTest.php +++ b/app/code/Magento/Reports/Test/Unit/Observer/CustomerLoginObserverTest.php @@ -50,7 +50,7 @@ class CustomerLoginObserverTest extends \PHPUnit_Framework_TestCase /** * {@inheritDoc} */ - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -102,8 +102,6 @@ public function setUp() ); } - - /** * @return void */ diff --git a/app/code/Magento/Reports/Test/Unit/Observer/CustomerLogoutObserverTest.php b/app/code/Magento/Reports/Test/Unit/Observer/CustomerLogoutObserverTest.php index 0c215119c1b6..27d868f43090 100644 --- a/app/code/Magento/Reports/Test/Unit/Observer/CustomerLogoutObserverTest.php +++ b/app/code/Magento/Reports/Test/Unit/Observer/CustomerLogoutObserverTest.php @@ -35,7 +35,7 @@ class CustomerLogoutObserverTest extends \PHPUnit_Framework_TestCase /** * {@inheritDoc} */ - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Review/Test/Unit/Controller/Product/PostTest.php b/app/code/Magento/Review/Test/Unit/Controller/Product/PostTest.php index cc9e167bc41b..80f513dc81df 100644 --- a/app/code/Magento/Review/Test/Unit/Controller/Product/PostTest.php +++ b/app/code/Magento/Review/Test/Unit/Controller/Product/PostTest.php @@ -101,7 +101,7 @@ class PostTest extends \PHPUnit_Framework_TestCase /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { $this->redirect = $this->getMock('\Magento\Framework\App\Response\RedirectInterface'); $this->request = $this->getMock('\Magento\Framework\App\Request\Http', ['getParam'], [], '', false); diff --git a/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php b/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php index b415513f0c86..21fedd54b9ed 100644 --- a/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php +++ b/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/CollectionTest.php @@ -37,7 +37,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $store = $this->getMock('\Magento\Store\Model\Store', ['getId'], [], '', false); $store->expects($this->any())->method('getId')->will($this->returnValue(1)); diff --git a/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/Product/CollectionTest.php b/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/Product/CollectionTest.php index 30e60915e577..fea6fea7d8cb 100644 --- a/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/Product/CollectionTest.php +++ b/app/code/Magento/Review/Test/Unit/Model/ResourceModel/Review/Product/CollectionTest.php @@ -22,7 +22,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ protected $dbSelect; - public function setUp() + protected function setUp() { $attribute = $this->getMock('\Magento\Eav\Model\Entity\Attribute\AbstractAttribute', null, [], '', false); $eavConfig = $this->getMock('\Magento\Eav\Model\Config', ['getAttribute'], [], '', false); diff --git a/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php b/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php index fed70aa3893b..f3fd32c041c3 100644 --- a/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php +++ b/app/code/Magento/Rule/Test/Unit/Model/Condition/AbstractConditionTest.php @@ -13,7 +13,7 @@ class AbstractConditionTest extends \PHPUnit_Framework_TestCase */ protected $_condition; - public function setUp() + protected function setUp() { $this->_condition = $this->getMockForAbstractClass( '\Magento\Rule\Model\Condition\AbstractCondition', diff --git a/app/code/Magento/Rule/Test/Unit/Model/Condition/Product/AbstractProductTest.php b/app/code/Magento/Rule/Test/Unit/Model/Condition/Product/AbstractProductTest.php index df68deaaf76d..ead77f120222 100644 --- a/app/code/Magento/Rule/Test/Unit/Model/Condition/Product/AbstractProductTest.php +++ b/app/code/Magento/Rule/Test/Unit/Model/Condition/Product/AbstractProductTest.php @@ -39,7 +39,7 @@ class AbstractProductTest extends \PHPUnit_Framework_TestCase */ protected $_configProperty; - public function setUp() + protected function setUp() { $this->_condition = $this->getMockForAbstractClass( '\Magento\Rule\Model\Condition\Product\AbstractProduct', diff --git a/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php b/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php index 02ed6bb2a305..283f0cc829cf 100644 --- a/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php +++ b/app/code/Magento/Rule/Test/Unit/Model/Condition/Sql/BuilderTest.php @@ -15,7 +15,7 @@ class BuilderTest extends \PHPUnit_Framework_TestCase */ protected $_builder; - public function setUp() + protected function setUp() { $expressionMock = $this->getMock('\Magento\Rule\Model\Condition\Sql\Expression', [], [], '', false); $expressionFactory = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Totals/TaxTest.php b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Totals/TaxTest.php index c44936c92c24..a6f0965577fc 100644 --- a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Totals/TaxTest.php +++ b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Totals/TaxTest.php @@ -14,7 +14,7 @@ class TaxTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Block\Adminhtml\Order\Totals\Tax */ private $taxMock; - public function setUp() + protected function setUp() { $getCalculatedTax = [ 'tax' => 'tax', diff --git a/app/code/Magento/Sales/Test/Unit/Block/Order/HistoryTest.php b/app/code/Magento/Sales/Test/Unit/Block/Order/HistoryTest.php index 10a79e93c51c..9e8f325857b6 100644 --- a/app/code/Magento/Sales/Test/Unit/Block/Order/HistoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Block/Order/HistoryTest.php @@ -42,7 +42,7 @@ class HistoryTest extends \PHPUnit_Framework_TestCase */ protected $pageTitleMock; - public function setUp() + protected function setUp() { $this->context = $this->getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false, false); $this->orderCollectionFactory = diff --git a/app/code/Magento/Sales/Test/Unit/Block/Order/RecentTest.php b/app/code/Magento/Sales/Test/Unit/Block/Order/RecentTest.php index 6c2a58890992..df9dea520a28 100644 --- a/app/code/Magento/Sales/Test/Unit/Block/Order/RecentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Block/Order/RecentTest.php @@ -32,7 +32,7 @@ class RecentTest extends \PHPUnit_Framework_TestCase */ protected $orderConfig; - public function setUp() + protected function setUp() { $this->context = $this->getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false, false); $this->orderCollectionFactory = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Creditmemo/AbstractCreditmemo/EmailTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Creditmemo/AbstractCreditmemo/EmailTest.php index 4eb6981e6433..4ee8de5c5646 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Creditmemo/AbstractCreditmemo/EmailTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Creditmemo/AbstractCreditmemo/EmailTest.php @@ -73,7 +73,7 @@ class EmailTest extends \PHPUnit_Framework_TestCase */ protected $resultRedirectMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->context = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Invoice/AbstractInvoice/EmailTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Invoice/AbstractInvoice/EmailTest.php index d076a5ca5b72..52d1cc6a17f6 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Invoice/AbstractInvoice/EmailTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Invoice/AbstractInvoice/EmailTest.php @@ -89,7 +89,7 @@ class EmailTest extends \PHPUnit_Framework_TestCase */ protected $invoiceManagement; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->context = $this->getMock('Magento\Backend\App\Action\Context', [], [], '', false); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/CancelTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/CancelTest.php index bf7b56cc4dbb..10636f0b8280 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/CancelTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/CancelTest.php @@ -59,7 +59,7 @@ class CancelTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->context = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php index 00c132739399..1d44e2dfad3c 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php @@ -80,7 +80,7 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $titleMock = $this->getMockBuilder('Magento\Framework\App\Action\Title') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/CancelTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/CancelTest.php index d576760f4548..2be4529c52d6 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/CancelTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/CancelTest.php @@ -83,7 +83,7 @@ class CancelTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->creditmemoManagementMock = $this->getMock( 'Magento\Sales\Api\CreditmemoManagementInterface', diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/NewActionTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/NewActionTest.php index 71d544dc6776..b781d72a535f 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/NewActionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/NewActionTest.php @@ -81,7 +81,7 @@ class NewActionTest extends \PHPUnit_Framework_TestCase */ protected $resultPageMock; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('Magento\Backend\App\Action\Context', [], [], '', false); $this->creditmemoLoaderMock = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/PrintActionTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/PrintActionTest.php index 03f77a15935a..55580d9688c7 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/PrintActionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/PrintActionTest.php @@ -81,7 +81,7 @@ class PrintActionTest extends \PHPUnit_Framework_TestCase */ protected $resultForwardMock; - public function setUp() + protected function setUp() { $this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') ->getMock(); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/UpdateQtyTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/UpdateQtyTest.php index ce4885775a78..dc53c52e0501 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/UpdateQtyTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/UpdateQtyTest.php @@ -101,7 +101,7 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->creditmemoMock = $this->getMockBuilder('Magento\Sales\Model\Order\Creditmemo') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php index dff7c7720838..e2ad9a10fa29 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php @@ -104,7 +104,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { $titleMock = $this->getMockBuilder('Magento\Framework\App\Action\Title') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/VoidTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/VoidTest.php index 4388b26ce128..b6bc453da5e2 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/VoidTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/VoidTest.php @@ -94,7 +94,7 @@ class VoidTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->creditmemoMock = $this->getMockBuilder('Magento\Sales\Model\Order\Creditmemo') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/CreditmemoLoaderTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/CreditmemoLoaderTest.php index ae5da1e25e8e..6a600e177a00 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/CreditmemoLoaderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/CreditmemoLoaderTest.php @@ -71,7 +71,7 @@ class CreditmemoLoaderTest extends \PHPUnit_Framework_TestCase */ protected $stockConfiguration; - public function setUp() + protected function setUp() { $data = []; $this->creditmemoRepositoryMock = $this->getMockBuilder('Magento\Sales\Api\CreditmemoRepositoryInterface') diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/EmailTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/EmailTest.php index c28d405e36cf..58aa92c09be4 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/EmailTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/EmailTest.php @@ -88,7 +88,7 @@ class EmailTest extends \PHPUnit_Framework_TestCase */ protected $orderMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->context = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/HoldTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/HoldTest.php index 530286c2a18d..3d3c62c4ea6f 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/HoldTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/HoldTest.php @@ -59,7 +59,7 @@ class HoldTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->context = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php index 1e7319500814..93d776a35d1f 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php @@ -84,7 +84,7 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CancelTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CancelTest.php index 0f1e92f00617..6331e60c69d1 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CancelTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CancelTest.php @@ -67,7 +67,7 @@ class CancelTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CaptureTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CaptureTest.php index 1935ec3d8483..e74264e8fb68 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CaptureTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CaptureTest.php @@ -72,7 +72,7 @@ class CaptureTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/NewActionTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/NewActionTest.php index e6a3015ccbdb..805b178d8374 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/NewActionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/NewActionTest.php @@ -89,8 +89,7 @@ class NewActionTest extends \PHPUnit_Framework_TestCase */ protected $invoiceServiceMock; - - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/PrintActionTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/PrintActionTest.php index ff32b69f4d22..f276708c1e16 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/PrintActionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/PrintActionTest.php @@ -49,7 +49,7 @@ class PrintActionTest extends \PHPUnit_Framework_TestCase */ protected $controller; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/SaveTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/SaveTest.php index d0f61409d294..64fce69d52e4 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/SaveTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/SaveTest.php @@ -48,7 +48,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/UpdateQtyTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/UpdateQtyTest.php index 7b8721f03eb3..0e4ccf48cdd1 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/UpdateQtyTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/UpdateQtyTest.php @@ -80,7 +80,7 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php index f9bf442ae2d9..8e4ade54c291 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php @@ -84,7 +84,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ protected $resultForwardFactoryMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/VoidTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/VoidTest.php index 35da02408551..4cd66680b139 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/VoidTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/VoidTest.php @@ -77,7 +77,7 @@ class VoidTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassCancelTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassCancelTest.php index e0c838f434c1..7bbd621f6e05 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassCancelTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassCancelTest.php @@ -85,7 +85,7 @@ class MassCancelTest extends \PHPUnit_Framework_TestCase */ protected $filterMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->contextMock = $this->getMock('Magento\Backend\App\Action\Context', [], [], '', false); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassHoldTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassHoldTest.php index 07c4aeb4e6c9..6c98603585e0 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassHoldTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassHoldTest.php @@ -90,7 +90,7 @@ class MassHoldTest extends \PHPUnit_Framework_TestCase */ protected $orderManagementMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->orderManagementMock = $this->getMockBuilder('Magento\Sales\Api\OrderManagementInterface') diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassUnholdTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassUnholdTest.php index 88ad9e69e704..7555d9dbb5b4 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassUnholdTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassUnholdTest.php @@ -85,7 +85,7 @@ class MassUnholdTest extends \PHPUnit_Framework_TestCase */ protected $filterMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->contextMock = $this->getMock('Magento\Backend\App\Action\Context', [], [], '', false); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/UnholdTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/UnholdTest.php index a83c524157c2..4f8a3b779ef3 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/UnholdTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/UnholdTest.php @@ -59,7 +59,7 @@ class UnholdTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->context = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/ViewTest.php index f119f4e794d8..366f3ab5c16e 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/ViewTest.php @@ -97,7 +97,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ protected $orderRepositoryMock; - public function setUp() + protected function setUp() { $this->orderManagementMock = $this->getMockBuilder('Magento\Sales\Api\OrderManagementInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php index 3ea41e30b46f..3ebbca491d60 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php @@ -72,7 +72,7 @@ class DownloadCustomOptionTest extends \PHPUnit_Framework_TestCase */ protected $objectMock; - public function setUp() + protected function setUp() { $resultForwardFactoryMock = $this->getMockBuilder('Magento\Framework\Controller\Result\ForwardFactory') ->disableOriginalConstructor() @@ -308,7 +308,6 @@ public function executeDataProvider() ]; } - public function testExecuteBadSecretKey() { $this->itemOptionMock->expects($this->once())->method('load')->willReturnSelf(); diff --git a/app/code/Magento/Sales/Test/Unit/Model/AbstractModelTest.php b/app/code/Magento/Sales/Test/Unit/Model/AbstractModelTest.php index a9f47eabc1a0..dc8542d16005 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/AbstractModelTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/AbstractModelTest.php @@ -15,7 +15,7 @@ class AbstractModelTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject('Magento\Sales\Model\Order'); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/ReaderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Config/ReaderTest.php index e326b8300911..db6635a194b7 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/ReaderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/ReaderTest.php @@ -15,7 +15,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase /** * Prepare parameters */ - public function setUp() + protected function setUp() { $fileResolver = $this->getMockBuilder( 'Magento\Framework\App\Config\FileResolver' diff --git a/app/code/Magento/Sales/Test/Unit/Model/Config/XsdTest.php b/app/code/Magento/Sales/Test/Unit/Model/Config/XsdTest.php index ef112af0f665..cd65f0f1ce62 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Config/XsdTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Config/XsdTest.php @@ -12,7 +12,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase */ protected $_xsdFile; - public function setUp() + protected function setUp() { if (!function_exists('libxml_set_external_entity_loader')) { $this->markTestSkipped('Skipped on HHVM. Will be fixed in MAGETWO-45033'); diff --git a/app/code/Magento/Sales/Test/Unit/Model/CronJob/CleanExpiredOrdersTest.php b/app/code/Magento/Sales/Test/Unit/Model/CronJob/CleanExpiredOrdersTest.php index d901ce415a8b..ba810d60d87b 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/CronJob/CleanExpiredOrdersTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/CronJob/CleanExpiredOrdersTest.php @@ -41,7 +41,7 @@ class CleanExpiredOrdersTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->storesConfigMock = $this->getMock( '\Magento\Store\Model\StoresConfig', diff --git a/app/code/Magento/Sales/Test/Unit/Model/GridAsyncInsertTest.php b/app/code/Magento/Sales/Test/Unit/Model/GridAsyncInsertTest.php index aec685697d59..ed0e89d08770 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/GridAsyncInsertTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/GridAsyncInsertTest.php @@ -31,7 +31,7 @@ class GridAsyncInsertTest extends \PHPUnit_Framework_TestCase */ protected $scopeConfigurationMock; - public function setUp() + protected function setUp() { $this->gridAggregatorMock = $this->getMockBuilder('Magento\Sales\Model\ResourceModel\GridInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Sales/Test/Unit/Model/IncrementTest.php b/app/code/Magento/Sales/Test/Unit/Model/IncrementTest.php index a89b33edf669..5288fabd72a9 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/IncrementTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/IncrementTest.php @@ -25,7 +25,7 @@ class IncrementTest extends \PHPUnit_Framework_TestCase */ protected $type; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->eavConfig = $this->getMock('Magento\Eav\Model\Config', ['getEntityType'], [], '', false); diff --git a/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php index d6b9995ce5e7..ffd49ca5b1e2 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php @@ -26,7 +26,7 @@ class InvoiceRepositoryTest extends \PHPUnit_Framework_TestCase */ protected $searchResultFactory; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->invoiceMetadata = $this->getMock('Magento\Sales\Model\ResourceModel\Metadata', [], [], '', false); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Address/ValidatorTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Address/ValidatorTest.php index ceece7cdfc1a..7125074160e0 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Address/ValidatorTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Address/ValidatorTest.php @@ -33,7 +33,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase /** * Mock order address model */ - public function setUp() + protected function setUp() { $this->addressMock = $this->getMock( 'Magento\Sales\Model\Order\Address', diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Admin/ItemTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Admin/ItemTest.php index 6e680137138a..d71b18e136de 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Admin/ItemTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Admin/ItemTest.php @@ -18,8 +18,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Sales\Model\Order\Admin\Item */ protected $item; - - public function setUp() + protected function setUp() { $this->orderItemMock = $this->getMockBuilder('Magento\Sales\Model\Order\Item') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php index 71191358cc35..934096c1c77b 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php @@ -22,7 +22,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected $orderStatusCollectionFactoryMock; - public function setUp() + protected function setUp() { $orderStatusFactory = $this->getMock('Magento\Sales\Model\Order\StatusFactory', [], [], '', false, false); $this->orderStatusCollectionFactoryMock = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/ItemTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/ItemTest.php index f3ededcf5765..bcf68ea6734c 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/ItemTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/ItemTest.php @@ -17,7 +17,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Sales\Model\Order\Creditmemo\Item */ protected $item; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->orderItemFactoryMock = $this->getMockBuilder('Magento\Sales\Model\Order\ItemFactory') diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/CostTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/CostTest.php index 6538131881ed..9fd77b427063 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/CostTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/CostTest.php @@ -15,16 +15,18 @@ class CostTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\Order\Creditmemo\Total\Cost */ protected $total; + /** * @var \Magento\Sales\Model\Order\Creditmemo|\PHPUnit_Framework_MockObject_MockObject */ protected $creditmemoMock; + /** * @var \Magento\Sales\Model\Order\Creditmemo\Item|\PHPUnit_Framework_MockObject_MockObject */ protected $creditmemoItemMock; - public function setUp() + protected function setUp() { $this->creditmemoMock = $this->getMock('\Magento\Sales\Model\Order\Creditmemo', [ 'setBaseCost', 'getAllItems' diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/DiscountTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/DiscountTest.php index 4f9a61359bc9..6b03924b2f80 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/DiscountTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/DiscountTest.php @@ -15,24 +15,28 @@ class DiscountTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\Order\Creditmemo\Total\Cost */ protected $total; + /** * @var \Magento\Sales\Model\Order\Creditmemo|\PHPUnit_Framework_MockObject_MockObject */ protected $creditmemoMock; + /** * @var \Magento\Sales\Model\Order\Creditmemo\Item|\PHPUnit_Framework_MockObject_MockObject */ protected $creditmemoItemMock; + /** * @var \Magento\Sales\Model\Order|\PHPUnit_Framework_MockObject_MockObject */ protected $orderMock; + /** * @var \Magento\Sales\Model\Order\Item|\PHPUnit_Framework_MockObject_MockObject */ protected $orderItemMock; - public function setUp() + protected function setUp() { $this->orderMock = $this->getMock( 'Magento\Sales\Model\Order', diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/ShippingTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/ShippingTest.php index 2e7ae579de2b..935b1c0f6ccf 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/ShippingTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/ShippingTest.php @@ -25,7 +25,7 @@ class ShippingTest extends \PHPUnit_Framework_TestCase */ protected $shippingCollector; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php index f4547bc1d574..93ee01a36f4f 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/SubtotalTest.php @@ -15,20 +15,23 @@ class SubtotalTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\Order\Creditmemo\Total\Subtotal */ protected $total; + /** * @var \Magento\Sales\Model\Order\Creditmemo|\PHPUnit_Framework_MockObject_MockObject */ protected $creditmemoMock; + /** * @var \Magento\Sales\Model\Order\Creditmemo\Item|\PHPUnit_Framework_MockObject_MockObject */ protected $creditmemoItemMock; + /** * @var \Magento\Sales\Model\Order\Item|\PHPUnit_Framework_MockObject_MockObject */ protected $orderItemMock; - public function setUp() + protected function setUp() { $this->orderMock = $this->getMock( 'Magento\Sales\Model\Order', diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php index 7ac5947cb976..521008074443 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php @@ -37,7 +37,7 @@ class TaxTest extends \PHPUnit_Framework_TestCase */ protected $invoice; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); /** @var \Magento\Sales\Model\Order\Creditmemo\Total\Tax $model */ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoNotifierTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoNotifierTest.php index c4c50203cac3..2388c0581b3c 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoNotifierTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoNotifierTest.php @@ -41,7 +41,7 @@ class CreditmemoNotifierTest extends \PHPUnit_Framework_TestCase */ protected $creditmemoSenderMock; - public function setUp() + protected function setUp() { $this->historyCollectionFactory = $this->getMock( 'Magento\Sales\Model\ResourceModel\Order\Status\History\CollectionFactory', diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php index 72fb3e43b01a..a46465e13a0b 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php @@ -28,7 +28,7 @@ class CreditmemoRepositoryTest extends \PHPUnit_Framework_TestCase */ protected $searchResultFactoryMock; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->metadataMock = $this->getMock('Magento\Sales\Model\ResourceModel\Metadata', [], [], '', false); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoTest.php index c5fe6012a8b5..0c24c856ba2d 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoTest.php @@ -33,7 +33,7 @@ class CreditmemoTest extends \PHPUnit_Framework_TestCase */ protected $cmItemCollectionFactoryMock; - public function setUp() + protected function setUp() { $this->orderFactory = $this->getMock( '\Magento\Sales\Model\OrderFactory', diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Grid/Massaction/ItemsUpdaterTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Grid/Massaction/ItemsUpdaterTest.php index da15b74d82e6..6f830397952d 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Grid/Massaction/ItemsUpdaterTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Grid/Massaction/ItemsUpdaterTest.php @@ -18,7 +18,7 @@ class ItemsUpdaterTest extends \PHPUnit_Framework_TestCase */ protected $authorizationMock; - public function setUp() + protected function setUp() { $this->authorizationMock = $this->getMock('Magento\Framework\Authorization', [], [], '', false); $this->itemUpdater = new \Magento\Sales\Model\Order\Grid\Massaction\ItemsUpdater( diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Grid/Row/UrlGeneratorTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Grid/Row/UrlGeneratorTest.php index 0ca87753acdd..64ac33e0bb5c 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Grid/Row/UrlGeneratorTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Grid/Row/UrlGeneratorTest.php @@ -12,16 +12,18 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\Order\Grid\Row\UrlGenerator */ protected $urlGenerator; + /** * @var \Magento\Backend\Model\UrlInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $urlMock; + /** * @var \Magento\Framework\AuthorizationInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $authorizationMock; - public function setUp() + protected function setUp() { $this->urlMock = $this->getMockForAbstractClass( 'Magento\Backend\Model\UrlInterface', diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Grid/Row/UrlGeneratorTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Grid/Row/UrlGeneratorTest.php index cdb0d6f32933..19e6356f90af 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Grid/Row/UrlGeneratorTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Grid/Row/UrlGeneratorTest.php @@ -12,16 +12,18 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\Order\Grid\Row\UrlGenerator */ protected $urlGenerator; + /** * @var \Magento\Backend\Model\UrlInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $urlMock; + /** * @var \Magento\Framework\AuthorizationInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $authorizationMock; - public function setUp() + protected function setUp() { $this->urlMock = $this->getMockForAbstractClass( 'Magento\Backend\Model\UrlInterface', diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/ItemTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/ItemTest.php index 35e4754fa4e8..09dd455564a9 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/ItemTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/ItemTest.php @@ -12,28 +12,33 @@ class ItemTest extends \PHPUnit_Framework_TestCase * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ protected $objectManager; + /** * @var \Magento\Sales\Model\Order\Invoice\Item|\PHPUnit_Framework_MockObject_MockObject */ protected $item; + /** * @var \Magento\Sales\Model\Order\ItemFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $orderItemFactoryMock; + /** * @var \Magento\Sales\Model\Order\Invoice|\PHPUnit_Framework_MockObject_MockObject */ protected $invoiceMock; + /** * @var \Magento\Sales\Model\Order|\PHPUnit_Framework_MockObject_MockObject */ protected $orderMock; + /** * @var \Magento\Sales\Model\Order\Item|\PHPUnit_Framework_MockObject_MockObject */ protected $orderItemMock; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->orderItemFactoryMock = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/TaxTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/TaxTest.php index c5558138db59..691ff8bfc64e 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/TaxTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Total/TaxTest.php @@ -28,7 +28,7 @@ class TaxTest extends \PHPUnit_Framework_TestCase */ protected $invoice; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); /** @var \Magento\Sales\Model\Order\Invoice\Total\Tax $model */ diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceNotifierTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceNotifierTest.php index 1c8482936885..13d45fbcaf9c 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceNotifierTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceNotifierTest.php @@ -41,7 +41,7 @@ class InvoiceNotifierTest extends \PHPUnit_Framework_TestCase */ protected $invoiceSenderMock; - public function setUp() + protected function setUp() { $this->historyCollectionFactory = $this->getMock( 'Magento\Sales\Model\ResourceModel\Order\Status\History\CollectionFactory', diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/ConverterTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/ConverterTest.php index 69add53a4299..3adbb42d0f29 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/ConverterTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/ConverterTest.php @@ -12,7 +12,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new \Magento\Sales\Model\Order\Pdf\Config\Converter(); } diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/XsdTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/XsdTest.php index 5757f3508db8..95a9f15ab6f3 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/XsdTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Config/XsdTest.php @@ -26,7 +26,7 @@ public static function setUpBeforeClass() self::$_schemaFilePath = $urnResolver->getRealPath('urn:magento:module:Magento_Sales:etc/pdf_file.xsd'); } - public function setUp() + protected function setUp() { if (!function_exists('libxml_set_external_entity_loader')) { $this->markTestSkipped('Skipped on HHVM. Will be fixed in MAGETWO-45033'); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Total/FactoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Total/FactoryTest.php index caa0e4146c1e..7dfbefb2d92c 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Total/FactoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/Total/FactoryTest.php @@ -17,7 +17,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase */ protected $_factory; - public function setUp() + protected function setUp() { $this->_objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->_factory = new \Magento\Sales\Model\Order\Pdf\Total\Factory($this->_objectManager); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/StatusTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/StatusTest.php index 8172fbfa5f80..6e427344b134 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/StatusTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/StatusTest.php @@ -35,7 +35,7 @@ class StatusTest extends \PHPUnit_Framework_TestCase /** * SetUp test */ - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->resourceMock = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Model/OrderNotifierTest.php b/app/code/Magento/Sales/Test/Unit/Model/OrderNotifierTest.php index f98cb2ba9441..b9e1aba80ce3 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/OrderNotifierTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/OrderNotifierTest.php @@ -41,7 +41,7 @@ class OrderNotifierTest extends \PHPUnit_Framework_TestCase */ protected $orderSenderMock; - public function setUp() + protected function setUp() { $this->historyCollectionFactory = $this->getMock( 'Magento\Sales\Model\ResourceModel\Order\Status\History\CollectionFactory', diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/AttributeTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/AttributeTest.php index 48006a2cbe7c..bccaa5570183 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/AttributeTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/AttributeTest.php @@ -14,24 +14,28 @@ class AttributeTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\ResourceModel\Attribute|\PHPUnit_Framework_MockObject_MockObject */ protected $attribute; + /** * @var \Magento\Framework\App\ResourceConnection|\PHPUnit_Framework_MockObject_MockObject */ protected $appResourceMock; + /** * @var \Magento\Framework\Event\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $eventManagerMock; + /** * @var \Magento\Sales\Model\AbstractModel|\PHPUnit_Framework_MockObject_MockObject */ protected $modelMock; + /** * @var \Magento\Framework\DB\Adapter\AdapterInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $connectionMock; - public function setUp() + protected function setUp() { $this->appResourceMock = $this->getMock( 'Magento\Framework\App\ResourceConnection', diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridPoolTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridPoolTest.php index e9a7f5dba6f2..b88ea9fd931c 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridPoolTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/GridPoolTest.php @@ -41,7 +41,7 @@ class GridPoolTest extends \PHPUnit_Framework_TestCase /** * Prepare mock objects */ - public function setUp() + protected function setUp() { $this->orderGridMock = $this->getMock( 'Magento\Sales\Model\ResourceModel\Grid', [], [], '', false diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/AddressTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/AddressTest.php index bf5d6ccd5ed0..5840f6f4a968 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/AddressTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/AddressTest.php @@ -45,7 +45,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase */ protected $entitySnapshotMock; - public function setUp() + protected function setUp() { $this->addressMock = $this->getMock( 'Magento\Sales\Model\Order\Address', diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Creditmemo/RelationTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Creditmemo/RelationTest.php index 79c512ed55fb..f833fb765545 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Creditmemo/RelationTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Creditmemo/RelationTest.php @@ -41,7 +41,7 @@ class RelationTest extends \PHPUnit_Framework_TestCase */ protected $commentResourceMock; - public function setUp() + protected function setUp() { $this->itemResourceMock = $this->getMockBuilder('Magento\Sales\Model\ResourceModel\Order\Creditmemo\Item') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Handler/AddressTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Handler/AddressTest.php index 22039baa3113..f7a23722c444 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Handler/AddressTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Handler/AddressTest.php @@ -14,24 +14,28 @@ class AddressTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\ResourceModel\Order\Handler\Address */ protected $address; + /** * @var \Magento\Sales\Model\ResourceModel\Order\Address\Collection|\PHPUnit_Framework_MockObject_MockObject */ protected $addressCollectionMock; + /** * @var \Magento\Sales\Model\ResourceModel\Attribute|\PHPUnit_Framework_MockObject_MockObject */ protected $attributeMock; + /** * @var \Magento\Sales\Model\Order|\PHPUnit_Framework_MockObject_MockObject */ protected $orderMock; + /** * @var \Magento\Sales\Model\Order\Address|\PHPUnit_Framework_MockObject_MockObject */ protected $addressMock; - public function setUp() + protected function setUp() { $this->attributeMock = $this->getMock( 'Magento\Sales\Model\ResourceModel\Attribute', diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Handler/StateTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Handler/StateTest.php index b7dbf317d5a8..cce9ba279d00 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Handler/StateTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Handler/StateTest.php @@ -16,12 +16,13 @@ class StateTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\ResourceModel\Order\Handler\State */ protected $state; + /** * @var \Magento\Sales\Model\Order|\PHPUnit_Framework_MockObject_MockObject */ protected $orderMock; - public function setUp() + protected function setUp() { $this->orderMock = $this->getMock( 'Magento\Sales\Model\Order', diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Invoice/RelationTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Invoice/RelationTest.php index e9f92104ae0f..32e2c48494c3 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Invoice/RelationTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Invoice/RelationTest.php @@ -46,7 +46,7 @@ class RelationTest extends \PHPUnit_Framework_TestCase */ protected $orderItemMock; - public function setUp() + protected function setUp() { $this->invoiceItemResourceMock = $this->getMockBuilder('Magento\Sales\Model\ResourceModel\Order\Invoice\Item') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/RelationTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/RelationTest.php index 915803332304..7ece741c488f 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/RelationTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/RelationTest.php @@ -15,6 +15,7 @@ class RelationTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\ResourceModel\Order\Relation */ protected $relationProcessor; + /** * @var \Magento\Sales\Model\ResourceModel\Order\Handler\Address|\PHPUnit_Framework_MockObject_MockObject */ @@ -60,7 +61,7 @@ class RelationTest extends \PHPUnit_Framework_TestCase */ protected $orderInvoiceMock; - public function setUp() + protected function setUp() { $this->addressHandlerMock = $this->getMockBuilder('Magento\Sales\Model\ResourceModel\Order\Handler\Address') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Shipment/RelationTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Shipment/RelationTest.php index 3bbf0268056f..3b618f405722 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Shipment/RelationTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Shipment/RelationTest.php @@ -51,7 +51,7 @@ class RelationTest extends \PHPUnit_Framework_TestCase */ protected $itemMock; - public function setUp() + protected function setUp() { $this->itemResourceMock = $this->getMockBuilder('Magento\Sales\Model\ResourceModel\Order\Shipment\Item') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Status/History/CollectionTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Status/History/CollectionTest.php index 8ac34306912d..9b47ca23f29c 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Status/History/CollectionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Status/History/CollectionTest.php @@ -47,12 +47,13 @@ class CollectionTest extends \PHPUnit_Framework_TestCase * @var \Magento\Framework\Data\Collection\EntityFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $entityFactoryMock; + /** * @var \Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot|\PHPUnit_Framework_MockObject_MockObject */ protected $entitySnapshotMock; - public function setUp() + protected function setUp() { $this->eventManagerMock = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); $this->connectionMock = $this->getMock('Magento\Framework\DB\Adapter\Pdo\Mysql', [], [], '', false); diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Status/HistoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Status/HistoryTest.php index dab875df3611..0b7ee7118d72 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Status/HistoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/Status/HistoryTest.php @@ -41,7 +41,7 @@ class HistoryTest extends \PHPUnit_Framework_TestCase */ protected $entitySnapshotMock; - public function setUp() + protected function setUp() { $this->appResourceMock = $this->getMock( 'Magento\Framework\App\ResourceConnection', diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/StatusTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/StatusTest.php index eaadd67311df..e073d7064f71 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/StatusTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/StatusTest.php @@ -40,7 +40,7 @@ class StatusTest extends \PHPUnit_Framework_TestCase */ protected $selectMock; - public function setUp() + protected function setUp() { $this->selectMock = $this->getMock('\Magento\Framework\DB\Select', [], [], '', false); $this->selectMock->expects($this->any())->method('from')->will($this->returnSelf()); diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/OrderTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/OrderTest.php index df1a98bdf332..bd8b02be0d6c 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/OrderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/OrderTest.php @@ -22,42 +22,52 @@ class OrderTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\ResourceModel\Order */ protected $resource; + /** * @var \Magento\Framework\App\ResourceConnection|\PHPUnit_Framework_MockObject_MockObject */ protected $resourceMock; + /** * @var \Magento\SalesSequence\Model\Manager|\PHPUnit_Framework_MockObject_MockObject */ protected $salesSequenceManagerMock; + /** * @var \Magento\SalesSequence\Model\Sequence|\PHPUnit_Framework_MockObject_MockObject */ protected $salesSequenceMock; + /** * @var \Magento\Sales\Model\Order|\PHPUnit_Framework_MockObject_MockObject */ protected $orderMock; + /** * @var \Magento\Sales\Model\Order\Item|\PHPUnit_Framework_MockObject_MockObject */ protected $orderItemMock; + /** * @var \Magento\Store\Model\Store|\PHPUnit_Framework_MockObject_MockObject */ protected $storeMock; + /** * @var \Magento\Store\Model\Website|\PHPUnit_Framework_MockObject_MockObject */ protected $websiteMock; + /** * @var \Magento\Store\Model\Group|\PHPUnit_Framework_MockObject_MockObject */ protected $storeGroupMock; + /** * @var \Magento\Framework\DB\Adapter\AdapterInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $connectionMock; + /** * @var \Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot|\PHPUnit_Framework_MockObject_MockObject */ @@ -72,10 +82,11 @@ class OrderTest extends \PHPUnit_Framework_TestCase * @var \Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor|\PHPUnit_Framework_MockObject_MockObject */ protected $objectRelationProcessorMock; + /** * Mock class dependencies */ - public function setUp() + protected function setUp() { $this->resourceMock = $this->getMock('Magento\Framework\App\ResourceConnection', [], [], '', false); $this->orderMock = $this->getMock('Magento\Sales\Model\Order', [], [], '', false); diff --git a/app/code/Magento/Sales/Test/Unit/Observer/GridProcessAddressChangeTest.php b/app/code/Magento/Sales/Test/Unit/Observer/GridProcessAddressChangeTest.php index 71f2a4d3f07d..8801b7ab112b 100644 --- a/app/code/Magento/Sales/Test/Unit/Observer/GridProcessAddressChangeTest.php +++ b/app/code/Magento/Sales/Test/Unit/Observer/GridProcessAddressChangeTest.php @@ -26,7 +26,7 @@ class GridProcessAddressChangeTest extends \PHPUnit_Framework_TestCase */ protected $eventObserverMock; - public function setUp() + protected function setUp() { $this->gridPoolMock = $this->getMockBuilder('Magento\Sales\Model\ResourceModel\GridPool') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Observer/GridSyncInsertObserverTest.php b/app/code/Magento/Sales/Test/Unit/Observer/GridSyncInsertObserverTest.php index 2f142ba07cd3..4d208f59cfda 100644 --- a/app/code/Magento/Sales/Test/Unit/Observer/GridSyncInsertObserverTest.php +++ b/app/code/Magento/Sales/Test/Unit/Observer/GridSyncInsertObserverTest.php @@ -36,7 +36,7 @@ class GridSyncInsertObserverTest extends \PHPUnit_Framework_TestCase */ protected $scopeConfigurationMock; - public function setUp() + protected function setUp() { $this->gridAggregatorMock = $this->getMockBuilder('Magento\Sales\Model\ResourceModel\GridInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Sales/Test/Unit/Observer/GridSyncRemoveObserverTest.php b/app/code/Magento/Sales/Test/Unit/Observer/GridSyncRemoveObserverTest.php index 6c8862caad55..80f985b9cdb0 100644 --- a/app/code/Magento/Sales/Test/Unit/Observer/GridSyncRemoveObserverTest.php +++ b/app/code/Magento/Sales/Test/Unit/Observer/GridSyncRemoveObserverTest.php @@ -31,7 +31,7 @@ class GridSyncRemoveObserverTest extends \PHPUnit_Framework_TestCase */ protected $salesModelMock; - public function setUp() + protected function setUp() { $this->gridAggregatorMock = $this->getMockBuilder('Magento\Sales\Model\ResourceModel\GridInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/AddressTest.php b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/AddressTest.php index dea8a2ca3b15..8a9cebcf5320 100644 --- a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/AddressTest.php +++ b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/AddressTest.php @@ -24,7 +24,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase */ protected $escaper; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $contextMock = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\ContextInterface') diff --git a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/CustomerGroupTest.php b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/CustomerGroupTest.php index 68c174d4f222..c22cd3250771 100644 --- a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/CustomerGroupTest.php +++ b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/CustomerGroupTest.php @@ -24,7 +24,7 @@ class CustomerGroupTest extends \PHPUnit_Framework_TestCase */ protected $groupRepository; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $contextMock = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\ContextInterface') diff --git a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PaymentMethodTest.php b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PaymentMethodTest.php index 616a2f10b9f4..64628a5dd917 100644 --- a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PaymentMethodTest.php +++ b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PaymentMethodTest.php @@ -24,7 +24,7 @@ class PaymentMethodTest extends \PHPUnit_Framework_TestCase */ protected $paymentHelper; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $contextMock = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\ContextInterface') diff --git a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PriceTest.php b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PriceTest.php index b0e563c8f65e..32d370668938 100644 --- a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PriceTest.php +++ b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PriceTest.php @@ -24,7 +24,7 @@ class PriceTest extends \PHPUnit_Framework_TestCase */ protected $priceFormatterMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $contextMock = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\ContextInterface') diff --git a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PurchasedPriceTest.php b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PurchasedPriceTest.php index e4e1fa51efbe..bfcda4160c56 100644 --- a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PurchasedPriceTest.php +++ b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/PurchasedPriceTest.php @@ -24,7 +24,7 @@ class PurchasedPriceTest extends \PHPUnit_Framework_TestCase */ protected $priceFormatterMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $contextMock = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\ContextInterface') diff --git a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/Status/OptionsTest.php b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/Status/OptionsTest.php index c315beff7240..a5c1951a4890 100644 --- a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/Status/OptionsTest.php +++ b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/Status/OptionsTest.php @@ -24,7 +24,7 @@ class OptionsTest extends \PHPUnit_Framework_TestCase */ protected $collectionFactoryMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->collectionFactoryMock = $this->getMock( diff --git a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/ViewActionTest.php b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/ViewActionTest.php index df59331ca356..bcbd82383486 100644 --- a/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/ViewActionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/ViewActionTest.php @@ -29,7 +29,7 @@ class ViewActionTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); $this->urlBuilder = $this->getMockForAbstractClass('Magento\Framework\UrlInterface'); diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php index 58713f20ac20..d374c759b497 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php @@ -10,29 +10,8 @@ * * @author Magento Core Team */ -class Coupons extends \Magento\Backend\Block\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface +class Coupons extends \Magento\Framework\View\Element\Template implements \Magento\Backend\Block\Widget\Tab\TabInterface { - /** - * Core registry - * - * @var \Magento\Framework\Registry - */ - protected $_coreRegistry = null; - - /** - * @param \Magento\Framework\View\Element\Context $context - * @param \Magento\Framework\Registry $registry - * @param array $data - */ - public function __construct( - \Magento\Framework\View\Element\Context $context, - \Magento\Framework\Registry $registry, - array $data = [] - ) { - $this->_coreRegistry = $registry; - parent::__construct($context, $data); - } - /** * {@inheritdoc} */ @@ -73,33 +52,4 @@ public function setCanSHow($canShow) { $this->_data['config']['canShow'] = $canShow; } - - /** - * @return string - */ - public function toHtml() - { - $model = $this->_coreRegistry->registry(\Magento\SalesRule\Model\RegistryConstants::CURRENT_SALES_RULE); - $disableInputFields = ! $model->getUseAutoGeneration(); - // @todo: remove this workaround after resolving MAGETWO-48846 - // @codingStandardsIgnoreStart - $html = << -function disableEnableCouponTabInputFields(isDisabled) { - var selector = '[id=coupons_information_fieldset] input, [id=coupons_information_fieldset] select, [id=coupons_information_fieldset] button, [id=couponCodesGrid] input, [id=couponCodesGrid] select, [id=couponCodesGrid] button'; - - _.each( - document.querySelectorAll(selector), - function (element) { - element.disabled = isDisabled; - } - ); -} -disableEnableCouponTabInputFields({$disableInputFields}); - -HTML_ENTITIES; - // @codingStandardsIgnoreEnd - - return parent::toHtml() . $html; - } } diff --git a/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php b/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php index 0ca28edc180b..541135360fb4 100644 --- a/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php +++ b/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php @@ -373,16 +373,8 @@ public function save(\Magento\Framework\Model\AbstractModel $object) if ($object->isDeleted()) { return $this->delete($object); } - $this->beginTransaction(); - try { - if (!$this->isModified($object)) { - $this->processNotModifiedSave($object); - $this->commit(); - $object->setHasDataChanges(false); - return $this; - } $object->validateBeforeSave(); $object->beforeSave(); if ($object->isSaveAllowed()) { diff --git a/app/code/Magento/SalesRule/Test/Unit/Helper/CouponTest.php b/app/code/Magento/SalesRule/Test/Unit/Helper/CouponTest.php index b3477327e160..230005c5a37a 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Helper/CouponTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Helper/CouponTest.php @@ -33,7 +33,7 @@ class CouponTest extends \PHPUnit_Framework_TestCase */ protected $separator = '|'; - public function setUp() + protected function setUp() { $this->couponParameters = [ 'separator' => $this->separator, diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/QuoteConfigProductAttributesTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/QuoteConfigProductAttributesTest.php index ed35dec2fec1..e45e91697929 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/QuoteConfigProductAttributesTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/QuoteConfigProductAttributesTest.php @@ -18,7 +18,7 @@ class QuoteConfigProductAttributesTest extends \PHPUnit_Framework_TestCase */ protected $ruleResource; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->ruleResource = $this->getMock('Magento\SalesRule\Model\ResourceModel\Rule', [], [], '', false); diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/ResourceModel/RuleTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/ResourceModel/RuleTest.php index 10f9649ceb3e..d7a8972f37fd 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/ResourceModel/RuleTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/ResourceModel/RuleTest.php @@ -28,7 +28,7 @@ class RuleTest extends \PHPUnit_Framework_TestCase */ protected $abstractModel; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->ruleResource = $this->getMockBuilder('Magento\SalesRule\Model\ResourceModel\Rule') diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/RuleTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/RuleTest.php index 62020612cc6e..5c22a304f354 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/RuleTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/RuleTest.php @@ -23,7 +23,7 @@ class RuleTest extends \PHPUnit_Framework_TestCase */ protected $genericClosure; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->subject = $this->getMockBuilder('Magento\SalesRule\Model\Rule') diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php index 5142b474e37d..aa0f98180ee8 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Quote/DiscountTest.php @@ -47,7 +47,7 @@ class DiscountTest extends \PHPUnit_Framework_TestCase */ protected $addressMock; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManager', [], [], '', false); diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/RuleTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/RuleTest.php index 45edb8ea5679..ba22659208b5 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/RuleTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/RuleTest.php @@ -50,7 +50,7 @@ class RuleTest extends \PHPUnit_Framework_TestCase */ protected $relationProcessorMock; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->ruleResource = $this->getMockBuilder('Magento\SalesRule\Model\ResourceModel\Rule') diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php index 2c17f56861f0..d63c1ab6e7c0 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/RuleTest.php @@ -28,7 +28,7 @@ class RuleTest extends \PHPUnit_Framework_TestCase */ protected $condProdCombineFactoryMock; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php index 134940a0dd0b..9f42d78e8f0d 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/RulesApplierTest.php @@ -28,7 +28,7 @@ class RulesApplierTest extends \PHPUnit_Framework_TestCase */ protected $validatorUtility; - public function setUp() + protected function setUp() { $this->calculatorFactory = $this->getMock( 'Magento\SalesRule\Model\Rule\Action\Discount\CalculatorFactory', diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/System/Config/Source/Coupon/FormatTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/System/Config/Source/Coupon/FormatTest.php index a0835087e60f..592b8b2b4f79 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/System/Config/Source/Coupon/FormatTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/System/Config/Source/Coupon/FormatTest.php @@ -18,7 +18,7 @@ class FormatTest extends \PHPUnit_Framework_TestCase */ protected $salesRuleCoupon; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php index 7442f0af25e1..14f3246fb60b 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/UtilityTest.php @@ -72,7 +72,7 @@ class UtilityTest extends \PHPUnit_Framework_TestCase */ protected $priceCurrency; - public function setUp() + protected function setUp() { $this->usageFactory = $this->getMock( 'Magento\SalesRule\Model\ResourceModel\Coupon\UsageFactory', diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Validator/PoolTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Validator/PoolTest.php index 7cc68eac63b8..779120c63ed5 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Validator/PoolTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Validator/PoolTest.php @@ -20,7 +20,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase */ protected $validators = []; - public function setUp() + protected function setUp() { $this->validators = ['discount' => ['validator1', 'validator2']]; $this->pool = new \Magento\SalesRule\Model\Validator\Pool($this->validators); diff --git a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml index 071a080c95ec..cb284b708c70 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_edit.xml @@ -9,7 +9,7 @@ - + Manage Coupon Codes @@ -18,6 +18,7 @@ 50 false fieldset + Magento_SalesRule/js/form/element/manage-coupon-codes diff --git a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml index 34d23eac0f80..fbbf9657f42a 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/layout/sales_rule_promo_quote_index.xml @@ -50,6 +50,7 @@ Start date + false from_date col-date col-date @@ -59,6 +60,7 @@ End date + false -- to_date col-date diff --git a/app/code/Magento/SalesRule/view/adminhtml/templates/tab/coupons.phtml b/app/code/Magento/SalesRule/view/adminhtml/templates/tab/coupons.phtml new file mode 100644 index 000000000000..7b9f20e9569b --- /dev/null +++ b/app/code/Magento/SalesRule/view/adminhtml/templates/tab/coupons.phtml @@ -0,0 +1,10 @@ + +
+ getChildHtml('promo_quote_edit_tab_coupons_form') ?> + getChildHtml('promo_quote_edit_tab_coupons_grid') ?> +
diff --git a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml index cf7098d341b6..92b8391b9e1a 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml @@ -211,7 +211,7 @@ - Magento_SalesRule/js/form/element/coupon-tab-updater-select + Magento_SalesRule/js/form/element/coupon-type 2 @@ -239,7 +239,11 @@ true boolean checkbox - ui/form/element/checkbox + + 1 + 0 + + 0 sales_rule use_auto_generation @@ -268,7 +272,6 @@ - Magento_SalesRule/js/form/element/coupon-tab-updater-checkbox diff --git a/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-tab-updater-checkbox.js b/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-tab-updater-checkbox.js deleted file mode 100644 index 1daec55a607a..000000000000 --- a/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-tab-updater-checkbox.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright © 2016 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -define([ - 'underscore', - 'mageUtils', - 'uiRegistry', - 'Magento_Ui/js/form/element/boolean' -], function (_, utils, uiRegistry, Boolean) { - 'use strict'; - - return Boolean.extend({ - defaults: {}, - - /** - * Hide fields on coupon tab - */ - onUpdate: function () { - // @todo: refactor after resolving MAGETWO-48846 - var isDisabled = !this.value(), - selector = '[id=coupons_information_fieldset] input, [id=coupons_information_fieldset] select, ' + - '[id=coupons_information_fieldset] button, [id=couponCodesGrid] input, ' + - '[id=couponCodesGrid] select, [id=couponCodesGrid] button'; - - this._super(); - _.each( - document.querySelectorAll(selector), - function (element) { - element.disabled = isDisabled; - } - ); - } - }); -}); diff --git a/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-tab-updater-select.js b/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-tab-updater-select.js deleted file mode 100644 index edc22749d248..000000000000 --- a/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-tab-updater-select.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright © 2016 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -define([ - 'underscore', - 'mageUtils', - 'uiRegistry', - 'Magento_Ui/js/form/element/select' -], function (_, utils, uiRegistry, Select) { - 'use strict'; - - return Select.extend({ - defaults: {}, - - /** - * Hide fields on coupon tab - */ - onUpdate: function () { - // @todo: refactor after resolving MAGETWO-48846 - - /* eslint-disable eqeqeq */ - var isDisabled = this.value() != this.displayOnlyForCouponType || - !uiRegistry.get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation').value(), - selector = '[id=coupons_information_fieldset] input, [id=coupons_information_fieldset] select, ' + - '[id=coupons_information_fieldset] button, [id=couponCodesGrid] input, ' + - '[id=couponCodesGrid] select, [id=couponCodesGrid] button'; - - /* eslint-enable eqeqeq */ - this._super(); - _.each( - document.querySelectorAll(selector), - function (element) { - element.disabled = isDisabled; - } - ); - } - }); -}); diff --git a/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-type.js b/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-type.js new file mode 100644 index 000000000000..9bbed99ba23b --- /dev/null +++ b/app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-type.js @@ -0,0 +1,25 @@ +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'uiRegistry', + 'Magento_Ui/js/form/element/select' +], function (uiRegistry, select) { + 'use strict'; + + return select.extend({ + + /** + * Hide fields on coupon tab + */ + onUpdate: function () { + + /* eslint-disable eqeqeq */ + if (this.value() != this.displayOnlyForCouponType) { + uiRegistry.get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation').checked(false); + } + } + }); +}); diff --git a/app/code/Magento/SalesRule/view/base/web/js/form/element/manage-coupon-codes.js b/app/code/Magento/SalesRule/view/base/web/js/form/element/manage-coupon-codes.js new file mode 100644 index 000000000000..b403ca0c3e81 --- /dev/null +++ b/app/code/Magento/SalesRule/view/base/web/js/form/element/manage-coupon-codes.js @@ -0,0 +1,61 @@ +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'underscore', + 'uiRegistry', + 'Magento_Ui/js/form/components/fieldset', + 'Magento_Ui/js/lib/view/utils/async' +], function (_, uiRegistry, fieldset, async) { + 'use strict'; + + return fieldset.extend({ + + /*eslint-disable no-unused-vars*/ + /** + * Initialize element + * + * @returns {Abstract} Chainable + */ + initialize: function (elems, position) { + var obj = this; + + this._super(); + + async.async('#sales-rule-form-tab-coupons', document.getElementById('container'), function (node) { + var useAutoGeneration = uiRegistry.get( + 'sales_rule_form.sales_rule_form.rule_information.use_auto_generation' + ); + + useAutoGeneration.on('checked', function () { + obj.enableDisableFields(); + }); + obj.enableDisableFields(); + }); + + return this; + }, + + /*eslint-enable no-unused-vars*/ + + /** + * Enable/disable fields on Coupons tab + */ + enableDisableFields: function () { + var selector = '[id=sales-rule-form-tab-coupons] input, [id=sales-rule-form-tab-coupons] select, ' + + '[id=sales-rule-form-tab-coupons] button', + isUseAutoGenerationChecked = !uiRegistry + .get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation') + .checked(); + + _.each( + document.querySelectorAll(selector), + function (element) { + element.disabled = isUseAutoGenerationChecked; + } + ); + } + }); +}); diff --git a/app/code/Magento/Search/Test/Unit/Helper/DataTest.php b/app/code/Magento/Search/Test/Unit/Helper/DataTest.php index bd92f8fb2eb4..b0b18fa84ce1 100644 --- a/app/code/Magento/Search/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Search/Test/Unit/Helper/DataTest.php @@ -43,7 +43,7 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected $storeManagerMock; - public function setUp() + protected function setUp() { $this->stringMock = $this->getMock('Magento\Framework\Stdlib\StringUtils'); $this->scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); diff --git a/app/code/Magento/SendFriend/Test/Unit/Block/SendTest.php b/app/code/Magento/SendFriend/Test/Unit/Block/SendTest.php index 58f4cd849c8e..c253a0ef0f69 100644 --- a/app/code/Magento/SendFriend/Test/Unit/Block/SendTest.php +++ b/app/code/Magento/SendFriend/Test/Unit/Block/SendTest.php @@ -30,7 +30,7 @@ class SendTest extends \PHPUnit_Framework_TestCase */ protected $requestMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php b/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php index 60cbaeac3e18..eab8b389e447 100644 --- a/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php +++ b/app/code/Magento/SendFriend/Test/Unit/Model/SendFriendTest.php @@ -29,7 +29,7 @@ class SendFriendTest extends \PHPUnit_Framework_TestCase */ protected $sendfriendDataMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->sendfriendDataMock = $this->getMockBuilder('Magento\SendFriend\Helper\Data') diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/AddTrackTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/AddTrackTest.php index f4e7f6ba0c6f..9494a44b2b38 100644 --- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/AddTrackTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/AddTrackTest.php @@ -67,7 +67,7 @@ class AddTrackTest extends \PHPUnit_Framework_TestCase */ protected $pageTitleMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->shipmentLoader = $this->getMockBuilder('Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader') diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/EmailTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/EmailTest.php index e8b39d85021b..71314dbdf849 100644 --- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/EmailTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/EmailTest.php @@ -79,7 +79,7 @@ class EmailTest extends \PHPUnit_Framework_TestCase */ protected $shipmentLoader; - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->shipmentLoader = $this->getMock( diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/NewActionTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/NewActionTest.php index 8bcab5a42f36..d8ab19432e8b 100644 --- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/NewActionTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/NewActionTest.php @@ -89,7 +89,7 @@ class NewActionTest extends \PHPUnit_Framework_TestCase /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->shipmentLoader = $this->getMockBuilder('Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader') diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php index 21114e09ddcd..1f4e505a8c82 100644 --- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php @@ -91,7 +91,7 @@ class SaveTest extends \PHPUnit_Framework_TestCase /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ - public function setUp() + protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->shipmentLoader = $this->getMockBuilder('Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader') diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/ShipmentLoaderTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/ShipmentLoaderTest.php index 3c117cdfcef2..65a60d4ffded 100644 --- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/ShipmentLoaderTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/ShipmentLoaderTest.php @@ -52,7 +52,7 @@ class ShipmentLoaderTest extends \PHPUnit_Framework_TestCase */ protected $loader; - public function setUp() + protected function setUp() { $this->shipmentRepositoryMock = $this->getMockBuilder('Magento\Sales\Model\Order\ShipmentRepository') ->disableOriginalConstructor() diff --git a/app/code/Magento/Shipping/Test/Unit/Helper/CarrierTest.php b/app/code/Magento/Shipping/Test/Unit/Helper/CarrierTest.php index 4cf6f0c84ecc..7fa8d40adad1 100644 --- a/app/code/Magento/Shipping/Test/Unit/Helper/CarrierTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Helper/CarrierTest.php @@ -22,7 +22,7 @@ class CarrierTest extends \PHPUnit_Framework_TestCase */ protected $scopeConfig; - public function setUp() + protected function setUp() { $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $className = 'Magento\Shipping\Helper\Carrier'; diff --git a/app/code/Magento/Shipping/Test/Unit/Model/ShipmentNotifierTest.php b/app/code/Magento/Shipping/Test/Unit/Model/ShipmentNotifierTest.php index becf22379cc1..64172f2f2886 100644 --- a/app/code/Magento/Shipping/Test/Unit/Model/ShipmentNotifierTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Model/ShipmentNotifierTest.php @@ -41,7 +41,7 @@ class ShipmentNotifierTest extends \PHPUnit_Framework_TestCase */ protected $shipmentSenderMock; - public function setUp() + protected function setUp() { $this->historyCollectionFactory = $this->getMock( 'Magento\Sales\Model\ResourceModel\Order\Status\History\CollectionFactory', diff --git a/app/code/Magento/Shipping/Test/Unit/Model/ShipmentTest.php b/app/code/Magento/Shipping/Test/Unit/Model/ShipmentTest.php index 4612859ae258..ace113c331e2 100644 --- a/app/code/Magento/Shipping/Test/Unit/Model/ShipmentTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Model/ShipmentTest.php @@ -26,7 +26,7 @@ class ShipmentTest extends \PHPUnit_Framework_TestCase */ protected $shipment; - public function setUp() + protected function setUp() { $this->orderRepository = $this->getMock( '\Magento\Sales\Api\OrderRepositoryInterface', diff --git a/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextTest.php b/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextTest.php index 49b8008fb5f9..ee070d2cb9cd 100644 --- a/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextTest.php +++ b/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextTest.php @@ -86,7 +86,7 @@ class ContextTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->sessionMock = $this->getMock( 'Magento\Framework\Session\Generic', diff --git a/app/code/Magento/Store/Test/Unit/Model/App/EmulationTest.php b/app/code/Magento/Store/Test/Unit/Model/App/EmulationTest.php index ecec745f8b43..b39b06ed17ff 100644 --- a/app/code/Magento/Store/Test/Unit/Model/App/EmulationTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/App/EmulationTest.php @@ -72,7 +72,7 @@ class EmulationTest extends \PHPUnit_Framework_TestCase */ private $model; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); // Mocks diff --git a/app/code/Magento/Store/Test/Unit/Model/PathConfigTest.php b/app/code/Magento/Store/Test/Unit/Model/PathConfigTest.php index 6a5df943cc47..33b9631f236f 100644 --- a/app/code/Magento/Store/Test/Unit/Model/PathConfigTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/PathConfigTest.php @@ -26,7 +26,7 @@ class PathConfigTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Store\Model\RouteConfig */ protected $model; - public function setUp() + protected function setUp() { $this->scopeConfigMock = $this->getMockBuilder('Magento\Framework\App\Config\ScopeConfigInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/Store/Test/Unit/Model/Plugin/StoreCookieTest.php b/app/code/Magento/Store/Test/Unit/Model/Plugin/StoreCookieTest.php index 9048b768ff32..52d9b9ecd2da 100644 --- a/app/code/Magento/Store/Test/Unit/Model/Plugin/StoreCookieTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/Plugin/StoreCookieTest.php @@ -55,7 +55,7 @@ class StoreCookieTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->storeManagerMock = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php index 633c03f6806a..d75e7b0f39ef 100644 --- a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php @@ -39,7 +39,7 @@ class StoreTest extends \PHPUnit_Framework_TestCase */ protected $filesystemMock; - public function setUp() + protected function setUp() { $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->requestMock = $this->getMock('Magento\Framework\App\Request\Http', [ diff --git a/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Attribute/Edit/Options/AbstractSwatchTest.php b/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Attribute/Edit/Options/AbstractSwatchTest.php index 86232f4be116..547efa15ec64 100644 --- a/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Attribute/Edit/Options/AbstractSwatchTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Block/Adminhtml/Attribute/Edit/Options/AbstractSwatchTest.php @@ -45,7 +45,7 @@ class AbstractSwatchTest extends \PHPUnit_Framework_TestCase */ protected $block; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('\Magento\Backend\Block\Template\Context', [], [], '', false); $this->registryMock = $this->getMock('\Magento\Framework\Registry', [], [], '', false); @@ -81,8 +81,6 @@ public function setUp() '', true ); - - } /** diff --git a/app/code/Magento/Swatches/Test/Unit/Block/LayeredNavigation/RenderLayeredTest.php b/app/code/Magento/Swatches/Test/Unit/Block/LayeredNavigation/RenderLayeredTest.php index e88f19cdc94d..007ba295957f 100644 --- a/app/code/Magento/Swatches/Test/Unit/Block/LayeredNavigation/RenderLayeredTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Block/LayeredNavigation/RenderLayeredTest.php @@ -40,7 +40,7 @@ class RenderLayeredTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $block; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('\Magento\Framework\View\Element\Template\Context', [], [], '', false); $this->requestMock = $this->getMock('\Magento\Framework\App\Request', ['getParams'], [], '', false); diff --git a/app/code/Magento/Swatches/Test/Unit/Block/Product/Renderer/ConfigurableTest.php b/app/code/Magento/Swatches/Test/Unit/Block/Product/Renderer/ConfigurableTest.php index 272979758823..e32e263391cb 100644 --- a/app/code/Magento/Swatches/Test/Unit/Block/Product/Renderer/ConfigurableTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Block/Product/Renderer/ConfigurableTest.php @@ -58,7 +58,7 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\UrlInterface|\PHPUnit_Framework_MockObject_MockObject */ private $urlBuilder; - public function setUp() + protected function setUp() { $this->arrayUtils = $this->getMock('\Magento\Framework\Stdlib\ArrayUtils', [], [], '', false); $this->jsonEncoder = $this->getMock('\Magento\Framework\Json\EncoderInterface', [], [], '', false); diff --git a/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Iframe/ShowTest.php b/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Iframe/ShowTest.php index 093f84d861de..ab80706a5f02 100644 --- a/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Iframe/ShowTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Controller/Adminhtml/Iframe/ShowTest.php @@ -45,7 +45,7 @@ class ShowTest extends \PHPUnit_Framework_TestCase /** @var ObjectManager|\Magento\Swatches\Controller\Adminhtml\Iframe\Show */ protected $controller; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock('\Magento\Backend\App\Action\Context', [], [], '', false); $observerMock = $this->getMock('\Magento\Framework\Event\Manager', [], [], '', false); diff --git a/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php b/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php index 08a0616df324..510c62a0bf3e 100644 --- a/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Controller/Ajax/MediaTest.php @@ -44,7 +44,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager|\Magento\Swatches\Controller\Ajax\Media */ protected $controller; - public function setUp() + protected function setUp() { $this->mediaGallery = [ 'image' => '/m/a/magento.png', diff --git a/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php b/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php index 3430ec49d6aa..545c1b803aaf 100644 --- a/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Helper/DataTest.php @@ -43,7 +43,7 @@ class DataTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Api\ProductRepositoryInterface */ protected $productRepoMock; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php index f0eda603df24..83333a3dbca2 100644 --- a/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php @@ -43,7 +43,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Swatches\Helper\Media|\Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ protected $mediaHelperObject; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Swatches/Test/Unit/Model/Form/Element/AbstractSwatchTest.php b/app/code/Magento/Swatches/Test/Unit/Model/Form/Element/AbstractSwatchTest.php index 881b9bc3d386..dcf5e61be809 100644 --- a/app/code/Magento/Swatches/Test/Unit/Model/Form/Element/AbstractSwatchTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Model/Form/Element/AbstractSwatchTest.php @@ -17,7 +17,7 @@ class AbstractSwatchTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource|\PHPUnit_Framework_MockObject_MockObject */ private $source; - public function setUp() + protected function setUp() { $this->source = $this->getMockBuilder('Magento\Eav\Model\Entity\Attribute\Source\AbstractSource') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php index d520d28c47c2..b8d7ae0f1f45 100644 --- a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php @@ -54,7 +54,7 @@ class EavAttributeTest extends \PHPUnit_Framework_TestCase /** @var array */ private $dependencyArray = []; - public function setUp() + protected function setUp() { $this->attribute = $this->getMock('\Magento\Catalog\Model\ResourceModel\Eav\Attribute', [], [], '', false); $this->swatchFactory = $this->getMock('\Magento\Swatches\Model\SwatchFactory', ['create'], [], '', false); @@ -88,7 +88,6 @@ public function setUp() ] ); - $this->optionIds = [ 'value' => ['option 89' => 'test 1', 'option 114' => 'test 2', 'option 170' => 'test 3'], 'delete' => ['option 89' => 0, 'option 114' => 1, 'option 170' => 0], diff --git a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/FilterRendererTest.php b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/FilterRendererTest.php index 5ae312957ea9..15ea79a1c1db 100644 --- a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/FilterRendererTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/FilterRendererTest.php @@ -31,7 +31,7 @@ class FilterRendererTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $closureMock; - public function setUp() + protected function setUp() { $this->layoutMock = $this->getMock( '\Magento\Framework\View\Layout', diff --git a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php index 1309501cef35..964dde20551f 100644 --- a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/ProductImageTest.php @@ -31,7 +31,7 @@ class ProductImageTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Swatches\Model\Plugin\ProductImage|\Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ protected $pluginModel; - public function setUp() + protected function setUp() { $this->swatchesHelperMock = $this->getMock( '\Magento\Swatches\Helper\Data', diff --git a/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php b/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php index 8a899eed565c..ddcd3b260ed7 100644 --- a/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php @@ -25,7 +25,7 @@ class AddFieldsToAttributeObserverTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Swatches\Observer\AddFieldsToAttributeObserver|\PHPUnit_Framework_MockObject_MockObject */ protected $observerMock; - public function setUp() + protected function setUp() { $this->moduleManagerMock = $this->getMock( '\Magento\Framework\Module\Manager', @@ -83,7 +83,6 @@ public function testAddFields($expected) $this->observerMock->execute($this->eventObserverMock); } - public function dataAddFields() { return [ diff --git a/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php b/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php index 470c0bc649ac..a07f4ed5b5ed 100644 --- a/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php @@ -19,7 +19,7 @@ class AddSwatchAttributeTypeObserverTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Swatches\Observer\AddSwatchAttributeTypeObserver|\PHPUnit_Framework_MockObject_MockObject */ protected $observerMock; - public function setUp() + protected function setUp() { $this->moduleManagerMock = $this->getMock( '\Magento\Framework\Module\Manager', diff --git a/app/code/Magento/Tax/Test/Unit/Controller/Adminhtml/Rate/AjaxLoadTest.php b/app/code/Magento/Tax/Test/Unit/Controller/Adminhtml/Rate/AjaxLoadTest.php index 0bc39e7e838d..205d4e2d4ca8 100644 --- a/app/code/Magento/Tax/Test/Unit/Controller/Adminhtml/Rate/AjaxLoadTest.php +++ b/app/code/Magento/Tax/Test/Unit/Controller/Adminhtml/Rate/AjaxLoadTest.php @@ -31,7 +31,7 @@ class AjaxLoadTest extends \PHPUnit_Framework_TestCase /* * test setup */ - public function setUp() + protected function setUp() { $this->request = $this->getMockBuilder('\Magento\Framework\App\Request\Http') ->disableOriginalConstructor() @@ -130,10 +130,8 @@ public function testExecute() ] ); - // No exception thrown $this->assertSame($jsonObject, $notification->execute()); - } /** diff --git a/app/code/Magento/Tax/Test/Unit/Helper/DataTest.php b/app/code/Magento/Tax/Test/Unit/Helper/DataTest.php index 67415c4a8e32..7cf68a16a702 100644 --- a/app/code/Magento/Tax/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Tax/Test/Unit/Helper/DataTest.php @@ -29,7 +29,7 @@ class DataTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $taxConfigMock; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/CalculatorFactoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/CalculatorFactoryTest.php index bb62a1f369b1..dc388dce3f02 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/CalculatorFactoryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/CalculatorFactoryTest.php @@ -20,7 +20,7 @@ class CalculatorFactoryTest extends \PHPUnit_Framework_TestCase */ public $objectManager; - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); } diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/Rate/ConverterTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/Rate/ConverterTest.php index 0198506500f1..f30a087925ed 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/Rate/ConverterTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/Rate/ConverterTest.php @@ -29,7 +29,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->taxRateDataObjectFactory = $this->getMockBuilder( '\Magento\Tax\Api\Data\TaxRateInterfaceFactory' @@ -76,7 +76,6 @@ public function testCreateTitlesFromServiceObjectWhenTitlesAreNotProvided() $this->assertEquals([], $this->converter->createTitleArrayFromServiceObject($taxRateMock)); } - public function testCreateArrayFromServiceObject() { $taxRateMock = $this->getMock('Magento\Tax\Api\Data\TaxRateInterface'); diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRegistryTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRegistryTest.php index d25ac5ac1fbd..3f1534d20306 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRegistryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRegistryTest.php @@ -32,7 +32,7 @@ class RateRegistryTest extends \PHPUnit_Framework_TestCase const TAX_RATE_ID = 1; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->rateModelFactoryMock = $this->getMockBuilder('Magento\Tax\Model\Calculation\RateFactory') diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php index a90b613b673e..aa5a7ea8ae31 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php @@ -64,7 +64,7 @@ class RateRepositoryTest extends \PHPUnit_Framework_TestCase */ private $joinProcessorMock; - public function setUp() + protected function setUp() { $this->rateConverterMock = $this->getMock( 'Magento\Tax\Model\Calculation\Rate\Converter', @@ -399,7 +399,6 @@ public function testGetListWhenFilterGroupExists() $searchCriteriaMock->expects($this->any())->method('getPageSize')->will($this->returnValue($pageSize)); $rateMock = $this->getTaxRateMock([]); - $collectionMock->expects($this->once())->method('joinRegionTable'); $collectionMock->expects($this->once())->method('setCurPage')->with($currentPage); $collectionMock->expects($this->once())->method('setPageSize')->with($pageSize); @@ -408,8 +407,6 @@ public function testGetListWhenFilterGroupExists() $this->rateFactoryMock->expects($this->once())->method('create')->will($this->returnValue($rateMock)); $rateMock->expects($this->any())->method('getCollection')->will($this->returnValue($collectionMock)); - - $this->searchResultMock->expects($this->once())->method('setItems')->with($items)->willReturnSelf(); $this->searchResultMock->expects($this->once())->method('setTotalCount')->with(count($items)) ->willReturnSelf(); diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateTest.php index c3d9560fb518..a56cadd7a2e1 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateTest.php @@ -20,7 +20,7 @@ class RateTest extends \PHPUnit_Framework_TestCase /** * Init data */ - public function setUp() + protected function setUp() { $this->objectHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->resourceMock = $this->getMock( diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php index bf65a69d9053..02ce8edb9c25 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php @@ -78,7 +78,7 @@ public function initMocks($isTaxIncluded) $this->initMockAppliedTaxDataObjectFactory(); } - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); $this->taxItemDetailsDataObjectFactory = $this->getMock( diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/TaxRuleRegistryTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/TaxRuleRegistryTest.php index 2b2bbfec6a3f..ed46f34f3ee2 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/TaxRuleRegistryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/TaxRuleRegistryTest.php @@ -32,7 +32,7 @@ class TaxRuleRegistryTest extends \PHPUnit_Framework_TestCase const TAX_RULE_ID = 1; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->taxRuleModelFactoryMock = $this->getMockBuilder('Magento\Tax\Model\Calculation\RuleFactory') diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php index 212cbc28ad17..af5d06134e53 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php @@ -50,7 +50,7 @@ class UnitBaseCalculatorTest extends \PHPUnit_Framework_TestCase */ protected $appliedTaxRate; - public function setUp() + protected function setUp() { /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager $objectManager */ $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Tax/Test/Unit/Model/ClassModelRegistryTest.php b/app/code/Magento/Tax/Test/Unit/Model/ClassModelRegistryTest.php index 2f679fc08fe2..03cd0b2fc87c 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/ClassModelRegistryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/ClassModelRegistryTest.php @@ -30,7 +30,7 @@ class ClassModelRegistryTest extends \PHPUnit_Framework_TestCase const CLASS_MODEL = 1; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->classModelFactoryMock = $this->getMockBuilder('Magento\Tax\Model\ClassModelFactory') diff --git a/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php b/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php index 72c4438569e5..0da91cb7f59a 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php @@ -39,7 +39,7 @@ class OrderSaveTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->orderTaxFactoryMock = $this->getMockBuilder( '\Magento\Tax\Model\Sales\Order\TaxFactory' @@ -132,7 +132,7 @@ public function verifyItemTaxes($expectedItemTaxes) $index = 0; $itemTaxes = []; foreach ($expectedItemTaxes as $itemTax) { - $itemTaxMock = $this->getMockBuilder('\Magento\Tax\Model\Sales\Order\Tax\Item') + $itemTaxMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Tax\Item') ->disableOriginalConstructor() ->setMethods( [ @@ -177,7 +177,6 @@ public function testAfterSave( ->method('getItemAppliedTaxes') ->willReturn($itemAppliedTaxes); - $orderItemMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Item') ->disableOriginalConstructor() ->setMethods(['getId', ]) diff --git a/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php b/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php index a35b8e5ac458..6dc4cae1ca14 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Quote/GrandTotalDetailsPluginTest.php @@ -50,7 +50,7 @@ class GrandTotalDetailsPluginTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->subjectMock = $this->getMockBuilder('\Magento\Quote\Model\Cart\TotalsConverter') ->disableOriginalConstructor() diff --git a/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php b/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php index b91f72213561..cffb428aad45 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php @@ -35,7 +35,7 @@ class ToOrderConverterTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->orderExtensionFactoryMock = $this->getMockBuilder( '\Magento\Sales\Api\Data\OrderExtensionFactory' diff --git a/app/code/Magento/Tax/Test/Unit/Model/Sales/Order/TaxManagementTest.php b/app/code/Magento/Tax/Test/Unit/Model/Sales/Order/TaxManagementTest.php index 3052f60968b1..97ada307b165 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Sales/Order/TaxManagementTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Sales/Order/TaxManagementTest.php @@ -36,7 +36,7 @@ class TaxManagementTest extends \PHPUnit_Framework_TestCase */ protected $orderTaxDetailsDataObject; - public function setUp() + protected function setUp() { $this->orderMock = $this->getMock('Magento\Sales\Model\Order', ['load'], [], '', false); diff --git a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php index 2ac5ebb98866..a60b9628d5f4 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php @@ -60,7 +60,7 @@ class CommonTaxCollectorTest extends \PHPUnit_Framework_TestCase */ protected $taxClassKeyDataObject; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Tax/Test/Unit/Model/TaxCalculationTest.php b/app/code/Magento/Tax/Test/Unit/Model/TaxCalculationTest.php index d558c91e0a14..b3db88541272 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/TaxCalculationTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/TaxCalculationTest.php @@ -55,7 +55,7 @@ class TaxCalculationTest extends \PHPUnit_Framework_TestCase */ private $dataObjectHelperMock; - public function setUp() + protected function setUp() { $this->calculationTool = $this->getMock('\Magento\Tax\Model\Calculation', [], [], '', false); $this->calculatorFactory = $this->getMock( diff --git a/app/code/Magento/Tax/Test/Unit/Model/TaxClass/Source/ProductTest.php b/app/code/Magento/Tax/Test/Unit/Model/TaxClass/Source/ProductTest.php index 5ad448a2e616..1fb4bc7d1dcf 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/TaxClass/Source/ProductTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/TaxClass/Source/ProductTest.php @@ -34,7 +34,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase */ protected $product; - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); @@ -163,7 +163,6 @@ public function testGetAllOptionsNameIntegrity(array $value) ->with($searchCriteriaMock) ->willReturn($searchResultsMock); - $taxClassMock->expects($this->once()) ->method('getClassId') ->willReturn($value['value']); diff --git a/app/code/Magento/Tax/Test/Unit/Pricing/AdjustmentTest.php b/app/code/Magento/Tax/Test/Unit/Pricing/AdjustmentTest.php index 65c8a38c62a3..d092307add03 100644 --- a/app/code/Magento/Tax/Test/Unit/Pricing/AdjustmentTest.php +++ b/app/code/Magento/Tax/Test/Unit/Pricing/AdjustmentTest.php @@ -32,7 +32,7 @@ class AdjustmentTest extends \PHPUnit_Framework_TestCase */ protected $sortOrder = 5; - public function setUp() + protected function setUp() { $this->taxHelper = $this->getMock('Magento\Tax\Helper\Data', [], [], '', false); $this->catalogHelper = $this->getMock('Magento\Catalog\Helper\Data', [], [], '', false); diff --git a/app/code/Magento/Tax/Test/Unit/Pricing/Render/AdjustmentTest.php b/app/code/Magento/Tax/Test/Unit/Pricing/Render/AdjustmentTest.php index 1f7b01d7daa9..d0b42853c42f 100644 --- a/app/code/Magento/Tax/Test/Unit/Pricing/Render/AdjustmentTest.php +++ b/app/code/Magento/Tax/Test/Unit/Pricing/Render/AdjustmentTest.php @@ -39,7 +39,7 @@ class AdjustmentTest extends \PHPUnit_Framework_TestCase /** * Init mocks and model */ - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock( 'Magento\Framework\View\Element\Template\Context', diff --git a/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php b/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php index b48127ae6327..81ff348d2951 100644 --- a/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php +++ b/app/code/Magento/Theme/Test/Unit/Block/Html/TopmenuTest.php @@ -63,7 +63,7 @@ class TopmenuTest extends \PHPUnit_Framework_TestCase // @codingStandardsIgnoreEnd - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php b/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php index 8356cd2ddadf..4f09e0713696 100644 --- a/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php +++ b/app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php @@ -80,7 +80,7 @@ class ThemeUninstallCommandTest extends \PHPUnit_Framework_TestCase */ private $tester; - public function setUp() + protected function setUp() { $this->maintenanceMode = $this->getMock('Magento\Framework\App\MaintenanceMode', [], [], '', false); $composerInformation = $this->getMock('Magento\Framework\Composer\ComposerInformation', [], [], '', false); diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DeleteTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DeleteTest.php index 1d9ba1b826f9..76907aee53ab 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DeleteTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DeleteTest.php @@ -55,7 +55,7 @@ class DeleteTest extends \PHPUnit_Framework_TestCase */ protected $controller; - public function setUp() + protected function setUp() { $context = $this->getMockBuilder('Magento\Backend\App\Action\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php index 4aa0ef11d34f..d1611049758e 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCssTest.php @@ -68,7 +68,7 @@ class DownloadCssTest extends \PHPUnit_Framework_TestCase */ protected $controller; - public function setUp() + protected function setUp() { $context = $this->getMockBuilder('Magento\Backend\App\Action\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCustomCssTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCustomCssTest.php index 893925307bb6..1d02699e826d 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCustomCssTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/DownloadCustomCssTest.php @@ -68,7 +68,7 @@ class DownloadCustomCssTest extends \PHPUnit_Framework_TestCase */ protected $controller; - public function setUp() + protected function setUp() { $context = $this->getMockBuilder('Magento\Backend\App\Action\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/GridTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/GridTest.php index 9581240fd37f..7859e1caf226 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/GridTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/GridTest.php @@ -39,7 +39,7 @@ class GridTest extends \PHPUnit_Framework_TestCase */ protected $controller; - public function setUp() + protected function setUp() { $context = $this->getMockBuilder('Magento\Backend\App\Action\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/UploadJsTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/UploadJsTest.php index a1b25b5b6744..01200f7c0d31 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/UploadJsTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Theme/UploadJsTest.php @@ -28,7 +28,7 @@ class UploadJsTest extends \Magento\Theme\Test\Unit\Controller\Adminhtml\System\ /** @var \Magento\Framework\View\Design\Theme\CustomizationInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $themeCustomization; - public function setUp() + protected function setUp() { parent::setUp(); $this->serviceModel = $this->getMock('Magento\Theme\Model\Uploader\Service', [], [], '', false); diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/ContentsTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/ContentsTest.php index 47381dcf1513..d51b74a3b3fc 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/ContentsTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/ContentsTest.php @@ -25,7 +25,7 @@ class ContentsTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Theme\Helper\Storage|\PHPUnit_Framework_MockObject_MockObject */ protected $storage; - public function setUp() + protected function setUp() { $this->view = $this->getMock('\Magento\Framework\App\ViewInterface', [], [], '', false); $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); @@ -46,7 +46,6 @@ public function setUp() ); } - public function testExecute() { $layout = $this->getMockForAbstractClass('Magento\Framework\View\LayoutInterface', [], '', false); diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFilesTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFilesTest.php index 6212701070d8..2f20ef143654 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFilesTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFilesTest.php @@ -22,7 +22,7 @@ class DeleteFilesTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $response; - public function setUp() + protected function setUp() { $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->storage = $this->getMock('Magento\Theme\Model\Wysiwyg\Storage', [], [], '', false); diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFolderTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFolderTest.php index 90df19e8d0fd..e1ada03f772c 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFolderTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/DeleteFolderTest.php @@ -22,7 +22,7 @@ class DeleteFolderTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Theme\Helper\Storage|\PHPUnit_Framework_MockObject_MockObject */ protected $storageHelper; - public function setUp() + protected function setUp() { $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/IndexTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/IndexTest.php index d58d41c3211d..ec5de23fb3c2 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/IndexTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/IndexTest.php @@ -13,7 +13,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\ViewInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $view; - public function setUp() + protected function setUp() { $this->view = $this->getMock('\Magento\Framework\App\ViewInterface', [], [], '', false); diff --git a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/OnInsertTest.php b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/OnInsertTest.php index dc2055954e5c..da9aa4e72d36 100644 --- a/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/OnInsertTest.php +++ b/app/code/Magento/Theme/Test/Unit/Controller/Adminhtml/System/Design/Wysiwyg/Files/OnInsertTest.php @@ -22,7 +22,7 @@ class OnInsertTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Response\Http|\PHPUnit_Framework_MockObject_MockObject */ protected $response; - public function setUp() + protected function setUp() { $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->view = $this->getMock('\Magento\Framework\App\ViewInterface', [], [], '', false); diff --git a/app/code/Magento/Theme/Test/Unit/CustomerData/MessagesTest.php b/app/code/Magento/Theme/Test/Unit/CustomerData/MessagesTest.php index 6f51a89dc954..83308df85714 100644 --- a/app/code/Magento/Theme/Test/Unit/CustomerData/MessagesTest.php +++ b/app/code/Magento/Theme/Test/Unit/CustomerData/MessagesTest.php @@ -25,7 +25,7 @@ class MessagesTest extends \PHPUnit_Framework_TestCase */ protected $object; - public function setUp() + protected function setUp() { $this->messageManager = $this->getMockBuilder('Magento\Framework\Message\ManagerInterface')->getMock(); $this->messageInterpretationStrategy = $this->getMock( diff --git a/app/code/Magento/Theme/Test/Unit/Model/Favicon/FaviconTest.php b/app/code/Magento/Theme/Test/Unit/Model/Favicon/FaviconTest.php index 91bf4f0105b2..5b2767229b6b 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Favicon/FaviconTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Favicon/FaviconTest.php @@ -41,7 +41,7 @@ class FaviconTest extends \PHPUnit_Framework_TestCase /** * Initialize testable object */ - public function setUp() + protected function setUp() { $storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface')->getMock(); $this->store = $this->getMockBuilder('Magento\Store\Model\Store')->disableOriginalConstructor()->getMock(); diff --git a/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/ConverterTest.php b/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/ConverterTest.php index ddf5e726e49c..601d3fe6f277 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/ConverterTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/ConverterTest.php @@ -17,7 +17,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase /** @var array */ protected $_targetArray; - public function setUp() + protected function setUp() { $this->_model = new \Magento\Theme\Model\Layout\Config\Converter(); } diff --git a/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/SchemaLocatorTest.php b/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/SchemaLocatorTest.php index c5ba6a46ac7e..7147b2503923 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/SchemaLocatorTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Layout/Config/SchemaLocatorTest.php @@ -20,7 +20,7 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase /** * Initialize testable object */ - public function setUp() + protected function setUp() { /** * @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock | \PHPUnit_Framework_MockObject_MockObject diff --git a/app/code/Magento/Theme/Test/Unit/Model/Layout/ConfigTest.php b/app/code/Magento/Theme/Test/Unit/Model/Layout/ConfigTest.php index 9af769b2a184..e5c75c60d8e5 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Layout/ConfigTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Layout/ConfigTest.php @@ -20,7 +20,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected $dataStorage; - public function setUp() + protected function setUp() { $this->dataStorage = $this->getMockBuilder('Magento\Framework\Config\DataInterface') ->disableOriginalConstructor() diff --git a/app/code/Magento/Theme/Test/Unit/Model/Layout/Source/LayoutTest.php b/app/code/Magento/Theme/Test/Unit/Model/Layout/Source/LayoutTest.php index 05ee40e13ce8..308b3b6361ce 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Layout/Source/LayoutTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Layout/Source/LayoutTest.php @@ -20,7 +20,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase */ protected $config; - public function setUp() + protected function setUp() { $this->config = $this->getMockBuilder('Magento\Theme\Model\Layout\Config') ->disableOriginalConstructor() diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/Customization/File/CustomCssTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/Customization/File/CustomCssTest.php index 7eee81ba8f91..3217b2d5129f 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/Customization/File/CustomCssTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/Customization/File/CustomCssTest.php @@ -32,7 +32,7 @@ class CustomCssTest extends \PHPUnit_Framework_TestCase /** * Initialize testable object */ - public function setUp() + protected function setUp() { $this->customizationPath = $this->getMockBuilder('Magento\Framework\View\Design\Theme\Customization\Path') ->disableOriginalConstructor() diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/Plugin/RegistrationTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/Plugin/RegistrationTest.php index aa29430d29bf..4ec24f3eea6a 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/Plugin/RegistrationTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/Plugin/RegistrationTest.php @@ -35,7 +35,7 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase /** @var Registration */ protected $plugin; - public function setUp() + protected function setUp() { $this->themeRegistration = $this->getMock('Magento\Theme\Model\Theme\Registration', [], [], '', false); $this->logger = $this->getMockForAbstractClass('Psr\Log\LoggerInterface', [], '', false); diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/RegistrationTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/RegistrationTest.php index 9e9ba84a5d1f..4e7ae2cae17e 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/RegistrationTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/RegistrationTest.php @@ -25,7 +25,7 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase */ protected $filesystemCollection; - public function setUp() + protected function setUp() { $this->collectionFactory = $this->getMockBuilder('Magento\Theme\Model\ResourceModel\Theme\Data\CollectionFactory') diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/SingleFileTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/SingleFileTest.php index ab902e54d732..aede9c87a867 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/SingleFileTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/SingleFileTest.php @@ -22,7 +22,7 @@ class SingleFileTest extends \PHPUnit_Framework_TestCase /** * Initialize testable object */ - public function setUp() + protected function setUp() { $this->file = $this->getMockBuilder('Magento\Framework\View\Design\Theme\Customization\FileInterface') ->getMock(); @@ -154,7 +154,6 @@ public function testUpdateWhenFileDelete() $customization = $this->getMockBuilder('Magento\Framework\View\Design\Theme\CustomizationInterface') ->getMock(); - $customCss->expects($this->once()) ->method('delete'); $this->file->expects($this->once()) diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemePackageInfoTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemePackageInfoTest.php index 092d2de3daa7..b84c34af6617 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemePackageInfoTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemePackageInfoTest.php @@ -29,7 +29,7 @@ class ThemePackageInfoTest extends \PHPUnit_Framework_TestCase */ private $dirReadFactory; - public function setUp() + protected function setUp() { $this->componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); $this->dirRead = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false); diff --git a/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemeUninstallerTest.php b/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemeUninstallerTest.php index ae0cb0d1c7ab..084559d28688 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemeUninstallerTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Theme/ThemeUninstallerTest.php @@ -34,7 +34,7 @@ class ThemeUninstallerTest extends \PHPUnit_Framework_TestCase */ private $output; - public function setUp() + protected function setUp() { $this->themePackageInfo = $this->getMock('Magento\Theme\Model\Theme\ThemePackageInfo', [], [], '', false); $this->remove = $this->getMock('Magento\Framework\Composer\Remove', [], [], '', false); diff --git a/app/code/Magento/Translation/Test/Unit/Console/Command/UninstallLanguageCommandTest.php b/app/code/Magento/Translation/Test/Unit/Console/Command/UninstallLanguageCommandTest.php index 7014c35c83dd..69fb362f70c6 100644 --- a/app/code/Magento/Translation/Test/Unit/Console/Command/UninstallLanguageCommandTest.php +++ b/app/code/Magento/Translation/Test/Unit/Console/Command/UninstallLanguageCommandTest.php @@ -51,7 +51,7 @@ class UninstallLanguageCommandTest extends \PHPUnit_Framework_TestCase */ private $tester; - public function setUp() + protected function setUp() { $this->dependencyChecker = $this->getMock( 'Magento\Framework\Composer\DependencyChecker', @@ -71,7 +71,6 @@ public function setUp() false ); - $this->command = new UninstallLanguageCommand( $this->dependencyChecker, $this->remove, @@ -166,8 +165,6 @@ public function testExecutePackageHasDependency() $this->assertContains('Nothing is removed.', $this->tester->getDisplay()); } - - public function testExecutePackageNoLanguage() { $dependencies['vendor/language-ua_ua'] = []; diff --git a/app/code/Magento/Ui/Test/Unit/Component/Control/ActionPoolTest.php b/app/code/Magento/Ui/Test/Unit/Component/Control/ActionPoolTest.php index 947f4c37ef6f..651226e6476f 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Control/ActionPoolTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Control/ActionPoolTest.php @@ -60,7 +60,7 @@ class ActionPoolTest extends \PHPUnit_Framework_TestCase */ protected $key = 'id'; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock( 'Magento\Framework\View\Element\UiComponent\Context', diff --git a/app/code/Magento/Ui/Test/Unit/Component/Control/ActionTest.php b/app/code/Magento/Ui/Test/Unit/Component/Control/ActionTest.php index e77369858c52..0c50da477ed0 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Control/ActionTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Control/ActionTest.php @@ -26,7 +26,7 @@ class ActionTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $context = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\ContextInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Ui/Test/Unit/Component/Control/ButtonTest.php b/app/code/Magento/Ui/Test/Unit/Component/Control/ButtonTest.php index fab5594e70b0..08e1a5589ccb 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Control/ButtonTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Control/ButtonTest.php @@ -35,7 +35,7 @@ class ButtonTest extends \PHPUnit_Framework_TestCase */ protected $escaperMock; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMock( '\Magento\Framework\View\Element\Template\Context', diff --git a/app/code/Magento/Ui/Test/Unit/Component/Control/LinkTest.php b/app/code/Magento/Ui/Test/Unit/Component/Control/LinkTest.php index f905775216c1..63f71b5623a7 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Control/LinkTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Control/LinkTest.php @@ -26,7 +26,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $context = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\ContextInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/FilterModifierTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/FilterModifierTest.php index 735f91a15646..c06036283bb8 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/FilterModifierTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/FilterModifierTest.php @@ -35,7 +35,7 @@ class FilterModifierTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->request = $this->getMockForAbstractClass('Magento\Framework\App\RequestInterface'); $this->dataProvider = $this->getMockForAbstractClass( diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateRangeTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateRangeTest.php index b50477c178e0..525766b26540 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateRangeTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateRangeTest.php @@ -40,7 +40,7 @@ class DateRangeTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->contextMock = $this->getMockForAbstractClass( 'Magento\Framework\View\Element\UiComponent\ContextInterface', @@ -142,7 +142,6 @@ public function testPrepare($name, $filterData, $expectedCondition) ->method('addFilter') ->with($expectedCondition, $name); - $uiComponent->expects($this->any()) ->method('getLocale') ->willReturn($expectedCondition['locale']); diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php index 5e30467572f7..7000d9e09113 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php @@ -40,7 +40,7 @@ class DateTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->contextMock = $this->getMockForAbstractClass( 'Magento\Framework\View\Element\UiComponent\ContextInterface', diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/InputTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/InputTest.php index 91609890c87f..12788c9dd1ec 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/InputTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/InputTest.php @@ -40,7 +40,7 @@ class InputTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->contextMock = $this->getMockForAbstractClass( 'Magento\Framework\View\Element\UiComponent\ContextInterface', diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/RangeTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/RangeTest.php index de3f1d31ab30..02c1092313c4 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/RangeTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/RangeTest.php @@ -39,7 +39,7 @@ class RangeTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->contextMock = $this->getMockForAbstractClass( 'Magento\Framework\View\Element\UiComponent\ContextInterface', diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/SelectTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/SelectTest.php index cc887423946c..84f95dfc0302 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/SelectTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/SelectTest.php @@ -40,7 +40,7 @@ class SelectTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->contextMock = $this->getMockForAbstractClass( 'Magento\Framework\View\Element\UiComponent\ContextInterface', diff --git a/app/code/Magento/Ui/Test/Unit/Component/Listing/Columns/ColumnTest.php b/app/code/Magento/Ui/Test/Unit/Component/Listing/Columns/ColumnTest.php index 7ebb04aac2d7..3ef37d164ba7 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Listing/Columns/ColumnTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Listing/Columns/ColumnTest.php @@ -30,7 +30,7 @@ class ColumnTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Ui/Test/Unit/Component/Listing/Columns/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Listing/Columns/DateTest.php index cbd88197fbe1..ebf1c4149014 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Listing/Columns/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Listing/Columns/DateTest.php @@ -37,7 +37,7 @@ class DateTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Ui/Test/Unit/Component/Listing/ColumnsTest.php b/app/code/Magento/Ui/Test/Unit/Component/Listing/ColumnsTest.php index ade7478204d2..6f2e5de4e7b9 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Listing/ColumnsTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Listing/ColumnsTest.php @@ -29,7 +29,7 @@ class ColumnsTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Ui/Test/Unit/Component/ListingTest.php b/app/code/Magento/Ui/Test/Unit/Component/ListingTest.php index e8ab33f77e42..6f45e1ccb1c8 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/ListingTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/ListingTest.php @@ -28,7 +28,7 @@ class ListingTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Ui/Test/Unit/Component/MassAction/Columns/ColumnTest.php b/app/code/Magento/Ui/Test/Unit/Component/MassAction/Columns/ColumnTest.php index 8499c1789c06..adb0b7ded9e6 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/MassAction/Columns/ColumnTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/MassAction/Columns/ColumnTest.php @@ -32,7 +32,7 @@ class ColumnTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php b/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php index 9e2220ef51ec..417c918723c6 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/MassActionTest.php @@ -27,7 +27,7 @@ class MassActionTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Ui/Test/Unit/Component/PagingTest.php b/app/code/Magento/Ui/Test/Unit/Component/PagingTest.php index 1bb1336cd069..fe60675f2999 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/PagingTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/PagingTest.php @@ -28,7 +28,7 @@ class PagingTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); diff --git a/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Export/GridToCsvTest.php b/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Export/GridToCsvTest.php index 71993e7148c6..541305557f94 100644 --- a/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Export/GridToCsvTest.php +++ b/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Export/GridToCsvTest.php @@ -32,7 +32,7 @@ class GridToCsvTest extends \PHPUnit_Framework_TestCase */ protected $fileFactory; - public function setUp() + protected function setUp() { $this->context = $this->getMockBuilder('Magento\Backend\App\Action\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Export/GridToXmlTest.php b/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Export/GridToXmlTest.php index fda037db8605..ec64591c15c5 100644 --- a/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Export/GridToXmlTest.php +++ b/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Export/GridToXmlTest.php @@ -32,7 +32,7 @@ class GridToXmlTest extends \PHPUnit_Framework_TestCase */ protected $fileFactory; - public function setUp() + protected function setUp() { $this->context = $this->getMockBuilder('Magento\Backend\App\Action\Context') ->disableOriginalConstructor() diff --git a/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php b/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php index ed938f2c6e1b..a5620914725e 100644 --- a/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php +++ b/app/code/Magento/Ui/Test/Unit/Controller/Adminhtml/Index/RenderTest.php @@ -32,7 +32,7 @@ class RenderTest extends \PHPUnit_Framework_TestCase */ protected $uiFactoryMock; - public function setUp() + protected function setUp() { $this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') ->disableOriginalConstructor() diff --git a/app/code/Magento/Ui/Test/Unit/Model/BookmarkManagementTest.php b/app/code/Magento/Ui/Test/Unit/Model/BookmarkManagementTest.php index f7e044d86e84..c69b75a5b9fb 100644 --- a/app/code/Magento/Ui/Test/Unit/Model/BookmarkManagementTest.php +++ b/app/code/Magento/Ui/Test/Unit/Model/BookmarkManagementTest.php @@ -39,7 +39,7 @@ class BookmarkManagementTest extends \PHPUnit_Framework_TestCase */ protected $userContext; - public function setUp() + protected function setUp() { $this->bookmarkRepository = $this->getMockBuilder('Magento\Ui\Api\BookmarkRepositoryInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Ui/Test/Unit/Model/Export/ConvertToCsvTest.php b/app/code/Magento/Ui/Test/Unit/Model/Export/ConvertToCsvTest.php index 3e775cb6e625..003a15c04041 100644 --- a/app/code/Magento/Ui/Test/Unit/Model/Export/ConvertToCsvTest.php +++ b/app/code/Magento/Ui/Test/Unit/Model/Export/ConvertToCsvTest.php @@ -51,7 +51,7 @@ class ConvertToCsvTest extends \PHPUnit_Framework_TestCase */ protected $component; - public function setUp() + protected function setUp() { $this->directory = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\WriteInterface') ->getMockForAbstractClass(); diff --git a/app/code/Magento/Ui/Test/Unit/Model/Export/ConvertToXmlTest.php b/app/code/Magento/Ui/Test/Unit/Model/Export/ConvertToXmlTest.php index 9a82ebed77f4..3ff0732c3228 100644 --- a/app/code/Magento/Ui/Test/Unit/Model/Export/ConvertToXmlTest.php +++ b/app/code/Magento/Ui/Test/Unit/Model/Export/ConvertToXmlTest.php @@ -71,7 +71,7 @@ class ConvertToXmlTest extends \PHPUnit_Framework_TestCase */ protected $component; - public function setUp() + protected function setUp() { $this->directory = $this->getMockBuilder(DirectoryWriteInterface::class) ->getMockForAbstractClass(); diff --git a/app/code/Magento/Ui/Test/Unit/Model/Export/MetadataProviderTest.php b/app/code/Magento/Ui/Test/Unit/Model/Export/MetadataProviderTest.php index 18448cf4a2ee..ff81b1d3fbaf 100644 --- a/app/code/Magento/Ui/Test/Unit/Model/Export/MetadataProviderTest.php +++ b/app/code/Magento/Ui/Test/Unit/Model/Export/MetadataProviderTest.php @@ -25,7 +25,7 @@ class MetadataProviderTest extends \PHPUnit_Framework_TestCase */ protected $filter; - public function setUp() + protected function setUp() { $this->filter = $this->getMockBuilder('Magento\Ui\Component\MassAction\Filter') ->disableOriginalConstructor() diff --git a/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php b/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php index 98cf9b6cf2a3..f4180b44b996 100644 --- a/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php +++ b/app/code/Magento/Ui/Test/Unit/Model/ManagerTest.php @@ -75,7 +75,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase */ protected $aggregatedFileCollectorFactory; - public function setUp() + protected function setUp() { $this->componentConfigProvider = $this->getMockBuilder( 'Magento\Framework\View\Element\UiComponent\Config\Provider\Component\Definition' diff --git a/app/code/Magento/Ui/Test/Unit/Model/ResourceModel/BookmarkRepositoryTest.php b/app/code/Magento/Ui/Test/Unit/Model/ResourceModel/BookmarkRepositoryTest.php index 8fe163d895c2..6ee7c8f9e561 100644 --- a/app/code/Magento/Ui/Test/Unit/Model/ResourceModel/BookmarkRepositoryTest.php +++ b/app/code/Magento/Ui/Test/Unit/Model/ResourceModel/BookmarkRepositoryTest.php @@ -37,7 +37,7 @@ class BookmarkRepositoryTest extends \PHPUnit_Framework_TestCase /** * Set up */ - public function setUp() + protected function setUp() { $this->bookmarkMock = $this->getMockBuilder('Magento\Ui\Model\Bookmark') ->disableOriginalConstructor() diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html index 9c582301f42f..326a9d7ee4a4 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html @@ -42,6 +42,7 @@ } ">
@@ -121,7 +122,8 @@ ">
  • + data-bind="css: { _parent: $data.optgroup }" + data-role="option-group">
    =5.3.2", - "seld/jsonlint": "~1.0", - "symfony/console": "~2.5", - "symfony/finder": "~2.2", - "symfony/process": "~2.1" + "composer/semver": "^1.0", + "composer/spdx-licenses": "^1.0", + "justinrainbow/json-schema": "^1.6", + "php": "^5.3.2 || ^7.0", + "seld/cli-prompt": "^1.0", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.0", + "symfony/console": "^2.5 || ^3.0", + "symfony/filesystem": "^2.5 || ^3.0", + "symfony/finder": "^2.2 || ^3.0", + "symfony/process": "^2.1 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "~4.5" + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives, and allows gzip compression of all internet traffic" + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" }, "bin": [ "bin/composer" @@ -170,8 +177,8 @@ } }, "autoload": { - "psr-0": { - "Composer": "src/" + "psr-4": { + "Composer\\": "src/Composer" } }, "notification-url": "https://packagist.org/downloads/", @@ -191,13 +198,136 @@ } ], "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", - "homepage": "http://getcomposer.org/", + "homepage": "https://getcomposer.org/", "keywords": [ "autoload", "dependency", "package" ], - "time": "2015-04-14 21:18:51" + "time": "2016-03-03 15:15:10" + }, + { + "name": "composer/semver", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "df4463baa9f44fe6cf0a6da4fde2934d4c0a2747" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/df4463baa9f44fe6cf0a6da4fde2934d4c0a2747", + "reference": "df4463baa9f44fe6cf0a6da4fde2934d4c0a2747", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2016-02-25 22:23:39" + }, + { + "name": "composer/spdx-licenses", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "9e1c3926bb0842812967213d7c92827bc5883671" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/9e1c3926bb0842812967213d7c92827bc5883671", + "reference": "9e1c3926bb0842812967213d7c92827bc5883671", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "time": "2015-10-05 11:27:42" }, { "name": "justinrainbow/json-schema", @@ -316,20 +446,20 @@ }, { "name": "magento/composer", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/magento/composer.git", - "reference": "1be267e71debac6e0d9fae4e5144f6095cffbe89" + "reference": "b53f7c8a037860b467083e94de7c17cfd323e365" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/composer/zipball/1be267e71debac6e0d9fae4e5144f6095cffbe89", - "reference": "1be267e71debac6e0d9fae4e5144f6095cffbe89", + "url": "https://api.github.com/repos/magento/composer/zipball/b53f7c8a037860b467083e94de7c17cfd323e365", + "reference": "b53f7c8a037860b467083e94de7c17cfd323e365", "shasum": "" }, "require": { - "composer/composer": "1.0.0-alpha10", + "composer/composer": "1.0.0-beta1", "php": "~5.5.0|~5.6.0|~7.0.0", "symfony/console": "~2.3 <2.7" }, @@ -348,7 +478,7 @@ "AFL-3.0" ], "description": "Magento composer library helps to instantiate Composer application and run composer commands.", - "time": "2015-10-01 14:39:10" + "time": "2016-03-08 20:50:51" }, { "name": "magento/magento-composer-installer", @@ -800,6 +930,54 @@ ], "time": "2012-12-21 11:40:51" }, + { + "name": "seld/cli-prompt", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/cli-prompt.git", + "reference": "b27db1514f7d7bb7a366ad95d4eb2b17140a0691" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/b27db1514f7d7bb7a366ad95d4eb2b17140a0691", + "reference": "b27db1514f7d7bb7a366ad95d4eb2b17140a0691", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\CliPrompt\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", + "keywords": [ + "cli", + "console", + "hidden", + "input", + "prompt" + ], + "time": "2016-01-09 17:55:27" + }, { "name": "seld/jsonlint", "version": "1.4.0", @@ -846,6 +1024,50 @@ ], "time": "2015-11-21 02:21:41" }, + { + "name": "seld/phar-utils", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phra" + ], + "time": "2015-10-13 18:44:15" + }, { "name": "sjparkinson/static-review", "version": "4.1.1", @@ -1018,17 +1240,17 @@ "time": "2016-01-27 05:14:19" }, { - "name": "symfony/finder", + "name": "symfony/filesystem", "version": "v2.8.3", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "877bb4b16ea573cc8c024e9590888fcf7eb7e0f7" + "url": "https://github.com/symfony/filesystem.git", + "reference": "65cb36b6539b1d446527d60457248f30d045464d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/877bb4b16ea573cc8c024e9590888fcf7eb7e0f7", - "reference": "877bb4b16ea573cc8c024e9590888fcf7eb7e0f7", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/65cb36b6539b1d446527d60457248f30d045464d", + "reference": "65cb36b6539b1d446527d60457248f30d045464d", "shasum": "" }, "require": { @@ -1040,6 +1262,55 @@ "dev-master": "2.8-dev" } }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2016-02-22 15:02:30" + }, + { + "name": "symfony/finder", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "623bda0abd9aa29e529c8e9c08b3b84171914723" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/623bda0abd9aa29e529c8e9c08b3b84171914723", + "reference": "623bda0abd9aa29e529c8e9c08b3b84171914723", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" @@ -1064,7 +1335,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-02-22 16:12:45" + "time": "2016-01-27 05:14:46" }, { "name": "symfony/process", @@ -3586,6 +3857,96 @@ ], "time": "2015-06-21 07:55:53" }, + { + "name": "sebastian/finder-facade", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/finder-facade.git", + "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", + "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", + "shasum": "" + }, + "require": { + "symfony/finder": "~2.3|~3.0", + "theseer/fdomdocument": "~1.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", + "homepage": "https://github.com/sebastianbergmann/finder-facade", + "time": "2016-02-17 07:02:23" + }, + { + "name": "sebastian/phpcpd", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpcpd.git", + "reference": "346c909de7adc3979988a6505a80814c8562d6b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/346c909de7adc3979988a6505a80814c8562d6b3", + "reference": "346c909de7adc3979988a6505a80814c8562d6b3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-timer": ">=1.0.4", + "sebastian/finder-facade": ">=1.1.0", + "sebastian/version": ">=1.0.0", + "symfony/console": ">=2.2.0", + "theseer/fdomdocument": "~1.4" + }, + "bin": [ + "composer/bin/phpcpd" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Copy/Paste Detector (CPD) for PHP code.", + "homepage": "https://github.com/sebastianbergmann/phpcpd", + "time": "2013-11-08 09:05:42" + }, { "name": "sebastian/recursion-context", "version": "1.0.2", @@ -3864,55 +4225,6 @@ "homepage": "https://symfony.com", "time": "2016-02-28 16:34:46" }, - { - "name": "symfony/filesystem", - "version": "v2.8.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "65cb36b6539b1d446527d60457248f30d045464d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/65cb36b6539b1d446527d60457248f30d045464d", - "reference": "65cb36b6539b1d446527d60457248f30d045464d", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2016-02-22 15:02:30" - }, { "name": "symfony/stopwatch", "version": "v3.0.3", @@ -4010,12 +4322,51 @@ "description": "Symfony Yaml Component", "homepage": "https://symfony.com", "time": "2016-02-23 07:41:20" + }, + { + "name": "theseer/fdomdocument", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/fDOMDocument.git", + "reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/d9ad139d6c2e8edf5e313ffbe37ff13344cf0684", + "reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "lib-libxml": "*", + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "lead" + } + ], + "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", + "homepage": "https://github.com/theseer/fDOMDocument", + "time": "2015-05-27 22:58:02" } ], "aliases": [], "minimum-stability": "alpha", "stability-flags": { - "composer/composer": 15, "phpmd/phpmd": 0 }, "prefer-stable": true, diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php index 1182da327ed2..cf2e2fa3b7d7 100644 --- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php @@ -6,12 +6,14 @@ namespace Magento\Customer\Api; use Magento\Customer\Api\Data\CustomerInterface as Customer; +use Magento\Customer\Api\Data\AddressInterface as Address; use Magento\Framework\Api\SortOrder; use Magento\Framework\Exception\InputException; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\Helper\Customer as CustomerHelper; use Magento\TestFramework\TestCase\WebapiAbstract; use Magento\Framework\Webapi\Exception as HTTPExceptionCodes; +use Magento\Framework\Exception\NoSuchEntityException; /** * Test class for Magento\Customer\Api\CustomerRepositoryInterface @@ -346,6 +348,83 @@ public function testUpdateCustomerException() } } + /** + * Test creating a customer with absent required address fields + */ + public function testCreateCustomerWithoutAddressRequiresException() + { + $customerDataArray = $this->dataObjectProcessor->buildOutputDataArray( + $this->customerHelper->createSampleCustomerDataObject(), + '\Magento\Customer\Api\Data\CustomerInterface' + ); + + foreach ($customerDataArray[Customer::KEY_ADDRESSES] as & $address) { + $address[Address::FIRSTNAME] = null; + } + + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH, + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Save', + ], + ]; + $requestData = ['customer' => $customerDataArray]; + try { + $this->_webApiCall($serviceInfo, $requestData); + $this->fail('Expected exception did not occur.'); + } catch (\Exception $e) { + if (TESTS_WEB_API_ADAPTER == self::ADAPTER_SOAP) { + $expectedException = new InputException(); + $expectedException->addError( + __( + InputException::REQUIRED_FIELD, + ['fieldName' => Address::FIRSTNAME] + ) + ); + $this->assertInstanceOf('SoapFault', $e); + $this->checkSoapFault( + $e, + $expectedException->getRawMessage(), + 'env:Sender', + $expectedException->getParameters() // expected error parameters + ); + } else { + $this->assertEquals(HTTPExceptionCodes::HTTP_BAD_REQUEST, $e->getCode()); + $exceptionData = $this->processRestExceptionResult($e); + $expectedExceptionData = [ + 'message' => InputException::REQUIRED_FIELD, + 'parameters' => ['fieldName' => Address::FIRSTNAME], + ]; + $this->assertEquals($expectedExceptionData, $exceptionData); + } + } + + try { + $this->customerRegistry->retrieveByEmail( + $customerDataArray[Customer::EMAIL], + $customerDataArray[Customer::WEBSITE_ID] + ); + $this->fail('An expected NoSuchEntityException was not thrown.'); + } catch (NoSuchEntityException $e) { + $exception = NoSuchEntityException::doubleField( + 'email', + $customerDataArray[Customer::EMAIL], + 'websiteId', + $customerDataArray[Customer::WEBSITE_ID] + ); + $this->assertEquals( + $exception->getMessage(), + $e->getMessage(), + 'Exception message does not match expected message.' + ); + } + } + /** * Test with a single filter */ diff --git a/dev/tests/functional/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist index 73fb370eb959..af11fffff29f 100644 --- a/dev/tests/functional/phpunit.xml.dist +++ b/dev/tests/functional/phpunit.xml.dist @@ -35,7 +35,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Version.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Version.php new file mode 100644 index 000000000000..a947cc6bfc5a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Version.php @@ -0,0 +1,28 @@ +_rootElement->find($this->backendVersion, Locator::SELECTOR_CLASS_NAME)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml index d0607947c23d..11fb3e5a15b8 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml @@ -15,5 +15,6 @@ + diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php index 033d0b6e87ed..a61d9f5d5ff0 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php @@ -9,6 +9,8 @@ use Magento\Mtf\Client\Element\SimpleElement; use Magento\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Bundle\Option; use Magento\Mtf\Client\Element; +use Magento\Mtf\Client\ElementInterface; +use Magento\Mtf\Client\Locator; use Magento\Ui\Test\Block\Adminhtml\Section; /** @@ -23,34 +25,47 @@ class Bundle extends Section */ protected $addNewOption = 'button[data-index="add_button"]'; + /** + * Bundle options locator. + * + * @var string + */ + protected $bundleOptions = './/*[@data-index="bundle_options"]/tbody'; + /** * Open option section. * * @var string */ - protected $openOption = '[data-index="bundle_options"] tbody tr:nth-child(%d) [data-role="collapsible-title"]'; + protected $openOption = './tr[%d]//*[@data-role="collapsible-title"]'; /** * Selector for option content. * * @var string */ - protected $optionContent = '[data-index="bundle_options"] tbody tr:nth-child(%d) [data-role="collapsible-content"]'; + protected $optionContent = './tr[%d]//*[@data-role="collapsible-content"]'; + + /** + * Locator for bundle option row. + * + * @var string + */ + protected $bundleOptionRow = './tr[%d]'; /** * Get bundle options block. * - * @param int $blockNumber + * @param int $rowNumber + * @param ElementInterface $element * @return Option */ - protected function getBundleOptionBlock($blockNumber) + private function getBundleOptionBlock($rowNumber, ElementInterface $element) { return $this->blockFactory->create( 'Magento\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Bundle\Option', [ - 'element' => $this->_rootElement->find( - sprintf('[data-index="bundle_options"] tbody tr:nth-child(%d)', $blockNumber) - ) + 'element' => $element->find(sprintf($this->bundleOptionRow, $rowNumber), Locator::SELECTOR_XPATH) ] ); } @@ -68,16 +83,17 @@ public function setFieldsData(array $fields, SimpleElement $element = null) if (!isset($fields['bundle_selections'])) { return $this; } + $context = $this->_rootElement->find($this->bundleOptions, Locator::SELECTOR_XPATH); foreach ($fields['bundle_selections']['value']['bundle_options'] as $key => $bundleOption) { $count = $key + 1; - $itemOption = $this->_rootElement->find(sprintf($this->openOption, $count)); - $isContent = $this->_rootElement->find(sprintf($this->optionContent, $count))->isVisible(); + $itemOption = $context->find(sprintf($this->openOption, $count), Locator::SELECTOR_XPATH); + $isContent = $context->find(sprintf($this->optionContent, $count), Locator::SELECTOR_XPATH)->isVisible(); if ($itemOption->isVisible() && !$isContent) { $itemOption->click(); } elseif (!$itemOption->isVisible()) { $this->_rootElement->find($this->addNewOption)->click(); } - $this->getBundleOptionBlock($count)->fillOption($bundleOption); + $this->getBundleOptionBlock($count, $context)->fillOption($bundleOption); } return $this; } @@ -96,15 +112,17 @@ public function getFieldsData($fields = null, SimpleElement $element = null) if (!isset($fields['bundle_selections'])) { return $this; } - $index = 0; + $index = 1; + $context = $this->_rootElement->find($this->bundleOptions, Locator::SELECTOR_XPATH); foreach ($fields['bundle_selections']['value']['bundle_options'] as $key => &$bundleOption) { - if (!$this->_rootElement->find(sprintf($this->optionContent, $key))->isVisible()) { - $this->_rootElement->find(sprintf($this->openOption, $index))->click(); + if (!$context->find(sprintf($this->optionContent, $index), Locator::SELECTOR_XPATH)->isVisible()) { + $context->find(sprintf($this->openOption, $index), Locator::SELECTOR_XPATH)->click(); } foreach ($bundleOption['assigned_products'] as &$product) { $product['data']['getProductName'] = $product['search_data']['name']; } - $newFields['bundle_selections'][$key] = $this->getBundleOptionBlock($key)->getOptionData($bundleOption); + $newFields['bundle_selections'][$key] = + $this->getBundleOptionBlock($index, $context)->getOptionData($bundleOption); $index++; } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle/Option.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle/Option.php index 1bc0c37a8bc6..18cafc9deea0 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle/Option.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle/Option.php @@ -27,7 +27,7 @@ class Option extends Form * * @var string */ - protected $selectionBlock = '[data-index="bundle_selections"] tbody tr:nth-child(%d)'; + protected $selectionBlock = '[data-index="bundle_selections"] > tbody > tr:nth-child(%d)'; /** * Selector for 'Add Products to Option' button. @@ -106,7 +106,7 @@ public function getOptionData(array $fields) $mapping = $this->dataMapping($fields); $newField = $this->_getData($mapping); foreach ($fields['assigned_products'] as $key => $field) { - $newField['assigned_products'][$key] = $this->getSelectionBlock($key + 1)->getProductRow($field['data']); + $newField['assigned_products'][$key] = $this->getSelectionBlock($key)->getProductRow($field['data']); } return $newField; } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/ProductForm.xml index 4d59da4bde45..955119b85a86 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/ProductForm.xml @@ -5,12 +5,8 @@ * See COPYING.txt for license details. */ --> - + - \Magento\Ui\Test\Block\Adminhtml\Section - [data-index='product-details'] - css selector - product select @@ -48,4 +44,4 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php index e5ab160bfc52..58ad7a349fb6 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php @@ -22,7 +22,7 @@ class AssertBundlePriceType extends AbstractConstraint * * @var string */ - protected $productPriceType = 'Dynamic'; + protected $productPriceType = 'Yes'; /** * Assert that displayed price for bundle items on shopping cart page equals to passed from fixture. @@ -79,7 +79,6 @@ protected function assertPrice( $cartItem = $checkoutCartView->getCartBlock()->getCartItem($product); $specialPrice = 0; - $optionPrice = []; $fillData = $product->getCheckoutData(); foreach ($fillData['options']['bundle_options'] as $key => $data) { @@ -91,7 +90,7 @@ protected function assertPrice( } } - $optionPrice[$key]['price'] = $this->productPriceType == 'Fixed' + $optionPrice[$key]['price'] = $this->productPriceType == 'No' ? number_format( $bundleData['bundle_selections']['bundle_options'][$key]['assigned_products'][$data['value']['key']] ['data']['selection_price_value'], diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml index 27cee0da9fca..ac63f1c2814c 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml @@ -34,8 +34,8 @@ - - + + @@ -80,7 +80,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/BundleProduct/Curl.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/BundleProduct/Curl.php index 8d8e6eaccff8..28fb86de9ffe 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/BundleProduct/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/BundleProduct/Curl.php @@ -32,16 +32,16 @@ public function __construct(DataInterface $configuration, EventManagerInterface 'No' => 0, ], 'sku_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, + 'Yes' => 0, + 'No' => 1, ], 'price_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, + 'Yes' => 0, + 'No' => 1, ], 'weight_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, + 'Yes' => 0, + 'No' => 1, ], 'shipment_type' => [ 'Together' => 0, diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml index 2a296ba503ce..3616e6be3c7d 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml @@ -11,8 +11,8 @@ Bundle dynamic product %isolation% bundle-dynamic-product-%isolation% sku_bundle_dynamic_product_%isolation% - Dynamic - Dynamic + Yes + Yes bundle_dynamic_with_category @@ -30,15 +30,15 @@ Bundle dynamic product %isolation% sku_bundle_dynamic_product_%isolation% - Dynamic - Dynamic + Yes + Yes default_dynamic In Stock - Dynamic + Yes Separately taxable_goods @@ -66,8 +66,8 @@ Bundle fixed product %isolation% sku_bundle_fixed_product_%isolation% - Fixed - Fixed + No + No 750 default_fixed @@ -79,8 +79,7 @@ In Stock 1 - Fixed - Yes + No Yes Together @@ -107,8 +106,8 @@ Bundle fixed product %isolation% bundle-fixed-product-%isolation% sku_bundle_fixed_product_%isolation% - Fixed - Fixed + No + No 100 @@ -116,8 +115,7 @@ taxable_goods 1 - Fixed - Yes + No Main Website @@ -133,8 +131,8 @@ Bundle dynamic product %isolation% bundle-dynamic-product-%isolation% sku_bundle_dynamic_product_%isolation% - Dynamic - Dynamic + Yes + Yes bundle_dynamic_with_category @@ -153,8 +151,8 @@ Bundle fixed product %isolation% bundle-fixed-product-%isolation% sku_bundle_fixed_product_%isolation% - Fixed - Fixed + No + No 100 @@ -162,8 +160,7 @@ taxable_goods 1 - Fixed - Yes + No Main Website @@ -179,8 +176,8 @@ Bundle fixed product %isolation% sku_bundle_fixed_product_%isolation% - Fixed - Fixed + No + No 100 fixed_100_dollar @@ -192,8 +189,7 @@ In Stock 1 - Fixed - Yes + No Yes Together diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.xml index 20b6f267ac86..1f241c1e321b 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.xml @@ -12,10 +12,10 @@ bundle_dynamic_product bundle-product-%isolation% bundle_dynamic_%isolation% - Fixed + No bundle_dynamic_%isolation% dynamic-100 - Fixed + No 1 Bundle Product Fixed Required Together @@ -35,10 +35,10 @@ bundle_fixed_product bundle-product-%isolation% bundle_fixed_%isolation% - Dynamic + Yes bundle_sku_%isolation% fixed-756 - Dynamic + Yes default_subcategory Separately default_fixed diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/AdvancedPricing.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/AdvancedPricing.php index 7f17c0602bb8..30be13bc8ba4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/AdvancedPricing.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/AdvancedPricing.php @@ -98,7 +98,7 @@ public function getFieldsData($fields = null, SimpleElement $element = null) */ public function getTierPriceForm(SimpleElement $element = null) { - $element = $element ?: $this->_rootElement->find($this->tierPrice); + $element = $element ?: $this->browser->find($this->advancedPricingRootElement); return $this->blockFactory->create( 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\AdvancedPricing\OptionTier', ['element' => $element] diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php index 56a3d4140539..02fd77bfae52 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php @@ -9,9 +9,11 @@ use Magento\Mtf\Client\Element\SimpleElement; use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Search\Grid; use Magento\Mtf\ObjectManager; +use Magento\Mtf\Client\ElementInterface; use Magento\Mtf\Client\Locator; use Magento\Ui\Test\Block\Adminhtml\Section; use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\AbstractOptions; +use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Row; /** * Product custom options section. @@ -23,14 +25,14 @@ class Options extends Section * * @var string */ - protected $customOptionRow = '//*[*[@class="fieldset-wrapper-title"]//span[.="%s"]]'; + protected $customOptionRow = './/*[*[@class="fieldset-wrapper-title"]//span[.="%s"]]'; /** - * New custom option row CSS locator. + * New custom option row locator. * * @var string */ - protected $newCustomOptionRow = '[data-index="custom_options"] [data-role="grid"] tbody tr:nth-child(%d)'; + protected $newCustomOptionRow = './/*[@data-index="options"]/tbody/tr[%d]'; /** * Add an option button. @@ -51,7 +53,35 @@ class Options extends Section * * @var string */ - protected $importGrid = ".product_form_product_form_custom_options_import_options_modal"; + protected $importGrid = ".product_form_product_form_import_options_modal"; + + /** + * Locator for 'Add Value' button. + * + * @var string + */ + protected $addValue = '[data-action="add_new_row"]'; + + /** + * Locator for dynamic data row. + * + * @var string + */ + protected $dynamicDataRow = '[data-index="values"] tbody tr:nth-child(%d)'; + + /** + * Locator for static data row. + * + * @var string + */ + protected $staticDataRow = '[data-index="container_type_static"] div:nth-child(%d)'; + + /** + * Sort rows data. + * + * @var array + */ + protected $sortRowsData = []; /** * Fill custom options form on tab. @@ -81,25 +111,16 @@ public function setFieldsData(array $fields, SimpleElement $element = null) unset($field['options']); } - $rootElement = $this->_rootElement->find(sprintf($this->newCustomOptionRow, $keyRoot + 1)); + $rootElement = $this->_rootElement->find( + sprintf($this->newCustomOptionRow, $keyRoot + 1), + Locator::SELECTOR_XPATH + ); $data = $this->dataMapping($field); $this->_fill($data, $rootElement); // Fill subform if (isset($field['type']) && !empty($options)) { - /** @var AbstractOptions $optionsForm */ - $optionsForm = $this->blockFactory->create( - __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($field['type']), - ['element' => $rootElement] - ); - - foreach ($options as $key => $option) { - ++$key; - $optionsForm->fillOptions( - $option, - $rootElement->find('[data-index="values"] tbody tr:nth-child(' . $key . ')') - ); - } + $this->setOptionTypeData($options, $field['type'], $rootElement); } } @@ -131,8 +152,85 @@ protected function getSearchGridBlock() { return $this->blockFactory->create( 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Search\Grid', - ['element' => $this->_rootElement->find($this->importGrid)] + ['element' => $this->browser->find($this->importGrid)] + ); + } + + /** + * Get select option row block. + * + * @param int $index + * @param SimpleElement $element + * @return Row + */ + private function getRowBlock($index, SimpleElement $element = null) + { + $element = $element ?: $this->_rootElement; + return $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Row', + ['element' => $element->find(sprintf($this->dynamicDataRow, ++$index))] + ); + } + + /** + * Set Option Type data. + * + * @param array $options + * @param string $type + * @param ElementInterface $element + * @return $this + */ + private function setOptionTypeData(array $options, $type, ElementInterface $element) + { + /** @var AbstractOptions $optionsForm */ + $optionsForm = $this->blockFactory->create( + __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($type), + ['element' => $element] ); + $context = $element->find($this->addValue)->isVisible() + ? $this->dynamicDataRow + : $this->staticDataRow; + foreach ($options as $key => $option) { + if (isset($option['sort_order'])) { + $currentSortOrder = (int)$option['sort_order']; + unset($option['sort_order']); + } else { + $currentSortOrder = 0; + } + $optionsForm->fillOptions( + $option, + $element->find(sprintf($context, $key + 1)) + ); + $this->sortOption($key, $currentSortOrder, $element); + } + $this->sortRowsData = []; + + return $this; + } + + /** + * Sort sample element. + * + * @param int $position + * @param int $sortOrder + * @param SimpleElement|null $element + * @return void + */ + private function sortOption($position, $sortOrder, SimpleElement $element = null) + { + $currentSortRowData = ['current_position_in_grid' => $position, 'sort_order' => $sortOrder]; + foreach ($this->sortRowsData as &$sortRowData) { + if ($sortRowData['sort_order'] > $currentSortRowData['sort_order']) { + // need to reload block because we are changing dom + $target = $this->getRowBlock($sortRowData['current_position_in_grid'], $element)->getSortHandle(); + $this->getRowBlock($currentSortRowData['current_position_in_grid'], $element)->dragAndDropTo($target); + + $currentSortRowData['current_position_in_grid']--; + $sortRowData['current_position_in_grid']++; + } + } + unset($sortRowData); + $this->sortRowsData[] = $currentSortRowData; } /** @@ -141,7 +239,6 @@ protected function getSearchGridBlock() * @param array|null $tabFields * @param SimpleElement|null $element * @return array - * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getFieldsData($tabFields = null, SimpleElement $element = null) @@ -172,18 +269,10 @@ public function getFieldsData($tabFields = null, SimpleElement $element = null) // Data collection subform if (isset($field['type']) && !empty($options)) { - /** @var AbstractOptions $optionsForm */ - $optionsForm = $this->blockFactory->create( - __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($field['type']), - ['element' => $rootElement] + $formDataItem = array_merge( + $formDataItem, + $this->getOptionTypeData($options, $field['type'], $rootElement) ); - - foreach ($options as $key => $option) { - $formDataItem['options'][$key++] = $optionsForm->getDataOptions( - $option, - $rootElement->find('.fieldset .data-table tbody tr:nth-child(' . $key . ')') - ); - } } $formData[$name][$keyRoot] = $formDataItem; } @@ -191,6 +280,42 @@ public function getFieldsData($tabFields = null, SimpleElement $element = null) return $formData; } + /** + * Get option type data. + * + * @param array $options + * @param string $type + * @param ElementInterface $element + * @return array + */ + private function getOptionTypeData(array $options, $type, ElementInterface $element) + { + $formDataItem = []; + /** @var AbstractOptions $optionsForm */ + $optionsForm = $this->blockFactory->create( + __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($type), + ['element' => $element] + ); + $context = $element->find($this->addValue)->isVisible() + ? $this->dynamicDataRow + : $this->staticDataRow; + foreach ($options as $key => $option) { + if (isset($option['sort_order'])) { + $currentSortOrder = (int)$option['sort_order']; + unset($option['sort_order']); + } + $formDataItem['options'][$key] = $optionsForm->getDataOptions( + $option, + $element->find(sprintf($context, $key + 1)) + ); + if (isset($currentSortOrder)) { + $formDataItem['options'][$key]['sort_order'] = $key; + } + } + + return $formDataItem; + } + /** * Prepare custom options with import options. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Row.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Row.php new file mode 100644 index 000000000000..8771ad2d7ee2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Row.php @@ -0,0 +1,43 @@ +getSortHandle()->dragAndDrop($target); + } + + /** + * Get sort handle. + * + * @return ElementInterface + */ + public function getSortHandle() + { + return $this->_rootElement->find($this->sortDraggableHandle); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Search/Grid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Search/Grid.php index 551987a8d1bf..e1f6a207a01a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Search/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Search/Grid.php @@ -6,30 +6,22 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Search; -use Magento\Backend\Test\Block\Widget\Grid as GridInterface; +use Magento\Ui\Test\Block\Adminhtml\DataGrid; /** - * Class Grid - * 'Import custom options to product' grid + * 'Import custom options to product' grid. */ -class Grid extends GridInterface +class Grid extends DataGrid { /** - * Selector for 'Import' button + * Selector for 'Import' button. * * @var string */ - protected $importProducts = '#import-custom-options-apply-button'; + protected $importProducts = '[data-role="action"]'; /** - * An element locator which allows to select entities in grid - * - * @var string - */ - protected $selectItem = 'tbody tr .col-id'; - - /** - * Filters param for grid + * Filters param for grid. * * @var array */ @@ -40,7 +32,7 @@ class Grid extends GridInterface ]; /** - * Press 'Import' button + * Press 'Import' button. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Type.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Type.php index 001062d64479..bdb56b3690a7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Type.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Type.php @@ -18,14 +18,14 @@ class Type extends OptgroupselectElement * * @var string */ - protected $optGroup = './/*/*/*/ul/li/div/label/span/ancestor::li/ul/li/div/label[text() = "%s"]'; + protected $optGroup = './/*[@data-role="option-group" and *//*[contains(.,"%s")]]//span'; /** * Option group locator. * * @var string */ - protected $optGroupValue = './/*/*/*/ul/li/div/label/span[text()="%s"]/ancestor::li/ul/li/div/label[text() = "%s"]'; + protected $optGroupValue = './/*[@data-role="option-group" and div[contains(.,"%s")]]//label[text()="%s"]'; /** * Locator for Advanced Select element @@ -34,6 +34,13 @@ class Type extends OptgroupselectElement */ protected $advancedSelect = '[data-role="advanced-select"]'; + /** + * Selector for selected option. + * + * @var string + */ + protected $selectedOption = '[data-role="selected-option"]'; + /** * Get element data. * @@ -42,7 +49,8 @@ class Type extends OptgroupselectElement */ protected function getData(ElementInterface $element) { - return trim($element->getValue(), chr(0xC2) . chr(0xA0)); + $this->find($this->advancedSelect)->click(); + return trim($element->getText()); } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php index ec0d9e59424a..9ad4c9ded9a7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php @@ -10,87 +10,51 @@ use Magento\Mtf\Client\Locator; /** - * Class AttributeSet - * Set and Get Attribute Set on the Product form + * Set and Get Attribute Set on the Product form. */ class AttributeSet extends SuggestElement { /** - * Attribute Set locator + * Attribute Set locator. * * @var string */ - protected $value = '.action-toggle > span'; + protected $attributeSet = './/div[text()="%s"]'; /** - * Attribute Set button + * Attribute Set value locator. * * @var string */ - protected $actionToggle = '.action-toggle'; + protected $attributeSetValue = '[data-role="selected-option"]'; /** - * Magento loader + * Selector item of search result. * * @var string */ - protected $loader = '[data-role="loader"]'; + protected $resultItem = './/label[contains(@class, "admin__action-multiselect-label")]/span[text() = "%s"]'; /** - * Page header selector. - * - * @var string - */ - protected $header = 'header'; - - /** - * Set value + * Set value. * * @param string $value * @return void */ public function setValue($value) { - if ($value !== $this->find($this->actionToggle)->getText()) { - $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $this->find($this->actionToggle)->click(); - $this->clear(); - if ($value == '') { - return; - } - foreach (str_split($value) as $symbol) { - $this->keys([$symbol]); - $searchedItem = $this->find(sprintf($this->resultItem, $value), Locator::SELECTOR_XPATH); - if ($searchedItem->isVisible()) { - try { - $searchedItem->hover(); - $this->driver->find($this->header)->hover(); - $searchedItem->click(); - break; - } catch (\Exception $e) { - // In parallel run on windows change the focus is lost on element - // that causes disappearing of category suggest list. - } - } - } + if (!$this->find(sprintf($this->attributeSet, $value), Locator::SELECTOR_XPATH)->isVisible()) { + parent::setValue($value); } - // Wait loader - $element = $this->driver; - $selector = $this->loader; - $element->waitUntil( - function () use ($element, $selector) { - return $element->find($selector)->isVisible() == false ? true : null; - } - ); } /** - * Get value + * Get value. * * @return string */ public function getValue() { - return $this->find($this->value)->getText(); + return $this->find($this->attributeSetValue)->getText(); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/FormPageActions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/FormPageActions.php index 0f659cd9fe96..3306bd4f870c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/FormPageActions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/FormPageActions.php @@ -11,49 +11,48 @@ use Magento\Mtf\Fixture\FixtureInterface; /** - * Class FormAction - * Form action + * Product Form page actions. */ class FormPageActions extends ParentFormPageActions { /** - * Save and create new product - 'Save & New' + * Save and create new product - 'Save & New'. */ - const SAVE_NEW = 'new'; + const SAVE_NEW = '0'; /** - * Save and create a duplicate product - 'Save & Duplicate' + * Save and create a duplicate product - 'Save & Duplicate'. */ - const SAVE_DUPLICATE = 'duplicate'; + const SAVE_DUPLICATE = '1'; /** - * Save and close the product page - 'Save & Close' + * Save and close the product page - 'Save & Close'. */ - const SAVE_CLOSE = 'close'; + const SAVE_CLOSE = '2'; /** - * CSS selector toggle "Save button" + * CSS selector toggle "Save button". * * @var string */ - protected $toggleButton = '[data-ui-id="page-actions-toolbar-save-split-button-dropdown"]'; + protected $toggleButton = '[data-ui-id="save-button-dropdown"]'; /** - * Save type item + * Save type item. * * @var string */ - protected $saveTypeItem = '#save-split-button-%s-button'; + protected $saveTypeItem = '[data-ui-id="save-button-item-%d"]'; /** - * "Save" button + * "Save" button. * * @var string */ - protected $saveButton = '#save-button'; + protected $saveButton = '[data-ui-id="save-button"]'; /** - * Click on "Save" button + * Click on "Save" button. * * @param FixtureInterface|null $product [optional] * @return void diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index 4cb1a57ea5d7..b0f2b27042b0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -43,7 +43,7 @@ class ProductForm extends FormSections * * @var string */ - protected $customSection = '.admin__collapsible-title'; + protected $customSection = '[data-index="%s"] .admin__collapsible-title'; /** * Attribute block selector. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml index b186c274e673..eb7766dcc327 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml @@ -7,7 +7,7 @@ --> - \Magento\Ui\Test\Block\Adminhtml\Section + \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails [data-index='product-details'] css selector product @@ -27,8 +27,7 @@ select - [data-role="weight-switcher"] - radiobutton + select [data-index='container_category_ids'] @@ -69,9 +68,9 @@ [name="product[special_from_date]"] - + [name="product[special_to_date]"] - + [name="product[cost]"] @@ -174,16 +173,6 @@ [data-index='schedule-design-update'] css selector - - \Magento\Ui\Test\Block\Adminhtml\Section - [data-index='gift-wrapping-gift-messaging'] - css selector - - - \Magento\Ui\Test\Block\Adminhtml\Section - [data-index='downloadable'] - css selector - \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options [data-index="custom_options"] @@ -205,6 +194,20 @@ + + \Magento\Ui\Test\Block\Adminhtml\Section + [data-index="gift-options"] + css selector + product + + + switcher + + + checkbox + + + \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Related [data-index="related"] diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php index 6eac5e6e454f..bff1ecae73bf 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php @@ -334,10 +334,13 @@ protected function getSelectOptionsData(SimpleElement $element, $firstOption = 1 $count = $firstOption; $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); + $index = 0; while ($selectOption->isVisible()) { - $listOptions[] = $this->parseOptionText($selectOption->getText()); + $listOptions[$index] = $this->parseOptionText($selectOption->getText()); + $listOptions[$index]['sort_order'] = $index; ++$count; $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); + $index++; } return [ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php index c73c8235edb0..e28008b2434f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php @@ -72,7 +72,7 @@ public function processAssert( ); if ($attributeSetOriginal === null) { - $productEdit->getProductForm()->openTab('product-details'); + $productEdit->getProductForm()->openSection('product-details'); \PHPUnit_Framework_Assert::assertTrue( $productEdit->getProductForm()->checkAttributeLabel($productAttribute), diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php index f296a383987d..1cf47c82a427 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php @@ -32,7 +32,6 @@ class AssertProductForm extends AbstractAssertForm * @var array */ protected $sortFields = [ - 'custom_options::title', 'cross_sell_products::id', 'up_sell_products::id', 'related_products::id', diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml index ccb185377b23..ef25f951e1f7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml @@ -76,7 +76,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml index d78a73513775..21ebd7a38946 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml @@ -74,6 +74,8 @@ + + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php index 216678461649..d35d31e34c57 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php @@ -69,8 +69,8 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface 'No' => 0 ], 'product_has_weight' => [ - 'Yes' => 1, - 'No' => 0, + 'This item has weight' => 1, + 'This item has no weight' => 0, ], 'use_config_enable_qty_increments' => [ 'Yes' => 1, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index 1268c944225a..6ca96f063ea9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -13,7 +13,7 @@ Simple Product %isolation% sku_simple_product_%isolation% - Yes + This item has weight 1 25 @@ -42,7 +42,7 @@ Product \'!@#$%^&*()+:;\\|}{][?=-~` %isolation% sku_simple_product_%isolation% No - Yes + This item has weight 1 25 @@ -74,7 +74,7 @@ 25 In Stock - Yes + This item has weight 1 560 @@ -98,7 +98,7 @@ product_10_dollar %isolation% sku_product_10_dollar_%isolation% - Yes + This item has weight 1 1000 @@ -126,7 +126,7 @@ product_20_dollar %isolation% sku_product_20_dollar_%isolation% - Yes + This item has weight 1 1000 @@ -148,7 +148,7 @@ Simple Product %isolation% sku_simple_product_%isolation% - Yes + This item has weight 1 25 @@ -173,7 +173,7 @@ Simple Product %isolation% sku_simple_product_%isolation% - Yes + This item has weight 1 1000 @@ -201,7 +201,7 @@ Simple Product %isolation% sku_simple_product_%isolation% - Yes + This item has weight 1 25 @@ -230,7 +230,7 @@ 666.0000 In Stock - Yes + This item has weight 1 default @@ -255,7 +255,7 @@ 666 In Stock - Yes + This item has weight 1 default @@ -280,7 +280,7 @@ 666 In Stock - Yes + This item has weight 1 100 @@ -303,7 +303,7 @@ 666 In Stock - Yes + This item has weight 1 default @@ -326,7 +326,7 @@ Simple product without category %isolation% simple-product-%isolation% simple_product_without_category_%isolation% - Yes + This item has weight 1 default @@ -358,7 +358,7 @@ 100 - Yes + This item has weight 100 Main Website @@ -385,7 +385,7 @@ 111 In Stock - Yes + This item has weight 1 Yes @@ -410,7 +410,7 @@ 50 - Yes + This item has weight 50 52 @@ -431,7 +431,7 @@ default - Yes + This item has weight 1 100 @@ -457,7 +457,7 @@ default - Yes + This item has weight 1 10 @@ -490,7 +490,7 @@ 666 In Stock - Yes + This item has weight 1 <p>dfj_full</p> Yes @@ -514,7 +514,7 @@ 666 In Stock - Yes + This item has weight 0.1 <p>Simple with Weight 0.1</p> Yes @@ -538,7 +538,7 @@ 666 In Stock - Yes + This item has weight 150.1 <p>Simple with Weight 150.1</p> Yes @@ -562,7 +562,7 @@ 666 In Stock - Yes + This item has weight 1 <p>adc_Full</p> Yes @@ -584,7 +584,7 @@ 25 In Stock - Yes + This item has weight 1 100 @@ -604,7 +604,7 @@ 100 - Yes + This item has weight 1 99 @@ -623,7 +623,7 @@ 300 - Yes + This item has weight 1 34 @@ -644,7 +644,7 @@ 300 - Yes + This item has weight 1 85 @@ -671,7 +671,7 @@ 300 - Yes + This item has weight 1 23 @@ -698,7 +698,7 @@ 300 - Yes + This item has weight 1 842 @@ -728,7 +728,7 @@ 300 - Yes + This item has weight 1 953 @@ -751,7 +751,7 @@ No 2 - Yes + This item has weight 1 default @@ -771,7 +771,7 @@ Simple Product out of stock %isolation% sku_simple_product_out_of_stock%isolation% - Yes + This item has weight 1 25 @@ -799,7 +799,7 @@ Simple Product offline %isolation% sku_simple_product_offline_%isolation% - Yes + This item has weight 1 25 @@ -828,7 +828,7 @@ Simple Product not visible %isolation% sku_simple_product_not_visible_%isolation% - Yes + This item has weight 1 25 @@ -856,7 +856,7 @@ Simple Product with cart limit %isolation% sku_simple_product_with_cart_limit_%isolation% - Yes + This item has weight 1 25 @@ -893,7 +893,7 @@ 300 - Yes + This item has weight 1 63 @@ -917,7 +917,7 @@ Simple Product with qty increments %isolation% sku_simple_product_with_qty_increments_%isolation% - Yes + This item has weight 1 25 @@ -954,7 +954,7 @@ 300 - Yes + This item has weight 1 25 @@ -976,7 +976,7 @@ 666 In Stock - Yes + This item has weight 1 default @@ -1013,7 +1013,7 @@ 70 - Yes + This item has weight 1 954 @@ -1054,7 +1054,7 @@ In Stock 100 - Yes + This item has weight 1 simple-product-%isolation% @@ -1069,7 +1069,7 @@ Simple Product %isolation% sku_simple_product_%isolation% simple-product-%isolation% - Yes + This item has weight 1 1000 diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml index 3430a8e435ca..2b826e84b8e1 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml @@ -18,6 +18,7 @@ 10 Percent sku_drop_down_row_1 + 0 @@ -31,6 +32,7 @@ 20 Percent sku_drop_down_row_2 + 0 @@ -47,12 +49,14 @@ 10 Percent sku_drop_down_row_1 + 0 20 percent 20 Percent sku_drop_down_row_2 + 1 @@ -82,6 +86,7 @@ 30 Fixed sku_drop_down_row_1 + 0 @@ -98,6 +103,7 @@ 40 Percent sku_drop_down_row_1 + 0 @@ -140,12 +146,14 @@ 110.01 Percent Percent + 0 Test3-2 %isolation% 210.02 Fixed sku3_%isolation% + 1 @@ -159,12 +167,14 @@ 10.01 Percent sku2_%isolation% + 0 Test4-2 %isolation% 20.02 Fixed sku3_%isolation% + 1 @@ -222,18 +232,21 @@ 10 Percent sku_drop_down_row_1_%isolation% + 0 20 percent 20 Percent sku_drop_down_row_2_%isolation% + 1 30 fixed 30 Fixed sku_drop_down_row_3_%isolation% + 2 @@ -273,6 +286,7 @@ 20 Fixed sku_multiple_select_row%isolation% + 0 diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php index 5d80d91eeaad..6b7aa9b8c902 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/NavigateRelatedProductsTest.php @@ -70,7 +70,7 @@ public function test( $productsToVerify, CheckoutCart $checkoutCart ) { - $this->markTestIncomplete('MAGETWO-48732'); + $this->markTestIncomplete('MAGETWO-50178'); // Preconditions $this->createProducts($products); $this->assignPromotedProducts($promotedProducts, 'related_products'); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php index 977d54bb7615..4b99c2bb8940 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php @@ -127,9 +127,9 @@ protected function performAction($actionName) */ protected function deleteVariations() { - $this->catalogProductEdit->getProductForm()->openTab('variations'); + $this->catalogProductEdit->getProductForm()->openSection('variations'); /** @var Config $variationsTab */ - $variationsTab = $this->catalogProductEdit->getProductForm()->getTab('variations'); + $variationsTab = $this->catalogProductEdit->getProductForm()->getSection('variations'); $variationsTab->deleteVariations(); } @@ -140,9 +140,9 @@ protected function deleteVariations() */ protected function clearDownloadableData() { - $this->catalogProductEdit->getProductForm()->openTab('downloadable_information'); + $this->catalogProductEdit->getProductForm()->openSection('downloadable_information'); /** @var Downloadable $downloadableInfoTab */ - $downloadableInfoTab = $this->catalogProductEdit->getProductForm()->getTab('downloadable_information'); + $downloadableInfoTab = $this->catalogProductEdit->getProductForm()->getSection('downloadable_information'); $downloadableInfoTab->getDownloadableBlock('Links')->clearDownloadableData(); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml index 223804d2fab9..323246949d1a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml @@ -13,7 +13,7 @@ Test simple product %isolation% test_simple_product_%isolation% 245.00 - 200.0000 + 200 test-simple-product-%isolation% 120.0000 Catalog, Search @@ -29,7 +29,7 @@ Test simple product %isolation% test_simple_product_%isolation% 325.00 - 123.0000 + 123 test-simple-product-%isolation% 129.0000 Not Visible Individually @@ -43,7 +43,7 @@ Test simple product %isolation% test_simple_product_%isolation% 325.01 - 125.0000 + 125 test-simple-product-%isolation% 25.0000 Catalog @@ -60,7 +60,7 @@ Test simple product %isolation% test_simple_product_%isolation% 325.02 - 89.0000 + 89 test-simple-product-%isolation% 89.0000 Search @@ -77,7 +77,7 @@ Test simple product %isolation% test_simple_product_%isolation% 325.03 - 25.0000 + 25 Out of Stock test-simple-product-%isolation% 125.0000 @@ -94,7 +94,7 @@ Test simple product %isolation% test_simple_product_%isolation% 74.00 - 87.0000 + 87 test-simple-product-%isolation% 333.0000 No @@ -109,7 +109,7 @@ Test simple product %isolation% test_simple_product_%isolation% 74.00 - 87.0000 + 87 test-simple-product-%isolation% 333.0000 diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml index 920f65e876a0..5e37a68dedca 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml @@ -13,7 +13,6 @@ 99.99 None 999 - No default_subcategory MAGETWO-23002 In Stock @@ -34,7 +33,6 @@ 120.00 taxable_goods 999 - No 45 In Stock Catalog, Search @@ -54,7 +52,6 @@ 185.00 None 999 - No default_subcategory MAGETWO-23002 Out of Stock @@ -74,7 +71,6 @@ virtual_sku_%isolation% 99.99 taxable_goods - No Out of Stock Search virtual-product-%isolation% @@ -90,7 +86,6 @@ virtual_sku_%isolation% 5.00 None - No Out of Stock Catalog virtual-product-%isolation% @@ -107,7 +102,6 @@ 145.00 taxable_goods 999 - No default_subcategory MAGETWO-23002 In Stock @@ -126,7 +120,6 @@ virtual_sku_%isolation% 99.99 None - No default_subcategory 45 Out of Stock @@ -145,7 +138,6 @@ 5.00 taxable_goods Yes - No Out of Stock Search virtual-product-%isolation% @@ -162,7 +154,6 @@ 120.00 None 999 - No default_subcategory In Stock options_suite @@ -181,7 +172,6 @@ virtual_sku_%isolation% 99.99 taxable_goods - No Out of Stock Catalog, Search virtual-product-%isolation% @@ -198,7 +188,6 @@ 99.99 None 999 - No default_subcategory MAGETWO-23002 In Stock diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Section/RuleInformation.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Section/RuleInformation.php index 90cc235dbe81..e006d5e77faf 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Section/RuleInformation.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Section/RuleInformation.php @@ -18,7 +18,7 @@ class RuleInformation extends Section * * @var string */ - protected $customerGroup = '#rule_customer_group_ids'; + protected $customerGroup = '[name=customer_group_ids]'; /** * Check whether Customer Group is visible. diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.xml index 1c93ea5b19e8..7d13ef869364 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.xml @@ -8,7 +8,7 @@ \Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Variations\Config - #product_info_tabs_product-details + [data-index='product-details'] css selector diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml index a173bf86126e..06aec3acbf65 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml @@ -71,7 +71,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml index d5dc690aa234..146a78a9d281 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml @@ -14,7 +14,7 @@ 40 price_40 - Yes + This item has weight 30 Yes Catalog, Search @@ -45,7 +45,7 @@ price_40 - Yes + This item has weight 30 Yes Catalog, Search @@ -77,7 +77,7 @@ 10 9 - Yes + This item has weight 5 Yes Catalog, Search @@ -105,7 +105,7 @@ Test configurable product with size %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -133,7 +133,7 @@ Test configurable product with color and size %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -161,7 +161,7 @@ Test configurable product %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -190,7 +190,7 @@ 40 price_40 - Yes + This item has weight 30 Yes Catalog, Search @@ -215,7 +215,7 @@ Test configurable product %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -243,7 +243,7 @@ Test configurable product %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -272,7 +272,7 @@ taxable_goods - Yes + This item has weight 1 1 @@ -302,7 +302,7 @@ taxable_goods - Yes + This item has weight 1 Main Website @@ -321,7 +321,7 @@ Test configurable product %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 1 Yes Catalog, Search @@ -351,7 +351,7 @@ taxable_goods - Yes + This item has weight 1 1 diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php index d7e538c6a039..dd7ca68f9b6f 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.php @@ -79,7 +79,7 @@ public function __inject(CatalogProductIndex $productIndex, CatalogProductNew $p */ public function test(ConfigurableProduct $product) { - $this->markTestIncomplete('MAGETWO-48724'); + $this->markTestIncomplete('MAGETWO-50179'); // Steps $this->productIndex->open(); $this->productIndex->getGridPageActionBlock()->addProduct('configurable'); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php index df0bf483deab..615a6d31ded4 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php @@ -8,7 +8,7 @@ use Magento\Customer\Test\Fixture\CustomerGroup; use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\SalesRule\Test\Block\Adminhtml\Promo\Quote\Edit\Tab\RuleInformation; +use Magento\SalesRule\Test\Block\Adminhtml\Promo\Quote\Edit\Section\RuleInformation; use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteIndex; use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteNew; @@ -32,10 +32,10 @@ public function processAssert( ) { $promoQuoteIndex->open(); $promoQuoteIndex->getGridPageActions()->addNew(); - $promoQuoteNew->getSalesRuleForm()->openTab('rule_information'); + $promoQuoteNew->getSalesRuleForm()->openSection('rule_information'); /** @var RuleInformation $ruleInformationTab */ - $ruleInformationTab = $promoQuoteNew->getSalesRuleForm()->getTab('rule_information'); + $ruleInformationTab = $promoQuoteNew->getSalesRuleForm()->getSection('rule_information'); \PHPUnit_Framework_Assert::assertTrue( $ruleInformationTab->isVisibleCustomerGroup($customerGroup), "Customer group {$customerGroup->getCustomerGroupCode()} not in cart price rule page." diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php index 018931004184..24a5d260fcba 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php @@ -32,7 +32,7 @@ public function processAssert( ) { $catalogRuleIndex->open(); $catalogRuleIndex->getGridPageActions()->addNew(); - $catalogRuleNew->getEditForm()->openTab('rule_information'); + $catalogRuleNew->getEditForm()->openSection('rule_information'); /** @var RuleInformation $ruleInformationSection */ $ruleInformationSection = $catalogRuleNew->getEditForm()->getSection('rule_information'); diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php index b5f5c0186154..37431c7878e3 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php @@ -74,6 +74,8 @@ public function __inject( $this->fixtureFactory = $fixtureFactory; $this->customerIndexPage = $customerIndexPage; $this->customerIndexEditPage = $customerIndexEditPage; + $customerIndexPage->open(); + $customerIndexPage->getCustomerGridBlock()->massaction([], 'Delete', true, 'Select All'); } /** diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable.php index fe51fef90ee6..e938eb2dbf15 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable.php @@ -30,7 +30,14 @@ class Downloadable extends Section * * @var string */ - protected $downloadableBlock = '[data-index="downloadable"] > div > fieldset'; + protected $downloadableBlock = '[data-index="container_%s"]'; + + /** + * Locator for is downloadable product checkbox. + * + * @var string + */ + protected $isDownloadableProduct = '[name="is_downloadable"]'; /** * Get Downloadable block. @@ -44,7 +51,7 @@ public function getDownloadableBlock($type, SimpleElement $element = null) $element = $element ?: $this->_rootElement; return $this->blockFactory->create( 'Magento\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Downloadable\\' . $type, - ['element' => $element->find($this->downloadableBlock, Locator::SELECTOR_CSS)] + ['element' => $element->find(sprintf($this->downloadableBlock, strtolower($type)), Locator::SELECTOR_CSS)] ); } @@ -78,11 +85,15 @@ public function getFieldsData($fields = null, SimpleElement $element = null) * * @param array $fields * @param SimpleElement|null $element - * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @return $this */ public function setFieldsData(array $fields, SimpleElement $element = null) { + $context = $element ?: $this->_rootElement; + $isDownloadable = $context->find($this->isDownloadableProduct); + if ($isDownloadable->isVisible()) { + $isDownloadable->click(); + } if (isset($fields['downloadable_sample']['value'])) { $this->getDownloadableBlock('Samples')->fillSamples($fields['downloadable_sample']['value']); } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable/Links.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable/Links.php index ff5cd2dd8e8a..ef654e9d4311 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable/Links.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable/Links.php @@ -127,7 +127,6 @@ public function clearDownloadableData() while ($this->_rootElement->find(sprintf($this->rowBlock, $index))->isVisible()) { $rowBlock = $this->getRowBlock($index - 1); $rowBlock->clickDeleteButton(); - ++$index; } } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml index cd5791d733b9..8fe7795d5e6f 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml @@ -5,10 +5,10 @@ * See COPYING.txt for license details. */ --> - + \Magento\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Downloadable [data-index="downloadable"] css selector - + diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml index 366d57bc9d3e..915dd3c0f0e9 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml @@ -81,10 +81,11 @@ - - + + + diff --git a/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml index 1fb04e34c4f1..768a3f59de37 100644 --- a/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml @@ -14,7 +14,7 @@ Simple Product with msrp %isolation% sku_simple_product_with_msrp_%isolation% 1 - Yes + This item has weight 25 In Stock @@ -42,7 +42,7 @@ simple-product-with-msrp-%isolation% sku_simple_product_with_msrp_%isolation% 1 - Yes + This item has weight 1000 In Stock diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/Edit/Tab/ImagesAndVideos.php b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/Edit/Tab/ImagesAndVideos.php index 52c606e8e2bd..d97b2c75473d 100755 --- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/Edit/Tab/ImagesAndVideos.php +++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/Edit/Tab/ImagesAndVideos.php @@ -8,7 +8,6 @@ use Magento\Backend\Test\Block\Widget\Tab; use Magento\Mtf\Client\Element\SimpleElement; -use Magento\Mtf\Client\Locator; /** * Product images tab. @@ -20,7 +19,7 @@ class ImagesAndVideos extends Tab * * @var string */ - protected $addVideoButton = '#product_info_tabs_image-management_content #add_video_button'; + protected $addVideoButton = '[data-role="add-video-button"]'; /** * Video dialog CSS locator. diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml index 1d77289ccba3..e530d9539cb5 100755 --- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml @@ -5,10 +5,10 @@ * See COPYING.txt for license details. */ --> - + \Magento\ProductVideo\Test\Block\Adminhtml\Product\Edit\Tab\ImagesAndVideos - #product_info_tabs_image-management + [data-index="block_gallery"] css selector @@ -26,4 +26,4 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Constraint/AssertGetVideoInfoDataIsCorrect.php b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Constraint/AssertGetVideoInfoDataIsCorrect.php index c7e259ac05c2..b38d77c1a7fb 100755 --- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Constraint/AssertGetVideoInfoDataIsCorrect.php +++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Constraint/AssertGetVideoInfoDataIsCorrect.php @@ -30,8 +30,8 @@ public function processAssert( ) { $editProductPage->open(['id' => $initialProduct->getId()]); - $editProductPage->getProductForm()->openTab('images-and-videos'); - $imagesTab = $editProductPage->getProductForm()->getTab('images-and-videos'); + $editProductPage->getProductForm()->openSection('images-and-videos'); + $imagesTab = $editProductPage->getProductForm()->getSection('images-and-videos'); $result = $imagesTab->clickFirstVideo()->getVideoDialog()->validate($video); \PHPUnit_Framework_Assert::assertTrue( diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php index 73a02ef1d4d0..42e2dee9c7ee 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php @@ -6,13 +6,30 @@ namespace Magento\Review\Test\Block\Adminhtml\Customer\Edit\Tab; -use Magento\Review\Test\Block\Adminhtml\ReviewsTab; +use Magento\Backend\Test\Block\Widget\Tab; /** - * Class Reviews - * Reviews tab on customer edit page + * Reviews tab on customer edit page. */ -class Reviews extends ReviewsTab +class Reviews extends Tab { - // + /** + * Product reviews block selector. + * + * @var string + */ + protected $reviews = '#reviwGrid'; + + /** + * Returns product reviews grid. + * + * @return \Magento\Review\Test\Block\Adminhtml\Grid + */ + public function getReviewsGrid() + { + return $this->blockFactory->create( + 'Magento\Review\Test\Block\Adminhtml\Grid', + ['element' => $this->_rootElement->find($this->reviews)] + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Section/Reviews.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Section/Reviews.php new file mode 100644 index 000000000000..c1c17679a966 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Section/Reviews.php @@ -0,0 +1,35 @@ +blockFactory->create( + 'Magento\Review\Test\Block\Adminhtml\Product\Grid', + ['element' => $this->_rootElement->find($this->reviews)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Tab/Reviews.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Tab/Reviews.php deleted file mode 100644 index 2782c9dcbe2e..000000000000 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Tab/Reviews.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'selector' => 'input[name="entity_id"]', + 'title' => [ + 'selector' => 'input[name="title"]', ], - 'name' => [ - 'selector' => 'input[name="name"]', + 'sku' => [ + 'selector' => 'input[name="sku"]', ], ]; - - /** - * Locator value for link in action column - * - * @var string - */ - protected $editLink = '.col-entity_id'; } diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml index b7ec519c941e..dfc374eaa36b 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml @@ -5,10 +5,10 @@ * See COPYING.txt for license details. */ --> - + - \Magento\Review\Test\Block\Adminhtml\Product\Edit\Tab\Reviews - #product_info_tabs_product-reviews + \Magento\Review\Test\Block\Adminhtml\Product\Edit\Section\Reviews + [data-index="review"] css selector - + diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php deleted file mode 100644 index 81ddac08bf53..000000000000 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php +++ /dev/null @@ -1,36 +0,0 @@ -blockFactory->create( - 'Magento\Review\Test\Block\Adminhtml\Grid', - ['element' => $this->_rootElement->find($this->reviews)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php index d740714b79e5..f67c3b27d776 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php @@ -134,12 +134,12 @@ public function test(Review $review, $rating) ['product' => $product] )->run(); - $this->catalogProductEdit->getProductForm()->openTab('product_reviews'); + $this->catalogProductEdit->getProductForm()->openSection('product_reviews'); $filter = [ 'title' => $this->reviewInitial->getTitle(), 'sku' => $product->getSku(), ]; - $this->catalogProductEdit->getProductForm()->getTab('product_reviews')->getReviewsGrid() + $this->catalogProductEdit->getProductForm()->getSection('product_reviews')->getReviewsGrid() ->searchAndOpen($filter); $this->reviewEdit->getReviewForm()->fill($review); $this->reviewEdit->getPageActions()->save(); diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Section/RuleInformation.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Section/RuleInformation.php index 1720b67a7fdb..23d47a638458 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Section/RuleInformation.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Section/RuleInformation.php @@ -20,7 +20,7 @@ class RuleInformation extends Section * * @var string */ - protected $customerGroup = '#rule_customer_group_ids'; + protected $customerGroup = '[name=customer_group_ids]'; /** * Get data of section. diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php index 8b1a3abffe2d..4418882a8b30 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php @@ -72,7 +72,6 @@ public function __inject(StoreIndex $storeIndex, StoreNew $storeNew) */ public function test(Store $store) { - $this->markTestIncomplete('MAGETWO-48723'); //Steps: $this->storeIndex->open(); $this->storeIndex->getGridPageActions()->addStoreView(); diff --git a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php index e5f0f9299909..50c79987b8c0 100644 --- a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php +++ b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php @@ -238,6 +238,23 @@ public function searchAndOpen(array $filter) } } + /** + * Search item and select it. + * + * @param array $filter + * @throws \Exception + */ + public function searchAndSelect(array $filter) + { + $this->search($filter); + $rowItem = $this->getRow($filter); + if ($rowItem->isVisible()) { + $rowItem->find($this->selectItem)->click(); + } else { + throw new \Exception('Searched item was not found.'); + } + } + /** * Perform selected massaction over checked items. * diff --git a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php index 19cdbbb8214d..2bf428feff8e 100644 --- a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php +++ b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php @@ -114,7 +114,7 @@ public function isCollapsible($sectionName) * @param string $sectionName * @return bool */ - public function isCollapsed($sectionName) + private function isCollapsed($sectionName) { return $this->getContainerElement($sectionName)->find($this->opened)->isVisible(); } diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Authentication.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Authentication.php new file mode 100644 index 000000000000..e2df872d068d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Authentication.php @@ -0,0 +1,55 @@ +_rootElement->find($this->save, Locator::SELECTOR_CSS)->click(); + } + + /** + * Ensure the form is loaded and fill the root form + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $this->waitForElementVisible($this->firstField); + return parent::fill($fixture, $element); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Authentication.xml b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Authentication.xml new file mode 100644 index 000000000000..3958a86df320 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Authentication.xml @@ -0,0 +1,17 @@ + + + + + + [name='username'] + + + [name='password'] + + + diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/CreateBackup.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/CreateBackup.php new file mode 100644 index 000000000000..153acde0b9a2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/CreateBackup.php @@ -0,0 +1,35 @@ +_rootElement->find($this->startUpdate, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/CreateBackup.xml b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/CreateBackup.xml new file mode 100644 index 000000000000..6085acc0a158 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/CreateBackup.xml @@ -0,0 +1,23 @@ + + + + + + #optionsCode + checkbox + + + #optionsMedia + checkbox + + + #optionsDb + checkbox + + + diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Home.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Home.php new file mode 100644 index 000000000000..d6ed4095f659 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Home.php @@ -0,0 +1,31 @@ +_rootElement->find($this->systemUpgrade, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Readiness.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Readiness.php new file mode 100644 index 000000000000..28890268f853 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/Readiness.php @@ -0,0 +1,160 @@ +_rootElement->find($this->readinessCheck, Locator::SELECTOR_CSS)->click(); + $this->waitForElementVisible($this->completedMessage, Locator::SELECTOR_CSS); + } + + /** + * Click on 'Next' button. + * + * @return void + */ + public function clickNext() + { + $this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } + + /** + * Get Updater application check result. + * + * @return string + */ + public function getUpdaterApplicationCheck() + { + return $this->_rootElement->find($this->updaterApplicationCheck, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get cron script check result. + * + * @return string + */ + public function getCronScriptCheck() + { + return $this->_rootElement->find($this->cronScriptCheck, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get dependency check result. + * + * @return string + */ + public function getDependencyCheck() + { + return $this->_rootElement->find($this->dependencyCheck, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get PHP Version check result. + * + * @return string + */ + public function getPhpVersionCheck() + { + return $this->_rootElement->find($this->phpVersionCheck, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get setting check result. + * + * @return string + */ + public function getSettingsCheck() + { + return $this->_rootElement->find($this->phpSettingsCheck, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get PHP Extensions check result. + * + * @return string + */ + public function getPhpExtensionsCheck() + { + return $this->_rootElement->find($this->phpExtensionCheck, Locator::SELECTOR_CSS)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.php new file mode 100644 index 000000000000..9322b3dcb33c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.php @@ -0,0 +1,55 @@ +_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } + + /** + * Ensure the form is loaded and fill the root form + * + * @param FixtureInterface $fixture + * @param SimpleElement|null $element + * @return $this + */ + public function fill(FixtureInterface $fixture, SimpleElement $element = null) + { + $this->waitForElementVisible($this->firstField); + return parent::fill($fixture, $element); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.xml b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.xml new file mode 100644 index 000000000000..94b784b8d1b8 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.xml @@ -0,0 +1,15 @@ + + + + + + #selectVersion + select + + + diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SuccessMessage.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SuccessMessage.php new file mode 100644 index 000000000000..b8a46e1f5292 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SuccessMessage.php @@ -0,0 +1,30 @@ +waitForElementVisible($this->successMessage, Locator::SELECTOR_CLASS_NAME); + return $this->_rootElement->find($this->successMessage, Locator::SELECTOR_CLASS_NAME)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SystemConfig.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SystemConfig.php new file mode 100644 index 000000000000..589fa1f9e2b2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SystemConfig.php @@ -0,0 +1,31 @@ +_rootElement->find($this->systemConfig, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SystemUpgrade.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SystemUpgrade.php new file mode 100644 index 000000000000..8d9cd7708e5f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SystemUpgrade.php @@ -0,0 +1,48 @@ +_rootElement->find($this->systemUpgradeMessage, Locator::SELECTOR_NAME)->getText(); + } + + /** + * Click on 'Upgrade' button. + * + * @return void + */ + public function clickSystemUpgrade() + { + $this->_rootElement->find($this->upgrade, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertApplicationVersion.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertApplicationVersion.php new file mode 100644 index 000000000000..610d1ef68443 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertApplicationVersion.php @@ -0,0 +1,43 @@ +getApplicationVersion()->getVersion(), + 'Application version is incorrect.' + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "Application new version is correct."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertSuccessMessage.php new file mode 100644 index 000000000000..c77e2a0b18d1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertSuccessMessage.php @@ -0,0 +1,48 @@ +getSuccessMessage()->getUpdaterStatus(), + 'Success message is incorrect.' + ); + \PHPUnit_Framework_Assert::assertContains( + $package, + $setupWizard->getSuccessMessage()->getUpdaterStatus(), + 'Updated package is incorrect.' + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "System Upgrade success message is correct."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertSuccessfulReadinessCheck.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertSuccessfulReadinessCheck.php new file mode 100644 index 000000000000..7befbc1cf8b4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertSuccessfulReadinessCheck.php @@ -0,0 +1,96 @@ +getReadiness()->getUpdaterApplicationCheck(), + 'Updater application check is incorrect.' + ); + \PHPUnit_Framework_Assert::assertContains( + self::CRON_SCRIPT_MESSAGE, + $setupWizard->getReadiness()->getCronScriptCheck(), + 'Cron scripts are incorrect.' + ); + \PHPUnit_Framework_Assert::assertContains( + self::DEPENDENCY_CHECK_MESSAGE, + $setupWizard->getReadiness()->getDependencyCheck(), + 'Dependency check is incorrect.' + ); + \PHPUnit_Framework_Assert::assertContains( + self::PHP_VERSION_MESSAGE, + $setupWizard->getReadiness()->getPhpVersionCheck(), + 'PHP version is incorrect.' + ); + \PHPUnit_Framework_Assert::assertContains( + self::PHP_SETTING_REGEXP, + $setupWizard->getReadiness()->getSettingsCheck(), + 'PHP settings check failed.' + ); + \PHPUnit_Framework_Assert::assertRegExp( + self::PHP_EXTENSIONS_REGEXP, + $setupWizard->getReadiness()->getPhpExtensionsCheck(), + 'PHP extensions missed.' + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "System Upgrade readiness check passed."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertVersionAndEditionCheck.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertVersionAndEditionCheck.php new file mode 100644 index 000000000000..51e6a81d50a7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Constraint/AssertVersionAndEditionCheck.php @@ -0,0 +1,44 @@ +getSystemUpgrade()->getUpgradeMessage(), + 'Updater application check is incorrect.' + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "System Upgrade edition and version check passed."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Fixture/Upgrade.xml b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Fixture/Upgrade.xml new file mode 100644 index 000000000000..c209c4d5d8b2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Fixture/Upgrade.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Page/Adminhtml/SetupWizard.xml b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Page/Adminhtml/SetupWizard.xml new file mode 100644 index 000000000000..534cc1db14db --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Page/Adminhtml/SetupWizard.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php new file mode 100644 index 000000000000..f1b53a9e9547 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php @@ -0,0 +1,118 @@ +adminDashboard = $adminDashboard; + $this->setupWizard = $setupWizard; + } + + /** + * @param FixtureFactory $fixtureFactory + * @param AssertSuccessfulReadinessCheck $assertReadiness + * @param AssertVersionAndEditionCheck $assertVersionAndEdition + * @param AssertSuccessMessage $assertSuccessMessage + * @param AssertApplicationVersion $assertApplicationVersion + * @param array $upgrade + * @return void + */ + public function test( + FixtureFactory $fixtureFactory, + AssertSuccessfulReadinessCheck $assertReadiness, + AssertVersionAndEditionCheck $assertVersionAndEdition, + AssertSuccessMessage $assertSuccessMessage, + AssertApplicationVersion $assertApplicationVersion, + $upgrade = [] + ) { + // Create fixture + $upgradeFixture = $fixtureFactory->create('Magento\Upgrade\Test\Fixture\Upgrade', ['data' => $upgrade]); + $createBackupConfig = array_intersect_key( + $upgrade, + ['optionsCode' => '', 'optionsMedia' => '', 'optionsDb' => ''] + ); + $createBackupFixture = $fixtureFactory->create( + 'Magento\Upgrade\Test\Fixture\Upgrade', + ['data' => $createBackupConfig] + ); + $version = $upgrade['upgradeVersion']; + + if (preg_match('/^[0-9].[0-9].[0-9]/', $version, $out)) { + $version = array_shift($out); + } + + // Authenticate in admin area + $this->adminDashboard->open(); + + // Open Web Setup Wizard + $this->setupWizard->open(); + + // Authenticate on repo.magento.com + if ($upgrade['needAuthentication'] === 'Yes') { + $this->setupWizard->getSystemConfig()->clickSystemConfig(); + $this->setupWizard->getAuthentication()->fill($upgradeFixture); + $this->setupWizard->getAuthentication()->clickSaveConfig(); + $this->setupWizard->open(); + } + + // Select upgrade to version + $this->setupWizard->getSystemUpgradeHome()->clickSystemUpgrade(); + $this->setupWizard->getSelectVersion()->fill($upgradeFixture); + $this->setupWizard->getSelectVersion()->clickNext(); + + // Readiness Check + $this->setupWizard->getReadiness()->clickReadinessCheck(); + $assertReadiness->processAssert($this->setupWizard); + $this->setupWizard->getReadiness()->clickNext(); + + // Create Backup page + $this->setupWizard->getCreateBackup()->fill($createBackupFixture); + $this->setupWizard->getCreateBackup()->clickNext(); + + // Check info and press 'Upgrade' button + $assertVersionAndEdition->processAssert($this->setupWizard, $upgrade['package'], $version); + $this->setupWizard->getSystemUpgrade()->clickSystemUpgrade(); + + $assertSuccessMessage->processAssert($this->setupWizard, $upgrade['package']); + + // Check application version + $this->adminDashboard->open(); + $assertApplicationVersion->processAssert($this->adminDashboard, $version); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.xml b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.xml new file mode 100644 index 000000000000..13792921f848 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.xml @@ -0,0 +1,22 @@ + + + + + + System Upgrade Page + {version} + {package} + No + {publicKey} + {privateKey} + No + No + No + + + diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/Categories.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/Categories.php index 4c9307c8cd0b..0cf3d30d0e4f 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/Categories.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/Categories.php @@ -50,7 +50,9 @@ protected function selectCategory(Category $category, SimpleElement $element) $mapping['entities']['value'] = implode('/', $this->prepareFullCategoryPath($category)); $this->_fill($mapping, $element); $this->getTemplateBlock()->waitLoader(); - $this->_rootElement->find($this->apply, Locator::SELECTOR_XPATH)->click(); + if (!$this->clickOnElement($this->header, $this->apply, Locator::SELECTOR_CSS, Locator::SELECTOR_XPATH)) { + $this->clickOnElement($this->footer, $this->apply, Locator::SELECTOR_CSS, Locator::SELECTOR_XPATH); + } } /** diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/Products.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/Products.php index 104536070be5..dbd0f4a6e240 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/Products.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/Products.php @@ -64,6 +64,8 @@ protected function selectEntityInGrid(FixtureInterface $product) ); $productGrid->searchAndSelect(['name' => $product->getName()]); $this->getTemplateBlock()->waitLoader(); - $this->_rootElement->find($this->apply, Locator::SELECTOR_XPATH)->click(); + if (!$this->clickOnElement($this->header, $this->apply, Locator::SELECTOR_CSS, Locator::SELECTOR_XPATH)) { + $this->clickOnElement($this->footer, $this->apply, Locator::SELECTOR_CSS, Locator::SELECTOR_XPATH); + } } } diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/WidgetInstanceForm.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/WidgetInstanceForm.php index 7353930df7a5..b6f1a6c17199 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/WidgetInstanceForm.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetInstanceType/WidgetInstanceForm.php @@ -36,6 +36,20 @@ class WidgetInstanceForm extends Form */ protected $templateBlock = './ancestor::body'; + /** + * Selector for action header. + * + * @var string + */ + protected $header = '.page-header'; + + /** + * Selector for footer. + * + * @var string + */ + protected $footer = '.page-footer'; + /** * Filling layout form. * @@ -79,4 +93,28 @@ protected function getTemplateBlock() ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] ); } + + /** + * Click element on the page + * + * @param string $anchor + * @param string $element + * @param string $anchorStrategy [optional] + * @param string $elementStrategy [optional] + * @return bool + */ + protected function clickOnElement( + $anchor, + $element, + $anchorStrategy = Locator::SELECTOR_CSS, + $elementStrategy = Locator::SELECTOR_CSS + ) { + try { + $this->browser->find($anchor, $anchorStrategy)->hover(); + $this->_rootElement->find($element, $elementStrategy)->click(); + } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { + return false; + } + return true; + } } diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/upgrade.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/upgrade.xml new file mode 100644 index 000000000000..99961ef2c1e5 --- /dev/null +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/upgrade.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php index 42eb83a4a903..da992e53f4a3 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php @@ -19,7 +19,7 @@ $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $product = $productRepository->get('bundle-product'); + $product = $productRepository->get('bundle-product', false, null, true); $productRepository->delete($product); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_rollback.php index a9ab7ab1d174..0691aa9e509f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_rollback.php @@ -18,7 +18,7 @@ foreach ($productsToDelete as $sku) { try { - $product = $productRepository->get($sku); + $product = $productRepository->get($sku, false, null, true); $productRepository->delete($product); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/indexer_catalog_category_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/indexer_catalog_category_rollback.php index 0d895665138a..4d4a06c136dc 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/indexer_catalog_category_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/indexer_catalog_category_rollback.php @@ -18,7 +18,7 @@ foreach (['simple 01', 'simple 02', 'simple 03'] as $sku) { try { - $product = $productRepository->get($sku); + $product = $productRepository->get($sku, false, null, true); $productRepository->delete($product); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_rollback.php index 16dbd2d932e1..3fb179f0ba5a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_rollback.php @@ -17,7 +17,7 @@ foreach (['simple1', 'simple2', 'simple3'] as $sku) { try { - $product = $productRepository->get($sku); + $product = $productRepository->get($sku, false, null, true); $productRepository->delete($product); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture_rollback.php index dba03960fca1..60c30daf1bf0 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture_rollback.php @@ -17,7 +17,7 @@ 'Magento\Catalog\Model\ProductRepository' ); try { - $product = $repository->get('simple'); + $product = $repository->get('simple', false, null, true); $product->delete(); } catch (NoSuchEntityException $e) { //Entity already deleted diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_associated_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_associated_rollback.php index fcf812b40119..ae5c0e5370ea 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_associated_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_associated_rollback.php @@ -15,7 +15,7 @@ 'Magento\Catalog\Model\ProductRepository' ); try { - $product = $repository->get('simple'); + $product = $repository->get('simple', false, null, true); $product->delete(); } catch (NoSuchEntityException $e) { //Entity already deleted diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_group_prices_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_group_prices_rollback.php index 9a13e8af8742..176d6b925207 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_group_prices_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_group_prices_rollback.php @@ -14,7 +14,7 @@ 'Magento\Catalog\Model\ProductRepository' ); try { - $product = $repository->get('simple'); + $product = $repository->get('simple', false, null, true); $product->delete(); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { //Entity already deleted diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_duplicated_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_duplicated_rollback.php index 8ef61e1b58c1..c7a76c196b76 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_duplicated_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_duplicated_rollback.php @@ -16,7 +16,7 @@ $productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $product = $productRepository->get('simple-1'); + $product = $productRepository->get('simple-1', false, null, true); $productRepository->delete($product); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_multistore_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_multistore_rollback.php index 6f27d490b86b..23e9552a6203 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_multistore_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_multistore_rollback.php @@ -14,7 +14,7 @@ 'Magento\Catalog\Model\ProductRepository' ); try { - $product = $repository->get('simple'); + $product = $repository->get('simple', false, null, true); $product->delete(); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { //Entity already deleted diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_rollback.php index 74b6bb214bd7..c87999500c1d 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_rollback.php @@ -17,7 +17,7 @@ $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $product = $productRepository->get('simple'); + $product = $productRepository->get('simple', false, null, true); $productRepository->delete($product); } catch (NoSuchEntityException $e) { diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php index c79dd8c68b01..dc79ac23c547 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php @@ -15,7 +15,7 @@ ->create('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $product = $productRepository->get('virtual-product'); + $product = $productRepository->get('virtual-product', false, null, true); $productRepository->delete($product); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_dropdown_option_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_dropdown_option_rollback.php index 5f1ea0cc3c2d..995dc27ef06c 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_dropdown_option_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_dropdown_option_rollback.php @@ -15,7 +15,7 @@ $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $product = $productRepository->get('simple_dropdown_option'); + $product = $productRepository->get('simple_dropdown_option', false, null, true); $product->delete(); } catch (NoSuchEntityException $e) { diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options_rollback.php index 574b1c553c36..79d86c0dd018 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options_rollback.php @@ -14,7 +14,7 @@ 'Magento\Catalog\Model\ProductRepository' ); try { - $product = $repository->get('simple'); + $product = $repository->get('simple', false, null, true); $product->delete(); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { //Entity already deleted diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_without_options_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_without_options_rollback.php index 574b1c553c36..79d86c0dd018 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_without_options_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_without_options_rollback.php @@ -14,7 +14,7 @@ 'Magento\Catalog\Model\ProductRepository' ); try { - $product = $repository->get('simple'); + $product = $repository->get('simple', false, null, true); $product->delete(); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { //Entity already deleted diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_crosssell_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_crosssell_rollback.php index 3c1bbbf9575c..ae498e00d9be 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_crosssell_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_crosssell_rollback.php @@ -16,14 +16,14 @@ $productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $firstProduct = $productRepository->get('simple'); + $firstProduct = $productRepository->get('simple', false, null, true); $firstProduct->delete(); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed } try { - $secondProduct = $productRepository->get('simple_with_cross'); + $secondProduct = $productRepository->get('simple_with_cross', false, null, true); $secondProduct->delete(); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new_rollback.php index 68258c1eca22..d547b0297f5d 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new_rollback.php @@ -16,7 +16,7 @@ $productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $firstProduct = $productRepository->get('simple'); + $firstProduct = $productRepository->get('simple', false, null, true); $productRepository->delete($firstProduct); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_related_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_related_rollback.php index ef76ba3aff98..a20c589dc56a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_related_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_related_rollback.php @@ -16,14 +16,14 @@ $productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $firstProduct = $productRepository->get('simple'); + $firstProduct = $productRepository->get('simple', false, null, true); $productRepository->delete($firstProduct); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed } try { - $secondProduct = $productRepository->get('simple_with_cross'); + $secondProduct = $productRepository->get('simple_with_cross', false, null, true); $productRepository->delete($secondProduct); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_rollback.php index 92bc90f0b302..5c0b2f86b60a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_rollback.php @@ -16,14 +16,14 @@ $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $product = $productRepository->get('simple'); + $product = $productRepository->get('simple', false, null, true); $productRepository->delete($product); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { //Product already removed } try { - $customDesignProduct = $productRepository->get('custom-design-simple-product'); + $customDesignProduct = $productRepository->get('custom-design-simple-product', false, null, true); $productRepository->delete($customDesignProduct); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites_rollback.php index c76018a96cc1..c66bc66bdcae 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites_rollback.php @@ -15,7 +15,7 @@ ->create('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $product = $productRepository->get('simple'); + $product = $productRepository->get('simple', false, null, true); $productRepository->delete($product); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php index 7ea503b72e16..4c575cf03bfe 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php @@ -28,7 +28,6 @@ protected function setUp() } /** - * @magentoDbIsolation enabled * @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php */ @@ -39,7 +38,6 @@ public function testGetFinalPrice() /** * @magentoConfigFixture current_store tax/display/type 1 - * @magentoDbIsolation enabled * @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php */ @@ -50,7 +48,6 @@ public function testGetFinalPriceExcludingTax() /** * @magentoConfigFixture current_store tax/display/type 2 - * @magentoDbIsolation enabled * @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php */ @@ -62,7 +59,6 @@ public function testGetFinalPriceIncludingTax() /** * @magentoConfigFixture current_store tax/display/type 3 - * @magentoDbIsolation enabled * @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php */ @@ -73,7 +69,6 @@ public function testGetFinalPriceIncludingExcludingTax() } /** - * @magentoDbIsolation enabled * @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php */ @@ -85,7 +80,6 @@ public function testGetFinalPriceWithSelectedSimpleProduct() } /** - * @magentoDbIsolation enabled * @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php */ diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable.php index dc4d32d22a28..a3df32f7340a 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable.php @@ -15,6 +15,8 @@ use Magento\Eav\Api\Data\AttributeOptionInterface; use Magento\TestFramework\Helper\Bootstrap; +\Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(); + require __DIR__ . '/configurable_attribute.php'; /** @var ProductRepositoryInterface $productRepository */ diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_rollback.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_rollback.php index 088339ee6c7a..68a5855df42a 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_rollback.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_rollback.php @@ -18,7 +18,7 @@ foreach (['simple_10', 'simple_20', 'configurable'] as $sku) { try { - $product = $productRepository->get($sku); + $product = $productRepository->get($sku, false, null, true); $stockStatus = $objectManager->create('Magento\CatalogInventory\Model\Stock\Status'); $stockStatus->load($product->getEntityId(), 'product_id'); diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_rollback.php b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_rollback.php index c375ca420ca8..08761ef40315 100644 --- a/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_rollback.php @@ -17,7 +17,7 @@ $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $product = $productRepository->get('downloadable-product'); + $product = $productRepository->get('downloadable-product', false, null, true); $productRepository->delete($product); } catch (NoSuchEntityException $e) { diff --git a/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/product_grouped_rollback.php b/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/product_grouped_rollback.php index c2a6f7d8cb02..449bcf16d03b 100644 --- a/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/product_grouped_rollback.php +++ b/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/product_grouped_rollback.php @@ -18,7 +18,7 @@ $registry->register('isSecureArea', true); try { /** @var $simpleProduct \Magento\Catalog\Model\Product */ - $simpleProduct = $productRepository->get('simple-1'); + $simpleProduct = $productRepository->get('simple-1', false, null, true); $simpleProduct->delete(); } catch (NoSuchEntityException $e) { //already deleted @@ -35,7 +35,7 @@ try { /** @var $groupedProduct \Magento\Catalog\Model\Product */ - $groupedProduct = $productRepository->get('grouped-product'); + $groupedProduct = $productRepository->get('grouped-product', false, null, true); $groupedProduct->delete(); } catch (NoSuchEntityException $e) { //already deleted diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/quote_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/quote_rollback.php index 52e255854402..cd69dbaee4bd 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/quote_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/quote_rollback.php @@ -21,7 +21,7 @@ ->create('Magento\Catalog\Api\ProductRepositoryInterface'); try { - $product = $productRepository->get('simple'); + $product = $productRepository->get('simple', false, null, true); $productRepository->delete($product); } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { //Product already removed diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php index a601bdd0b9a7..e26d94d15526 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php @@ -55,11 +55,12 @@ protected function _prepareFiles() } /** + * @param string $filePath * @param string $xml - * @return void + * @throws \Exception * @dataProvider linearFilesProvider */ - public function testDiConfigFileWithoutMerging($xml) + public function testDiConfigFileWithoutMerging($filePath, $xml) { /** @var \Magento\Framework\ObjectManager\Config\SchemaLocator $schemaLocator */ $schemaLocator = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( @@ -74,7 +75,10 @@ public function testDiConfigFileWithoutMerging($xml) libxml_use_internal_errors(false); if (!empty($result)) { - $this->fail('File ' . $xml . ' has invalid xml structure.'); + $this->fail( + 'File ' . $filePath . ' has invalid xml structure. ' + . implode("\n", $result) + ); } } @@ -91,8 +95,8 @@ public function linearFilesProvider() } $output = []; - foreach ($common as $path => $file) { - $output[substr($path, strlen(BP))] = [$file]; + foreach ($common as $path => $content) { + $output[] = [substr($path, strlen(BP)), $content]; } return $output; diff --git a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeMessDetector.php b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeMessDetector.php index 255c3cd009d2..59167913e1d3 100644 --- a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeMessDetector.php +++ b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeMessDetector.php @@ -61,7 +61,7 @@ public function run(array $whiteList) $commandLineArguments = [ 'run_file_mock', //emulate script name in console arguments implode(',', $whiteList), - 'xml', //report format + 'text', //report format $this->rulesetFile, '--reportfile', $this->reportFile, diff --git a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php index cdc5d2578f69..e2c4e18a3e19 100644 --- a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php +++ b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php @@ -88,9 +88,8 @@ public function run(array $whiteList) $settings['files'] = $whiteList; $settings['standard'] = [$this->rulesetDir]; $settings['extensions'] = $this->extensions; - $settings['reportFile'] = $this->reportFile; $settings['warningSeverity'] = 0; - $settings['reports']['checkstyle'] = null; + $settings['reports']['full'] = $this->reportFile; $this->wrapper->setValues($settings); diff --git a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CopyPasteDetector.php b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CopyPasteDetector.php index 04838c9bdde3..b2d9c164fbd1 100644 --- a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CopyPasteDetector.php +++ b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CopyPasteDetector.php @@ -48,7 +48,7 @@ public function setBlackList(array $blackList) } /** - * Whether the tool can be ran on the current environment + * Whether the tool can be run in the current environment * * @SuppressWarnings(PHPMD.UnusedLocalVariable) * @@ -56,7 +56,8 @@ public function setBlackList(array $blackList) */ public function canRun() { - exec('phpcpd --version', $output, $exitCode); + $vendorDir = require BP . '/app/etc/vendor_path.php'; + exec('php ' . BP . '/' . $vendorDir . '/bin/phpcpd --version', $output, $exitCode); return $exitCode === 0; } @@ -79,9 +80,10 @@ public function run(array $whiteList) $blackListStr .= '--exclude ' . $file . ' '; } - $command = 'phpcpd' . ' --log-pmd ' . escapeshellarg( + $vendorDir = require BP . '/app/etc/vendor_path.php'; + $command = 'php ' . BP . '/' . $vendorDir . '/bin/phpcpd' . ' --log-pmd ' . escapeshellarg( $this->reportFile - ) . ' --min-lines 13' . $blackListStr . ' ' . implode(' ', $whiteList); + ) . ' --names-exclude "*Test.php" --min-lines 13' . $blackListStr . ' ' . implode(' ', $whiteList); exec($command, $output, $exitCode); diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/CodingStandard/Tool/CodeSnifferTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/CodingStandard/Tool/CodeSnifferTest.php index fc5d5f26889b..e03c5fb0fa74 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/CodingStandard/Tool/CodeSnifferTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/CodingStandard/Tool/CodeSnifferTest.php @@ -48,9 +48,8 @@ public function testRun() 'files' => $whiteList, 'standard' => [self::RULE_SET], 'extensions' => $extensions, - 'reportFile' => self::REPORT_FILE, 'warningSeverity' => 0, - 'reports' => ['checkstyle' => null], + 'reports' => ['full' => self::REPORT_FILE], ]; $this->_tool->setExtensions($extensions); diff --git a/dev/tests/static/get_github_changes.php b/dev/tests/static/get_github_changes.php new file mode 100644 index 000000000000..24ca5218083d --- /dev/null +++ b/dev/tests/static/get_github_changes.php @@ -0,0 +1,281 @@ +" + --base-path="" + --repo="" + --branch="" + [--file-extensions=""] + +USAGE +); + +$options = getopt('', ['output-file:', 'base-path:', 'repo:', 'file-extensions:', 'branch:']); + +$requiredOptions = ['output-file', 'base-path', 'repo', 'branch']; +if (!validateInput($options, $requiredOptions)) { + echo USAGE; + exit(1); +} + +$fileExtensions = explode(',', isset($options['file-extensions']) ? $options['file-extensions'] : 'php'); + +$mainline = 'mainline_' . (string)rand(0, 9999); +$repo = getRepo($options, $mainline); +$changes = retrieveChangesAcrossForks($mainline, $repo, $options['branch']); +$changedFiles = getChangedFiles($changes, $fileExtensions); +generateChangedFilesList($options['output-file'], $changedFiles); +cleanup($repo, $mainline); + +/** + * Generates a file containing changed files + * + * @param string $outputFile + * @param array $changedFiles + * @return void + */ +function generateChangedFilesList($outputFile, $changedFiles) +{ + $changedFilesList = fopen($outputFile, 'w'); + foreach ($changedFiles as $file) { + fwrite($changedFilesList, $file . PHP_EOL); + } + fclose($changedFilesList); +} + +/** + * Gets list of changed files + * + * @param array $changes + * @param array $fileExtensions + * @return array + */ +function getChangedFiles(array $changes, array $fileExtensions) +{ + $files = []; + foreach ($changes as $fileName) { + foreach ($fileExtensions as $extensions) { + $isFileExension = strpos($fileName, '.' . $extensions); + if ($isFileExension) { + $files[] = $fileName; + } + } + } + + return $files; +} + +/** + * Retrieves changes across forks + * + * @param array $options + * @param string $mainline + * @return array + * @throws Exception + */ +function getRepo($options, $mainline) +{ + $repo = new GitRepo($options['base-path']); + $repo->addRemote($mainline, $options['repo']); + $repo->fetch($mainline); + return $repo; +} + +/** + * @param string $mainline + * @param GitRepo $repo + * @param string $branchName + * @return array + */ +function retrieveChangesAcrossForks($mainline, GitRepo $repo, $branchName) +{ + return $repo->compareChanges($mainline, $branchName); +} + +/** + * Deletes temporary "base" repo + * + * @param GitRepo $repo + * @param string $repo + */ +function cleanup($repo, $mainline) +{ + $repo->removeRemote($mainline); +} + +/** + * Validates input options based on required options + * + * @param array $options + * @param array $requiredOptions + * @return bool + */ +function validateInput(array $options, array $requiredOptions) +{ + foreach ($requiredOptions as $requiredOption) { + if (!isset($options[$requiredOption]) || empty($options[$requiredOption])) { + return false; + } + } + return true; +} + + +class GitRepo +{ + /** + * Absolute path to git project + * + * @var string + */ + private $workTree; + + /** + * @var array + */ + private $remoteList = []; + + /** + * @param string $workTree absolute path to git project + */ + public function __construct($workTree) + { + if (empty($workTree) || !is_dir($workTree)) { + throw new UnexpectedValueException('Working tree should be a valid path to directory'); + } + $this->workTree = $workTree; + } + + /** + * Adds remote + * + * @param string $alias + * @param string $url + */ + public function addRemote($alias, $url) + { + if (isset($this->remoteList[$alias])) { + return; + } + $this->remoteList[$alias] = $url; + + $this->call(sprintf('remote add %s %s', $alias, $url)); + } + + /** + * Remove remote + * + * @param string $alias + */ + public function removeRemote($alias) + { + if (isset($this->remoteList[$alias])) { + $this->call(sprintf('remote rm %s', $alias)); + unset($this->remoteList[$alias]); + } + } + + /** + * Fetches remote + * + * @param string $remoteAlias + */ + public function fetch($remoteAlias) + { + if (!isset($this->remoteList[$remoteAlias])) { + throw new LogicException('Alias "' . $remoteAlias . '" is not defined'); + } + + $this->call(sprintf('fetch %s', $remoteAlias)); + } + + /** + * Returns files changes between branch and HEAD + * + * @param string $remoteAlias + * @param string $remoteBranch + * @return array + */ + public function compareChanges($remoteAlias, $remoteBranch) + { + if (!isset($this->remoteList[$remoteAlias])) { + throw new LogicException('Alias "' . $remoteAlias . '" is not defined'); + } + + $result = $this->call(sprintf('log %s/%s..HEAD --name-status --oneline', $remoteAlias, $remoteBranch)); + + return is_array($result) + ? $this->filterChangedFiles($result, + $remoteAlias, + $remoteBranch + ) + : []; + } + + /** + * Makes a diff of file for specified remote/branch and filters only those have real changes + * + * @param array $changes + * @param string $remoteAlias + * @param string $remoteBranch + * @return array + */ + protected function filterChangedFiles(array $changes, $remoteAlias, $remoteBranch) + { + $changedFilesMasks = [ + 'M' => "M\t", + 'A' => "A\t" + ]; + $filteredChanges = []; + foreach ($changes as $fileName) { + foreach ($changedFilesMasks as $mask) { + if (strpos($fileName, $mask) === 0) { + $fileName = str_replace($mask, '', $fileName); + $fileName = trim($fileName); + if (!in_array($fileName, $filteredChanges) && is_file($this->workTree . '/' . $fileName)) { + $result = $this->call(sprintf( + 'diff HEAD %s/%s -- %s', $remoteAlias, $remoteBranch, $this->workTree . '/' . $fileName) + ); + if ($result) { + $filteredChanges[] = $fileName; + } + } + break; + } + } + } + return $filteredChanges; + } + + /** + * Makes call ro git cli + * + * @param string $command + * @return mixed + */ + private function call($command) + { + $gitCmd = sprintf( + 'git --git-dir %s --work-tree %s', + escapeshellarg("{$this->workTree}/.git"), + escapeshellarg($this->workTree) + ); + $tmp = sprintf('%s %s', $gitCmd, $command); + exec($tmp, $output); + return $output; + } +} diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php index f32c062a0c4f..ec670e2f2ea2 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php @@ -109,7 +109,7 @@ protected static function _padRow($row, $hasScope) public function testPhpFiles() { $invoker = new AggregateInvoker($this); - $changedFiles = ChangedFiles::getPhpFiles(__DIR__ . '/_files/changed_files*'); + $changedFiles = ChangedFiles::getPhpFiles(__DIR__ . '/../_files/changed_files*'); $blacklistFiles = $this->getBlacklistFiles(); foreach ($blacklistFiles as $blacklistFile) { unset($changedFiles[BP . $blacklistFile]); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/RestrictedCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/RestrictedCodeTest.php index 74f9b7728eb0..0c4c6eba49ef 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/RestrictedCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/RestrictedCodeTest.php @@ -74,7 +74,7 @@ protected static function _readList($file) public function testPhpFiles() { $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); - $testFiles = \Magento\TestFramework\Utility\ChangedFiles::getPhpFiles(__DIR__ . '/_files/changed_files*'); + $testFiles = \Magento\TestFramework\Utility\ChangedFiles::getPhpFiles(__DIR__ . '/../_files/changed_files*'); foreach (self::$_fixtureFiles as $fixtureFile) { if (array_key_exists(BP . $fixtureFile, $testFiles)) { unset($testFiles[BP . $fixtureFile]); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/blacklist/obsolete_mage.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/blacklist/obsolete_mage.php index a43305fbd74a..b97a76f61247 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/blacklist/obsolete_mage.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/blacklist/obsolete_mage.php @@ -6,5 +6,6 @@ return [ 'dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php', 'dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php', - 'dev/tests/static/testsuite/Magento/Test/Legacy/_files/*obsolete*.php' + 'dev/tests/static/testsuite/Magento/Test/Legacy/_files/*obsolete*.php', + 'lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/CompiledTest.php', ]; diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index a84100eb5beb..a3ac3034df2a 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -57,7 +57,7 @@ public static function getWhitelist($fileTypes = ['php']) $directoriesToCheck = Files::init()->readLists(__DIR__ . '/_files/whitelist/common.txt'); $changedFiles = []; - foreach (glob(__DIR__ . '/_files/changed_files*') as $listFile) { + foreach (glob(__DIR__ . '/../_files/changed_files*') as $listFile) { $changedFiles = array_merge($changedFiles, file($listFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)); } array_walk( @@ -97,7 +97,7 @@ function ($path) use ($directoriesToCheck, $fileTypes) { */ public function testCodeStylePsr2() { - $reportFile = self::$reportDir . '/phpcs_psr2_report.xml'; + $reportFile = self::$reportDir . '/phpcs_psr2_report.txt'; $wrapper = new Wrapper(); $codeSniffer = new CodeSniffer('PSR2', $reportFile, $wrapper); if (!$codeSniffer->canRun()) { @@ -109,10 +109,14 @@ public function testCodeStylePsr2() $result = $codeSniffer->run(self::getWhitelist()); + $output = ""; + if (file_exists($reportFile)) { + $output = file_get_contents($reportFile); + } $this->assertEquals( 0, $result, - "PHP Code Sniffer has found {$result} error(s): See detailed report in {$reportFile}" + "PHP Code Sniffer has found {$result} error(s): " . PHP_EOL . $output ); } @@ -123,7 +127,7 @@ public function testCodeStylePsr2() */ public function testCodeStyle() { - $reportFile = self::$reportDir . '/phpcs_report.xml'; + $reportFile = self::$reportDir . '/phpcs_report.txt'; $wrapper = new Wrapper(); $codeSniffer = new CodeSniffer(realpath(__DIR__ . '/_files/phpcs'), $reportFile, $wrapper); if (!$codeSniffer->canRun()) { @@ -131,10 +135,16 @@ public function testCodeStyle() } $codeSniffer->setExtensions(['php', 'phtml']); $result = $codeSniffer->run(self::getWhitelist(['php', 'phtml'])); + + $output = ""; + if (file_exists($reportFile)) { + $output = file_get_contents($reportFile); + } + $this->assertEquals( 0, $result, - "PHP Code Sniffer has found {$result} error(s): See detailed report in {$reportFile}" + "PHP Code Sniffer has found {$result} error(s): " . PHP_EOL . $output ); } @@ -146,7 +156,7 @@ public function testCodeStyle() */ public function testAnnotationStandard() { - $reportFile = self::$reportDir . '/phpcs_annotations_report.xml'; + $reportFile = self::$reportDir . '/phpcs_annotations_report.txt'; $wrapper = new Wrapper(); $codeSniffer = new CodeSniffer( realpath(__DIR__ . '/../../../../framework/Magento/ruleset.xml'), @@ -158,10 +168,14 @@ public function testAnnotationStandard() } $result = $codeSniffer->run(self::getWhitelist(['php'])); + $output = ""; + if (file_exists($reportFile)) { + $output = file_get_contents($reportFile); + } $this->assertEquals( 0, $result, - "PHP Code Sniffer has found {$result} error(s): See detailed report in {$reportFile}" + "PHP Code Sniffer has found {$result} error(s): " . PHP_EOL . $output ); } @@ -172,17 +186,25 @@ public function testAnnotationStandard() */ public function testCodeMess() { - $reportFile = self::$reportDir . '/phpmd_report.xml'; + $reportFile = self::$reportDir . '/phpmd_report.txt'; $codeMessDetector = new CodeMessDetector(realpath(__DIR__ . '/_files/phpmd/ruleset.xml'), $reportFile); if (!$codeMessDetector->canRun()) { $this->markTestSkipped('PHP Mess Detector is not available.'); } + + $result = $codeMessDetector->run(self::getWhitelist(['php'])); + + $output = ""; + if (file_exists($reportFile)) { + $output = file_get_contents($reportFile); + } + $this->assertEquals( Command::EXIT_SUCCESS, - $codeMessDetector->run(self::getWhitelist(['php'])), - "PHP Code Mess has found error(s): See detailed report in {$reportFile}" + $result, + "PHP Code Mess has found error(s):" . PHP_EOL . $output ); // delete empty reports @@ -212,9 +234,16 @@ public function testCopyPaste() $copyPasteDetector->setBlackList($blackList); + $result = $copyPasteDetector->run([BP]); + + $output = ""; + if (file_exists($reportFile)) { + $output = file_get_contents($reportFile); + } + $this->assertTrue( - $copyPasteDetector->run([BP]), - "PHP Copy/Paste Detector has found error(s): See detailed report in {$reportFile}" + $result, + "PHP Copy/Paste Detector has found error(s):" . PHP_EOL . $output ); } diff --git a/dev/tests/static/testsuite/Magento/Test/_files/.gitignore b/dev/tests/static/testsuite/Magento/Test/_files/.gitignore new file mode 100644 index 000000000000..11b4bb12f531 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/_files/.gitignore @@ -0,0 +1,2 @@ +/* +!/.gitignore \ No newline at end of file diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php index 3b9f1cd32cdf..4f139760c983 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php @@ -23,7 +23,7 @@ class ImageContentValidatorTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->imageContentValidator = $this->objectManager->getObject('Magento\Framework\Api\ImageContentValidator'); diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php index b25569db2fb4..ab84f58d1e62 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php @@ -53,7 +53,7 @@ class ImageProcessorTest extends \PHPUnit_Framework_TestCase */ protected $directoryWriteMock; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php index a15fcd961da0..e8eae69c77f2 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php @@ -53,7 +53,7 @@ class DataObjectHelperTest extends \PHPUnit_Framework_TestCase */ protected $joinProcessorMock; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php index abcdd3be11f7..9306c6aefa68 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php @@ -21,7 +21,7 @@ class ExtensibleDataObjectConverterTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Api\ExtensibleDataInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $dataObject; - public function setUp() + protected function setUp() { $this->processor = $this->getMockBuilder('Magento\Framework\Reflection\DataObjectProcessor') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/ReaderTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/ReaderTest.php index 656f909bb3d8..8f72cb52894f 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/ReaderTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/ReaderTest.php @@ -15,7 +15,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase /** * Prepare parameters */ - public function setUp() + protected function setUp() { $fileResolver = $this->getMockBuilder('Magento\Framework\App\Config\FileResolver') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/App/Shell.php b/lib/internal/Magento/Framework/App/Shell.php new file mode 100644 index 000000000000..39157919f221 --- /dev/null +++ b/lib/internal/Magento/Framework/App/Shell.php @@ -0,0 +1,71 @@ +driver = $driver; + $this->logger = $logger; + } + + /** + * Execute a command through the command line, passing properly escaped arguments + * + * @param string $command Command with optional argument markers '%s' + * @param string[] $arguments Argument values to substitute markers with + * @throws \Magento\Framework\Exception\LocalizedException If a command returns non-zero exit code + * @return string + */ + public function execute($command, array $arguments = []) + { + try { + $response = $this->driver->execute($command, $arguments); + } catch (LocalizedException $e) { + $this->logger->error($e->getLogMessage()); + throw $e; + } + $escapedCommand = $response->getEscapedCommand(); + $output = $response->getOutput(); + $exitCode = $response->getExitCode(); + $logEntry = $escapedCommand . PHP_EOL . $output; + if ($exitCode) { + $this->logger->error($logEntry); + $commandError = new \Exception($output, $exitCode); + throw new LocalizedException( + new Phrase("Command returned non-zero exit code:\n`%1`", [$command]), + $commandError + ); + } + $this->logger->info($logEntry); + return $output; + } +} diff --git a/lib/internal/Magento/Framework/App/Test/Unit/AclResourceTest.php b/lib/internal/Magento/Framework/App/Test/Unit/AclResourceTest.php index 785bb51008a2..c2883fb99405 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/AclResourceTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/AclResourceTest.php @@ -41,7 +41,7 @@ class AclResourceTest extends \PHPUnit_Framework_TestCase */ private $connection; - public function setUp() + protected function setUp() { $this->connectionFactory = $this->getMockBuilder(ConnectionFactoryInterface::class) ->setMethods(['create']) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Action/AbstractActionTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Action/AbstractActionTest.php index 8b70634808b0..94839361478e 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Action/AbstractActionTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Action/AbstractActionTest.php @@ -26,7 +26,7 @@ class AbstractActionTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Action\Context|\PHPUnit_Framework_MockObject_MockObject */ protected $context; - public function setUp() + protected function setUp() { $this->request = $this->getMockBuilder('Magento\Framework\App\RequestInterface') ->disableOriginalConstructor()->getMock(); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/AreaTest.php b/lib/internal/Magento/Framework/App/Test/Unit/AreaTest.php index 5f0ba4f61948..cab1a46e0e82 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/AreaTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/AreaTest.php @@ -73,7 +73,7 @@ class AreaTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Phrase\RendererInterface */ private $defaultRenderer; - public function setUp() + protected function setUp() { $this->defaultRenderer = \Magento\Framework\Phrase::getRenderer(); $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php b/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php index 1aa15d6f300d..e4b5de3f74ee 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php @@ -61,7 +61,7 @@ class BootstrapTest extends \PHPUnit_Framework_TestCase */ protected $bootstrapMock; - public function setUp() + protected function setUp() { $this->objectManagerFactory = $this->getMock('Magento\Framework\App\ObjectManagerFactory', [], [], '', false); $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php index 658d8b2ab763..cf3be29ad886 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php @@ -32,7 +32,7 @@ class ScopePoolTest extends \PHPUnit_Framework_TestCase */ protected $_object; - public function setUp() + protected function setUp() { $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->_readerPool = $this->getMockForAbstractClass('\Magento\Framework\App\Config\Scope\ReaderPoolInterface'); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Console/CommandListTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Console/CommandListTest.php index ada0b951d7a1..6cd222d3876d 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Console/CommandListTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Console/CommandListTest.php @@ -21,7 +21,7 @@ class CommandListTest extends \PHPUnit_Framework_TestCase */ private $testCommand; - public function setUp() + protected function setUp() { $this->testCommand = new Command('Test'); $commands = [ diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Console/ResponseTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Console/ResponseTest.php index 45927a584d04..629314cf815d 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Console/ResponseTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Console/ResponseTest.php @@ -13,7 +13,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->model = new \Magento\Framework\App\Console\Response(); $this->model->terminateOnSend(false); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Http/ContextTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Http/ContextTest.php index 51c0f3692d0f..f853f9a8c49a 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Http/ContextTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Http/ContextTest.php @@ -20,7 +20,7 @@ class ContextTest extends \PHPUnit_Framework_TestCase */ protected $object; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->object = $this->objectManager->getObject('Magento\Framework\App\Http\Context'); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php index 64a4112b3741..3f931ac8c48d 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/HttpTest.php @@ -62,7 +62,7 @@ class HttpTest extends \PHPUnit_Framework_TestCase */ protected $filesystemMock; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $cookieReaderMock = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\CookieReaderInterface') diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Language/ConfigTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Language/ConfigTest.php index b33e6c64e0bc..57484dca900a 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Language/ConfigTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Language/ConfigTest.php @@ -22,7 +22,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase /** @var Config */ protected $config; - public function setUp() + protected function setUp() { $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); $this->urnResolverMock = $this->getMock('Magento\Framework\Config\Dom\UrnResolver', [], [], '', false); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/FormKeyTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/FormKeyTest.php index e1de5ecf7ad1..82e7306b8b2e 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/FormKeyTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/FormKeyTest.php @@ -44,7 +44,7 @@ class FormKeyTest extends \PHPUnit_Framework_TestCase /** * Create cookie mock and FormKey instance */ - public function setUp() + protected function setUp() { $this->cookieManagerMock = $this->getMock('Magento\Framework\Stdlib\CookieManagerInterface'); $this->cookieMetadataFactory = $this->getMockBuilder( diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php index 2752be7ae329..f54747dc0cfc 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php @@ -12,7 +12,7 @@ class IdentifierTest extends \PHPUnit_Framework_TestCase /** * @return \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php index 73f0b6118537..d309fa79f4ab 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/KernelTest.php @@ -30,7 +30,7 @@ class KernelTest extends \PHPUnit_Framework_TestCase /** * Setup */ - public function setUp() + protected function setUp() { $this->cacheMock = $this->getMock('Magento\Framework\App\PageCache\Cache', [], [], '', false); $this->fullPageCacheMock = $this->getMock('\Magento\PageCache\Model\Cache\Type', [], [], '', false); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/VersionTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/VersionTest.php index 015b0e3c6911..22d6f910b828 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/VersionTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/VersionTest.php @@ -42,7 +42,7 @@ class VersionTest extends \PHPUnit_Framework_TestCase /** * Create cookie and request mock, version instance */ - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->cookieManagerMock = $this->getMock('Magento\Framework\Stdlib\CookieManagerInterface'); @@ -68,6 +68,7 @@ public function setUp() * Increment version on post requests. * In all other cases do nothing. */ + /** * @dataProvider processProvider * @param bool $isPost diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Route/ConfigInterface/ProxyTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Route/ConfigInterface/ProxyTest.php index 0d89f94c0048..bea53642188e 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Route/ConfigInterface/ProxyTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Route/ConfigInterface/ProxyTest.php @@ -18,7 +18,7 @@ class ProxyTest extends \PHPUnit_Framework_TestCase */ protected $_object; - public function setUp() + protected function setUp() { $this->_object = $this->getMock( '\Magento\Framework\App\Route\ConfigInterface', diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php index 5b8c8497e463..898ee146c29c 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Router/ActionListTest.php @@ -29,7 +29,7 @@ class ActionListTest extends \PHPUnit_Framework_TestCase */ protected $actionList; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->cacheMock = $this->getMockBuilder('Magento\Framework\Config\CacheInterface') diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Router/BaseTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Router/BaseTest.php index f4d12fe68a8e..0576f120aa98 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Router/BaseTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Router/BaseTest.php @@ -49,7 +49,7 @@ class BaseTest extends \Magento\Framework\TestFramework\Unit\BaseTestCase */ private $defaultPathMock; - public function setUp() + protected function setUp() { parent::setUp(); // Create mocks diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerTest.php index dddae0b44e6a..2341dddd6429 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerTest.php @@ -27,7 +27,7 @@ class NoRouteHandlerTest extends \Magento\Framework\TestFramework\Unit\BaseTestC */ private $requestMock; - public function setUp() + protected function setUp() { parent::setUp(); $this->configMock = $this->basicMock('Magento\Framework\App\Config\ScopeConfigInterface'); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ShellTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ShellTest.php new file mode 100644 index 000000000000..9f1cc0534528 --- /dev/null +++ b/lib/internal/Magento/Framework/App/Test/Unit/ShellTest.php @@ -0,0 +1,75 @@ +loggerMock = $this->getMockBuilder('\Psr\Log\LoggerInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->driverMock = $this->getMockBuilder('\Magento\Framework\Shell\Driver') + ->disableOriginalConstructor() + ->getMock(); + $this->model = new Shell( + $this->driverMock, + $this->loggerMock + ); + } + + public function testExecuteSuccess() + { + $output = 'success'; + $exitCode = 0; + $command = 'escaped command'; + $logEntry = $command . PHP_EOL . $output; + + $successfulResponse = new Response( + [ + 'output' => $output, + 'exit_code' => $exitCode, + 'escaped_command' => $command + ] + ); + $this->driverMock->expects($this->once())->method('execute')->willReturn($successfulResponse); + $this->loggerMock->expects($this->once())->method('info')->with($logEntry); + $this->assertEquals($output, $this->model->execute($command, [])); + } + + public function testExecuteFailure() + { + $output = 'failure'; + $exitCode = 1; + $command = 'escaped command'; + $logEntry = $command . PHP_EOL . $output; + + $response = new Response( + [ + 'output' => $output, + 'exit_code' => $exitCode, + 'escaped_command' => $command + ] + ); + $this->driverMock->expects($this->once())->method('execute')->willReturn($response); + $this->loggerMock->expects($this->once())->method('error')->with($logEntry); + $this->setExpectedException(LocalizedException::class, "Command returned non-zero exit code:\n`$command`"); + $this->model->execute($command, []); + } +} diff --git a/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/CopyTest.php b/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/CopyTest.php index 430a1a1e2bda..101481cd674b 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/CopyTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/CopyTest.php @@ -15,7 +15,7 @@ class CopyTest extends \PHPUnit_Framework_TestCase */ private $copyPublisher; - public function setUp() + protected function setUp() { $this->copyPublisher = new Copy; } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/FactoryTest.php b/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/FactoryTest.php index 79f64b3e1f6b..2dd0bd530676 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/FactoryTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/FactoryTest.php @@ -17,7 +17,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase */ private $objectManager; - public function setUp() + protected function setUp() { $this->objectManager = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') ->setMethods([]) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/SymlinkTest.php b/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/SymlinkTest.php index 5d24bddc4278..b160e121efbf 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/SymlinkTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/View/Asset/MaterializationStrategy/SymlinkTest.php @@ -18,7 +18,7 @@ class SymlinkTest extends \PHPUnit_Framework_TestCase */ private $symlinkPublisher; - public function setUp() + protected function setUp() { $this->symlinkPublisher = new Symlink; } diff --git a/lib/internal/Magento/Framework/Archive/Test/Unit/ZipTest.php b/lib/internal/Magento/Framework/Archive/Test/Unit/ZipTest.php index 069cd99f8ca5..b2ced298d389 100644 --- a/lib/internal/Magento/Framework/Archive/Test/Unit/ZipTest.php +++ b/lib/internal/Magento/Framework/Archive/Test/Unit/ZipTest.php @@ -17,7 +17,7 @@ class ZipTest extends \PHPUnit_Framework_TestCase */ protected $zip; - public function setUp() + protected function setUp() { $this->zip = $this->getMockBuilder('\Magento\Framework\Archive\Zip') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php b/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php index 1a32f1589dc2..d3d1429548bd 100644 --- a/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php +++ b/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php @@ -29,7 +29,7 @@ class ClassLoaderWrapperTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->autoloaderMock = $this->getMock('Composer\Autoload\ClassLoader'); $this->model = (new ObjectManager($this))->getObject('Magento\Framework\Autoload\ClassLoaderWrapper', diff --git a/lib/internal/Magento/Framework/Autoload/Test/Unit/PopulatorTest.php b/lib/internal/Magento/Framework/Autoload/Test/Unit/PopulatorTest.php index 9fdeb8efb0ee..f53bc7e7bf1f 100644 --- a/lib/internal/Magento/Framework/Autoload/Test/Unit/PopulatorTest.php +++ b/lib/internal/Magento/Framework/Autoload/Test/Unit/PopulatorTest.php @@ -14,7 +14,7 @@ class PopulatorTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Filesystem\DirectoryList | \PHPUnit_Framework_MockObject_MockObject */ protected $mockDirectoryList; - public function setUp() + protected function setUp() { $this->mockDirectoryList = $this->getMockBuilder('\Magento\Framework\App\Filesystem\DirectoryList') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/DatabaseTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/DatabaseTest.php index 42bfc4996b4c..691c7b0c5773 100644 --- a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/DatabaseTest.php +++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/DatabaseTest.php @@ -12,7 +12,7 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); } diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/Config/SchemaLocatorTest.php index b3362be10ba6..7a1efbabf52a 100644 --- a/lib/internal/Magento/Framework/Cache/Test/Unit/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Config/SchemaLocatorTest.php @@ -16,7 +16,7 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolverMock; - public function setUp() + protected function setUp() { $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/DefinedClassesTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/DefinedClassesTest.php index f5242c538452..fe0dee10db4e 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/DefinedClassesTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/DefinedClassesTest.php @@ -36,7 +36,7 @@ class DefinedClassesTest extends \PHPUnit_Framework_TestCase /** @var AutoloaderInterface */ private $initAutoloader; - public function setUp() + protected function setUp() { $this->model = new DefinedClasses(); self::$definedClassesTestActive = true; diff --git a/lib/internal/Magento/Framework/Component/Test/Unit/ComponentRegistrarTest.php b/lib/internal/Magento/Framework/Component/Test/Unit/ComponentRegistrarTest.php index 10ec772be6f6..fe68f9cbd18b 100644 --- a/lib/internal/Magento/Framework/Component/Test/Unit/ComponentRegistrarTest.php +++ b/lib/internal/Magento/Framework/Component/Test/Unit/ComponentRegistrarTest.php @@ -17,7 +17,7 @@ class ComponentRegistrarTest extends \PHPUnit_Framework_TestCase */ private $object; - public function setUp() + protected function setUp() { $this->object = new ComponentRegistrar(); } diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php index 9f6e1255c047..0aa2310ed092 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php @@ -17,7 +17,7 @@ class DataTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ protected $objectManagerHelper; - public function setUp() + protected function setUp() { $this->reader = $this->getMockBuilder('Magento\\Framework\\Config\\ReaderInterface') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/Dom/UrnResolverTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/Dom/UrnResolverTest.php index e95f38161c8f..2f581752e480 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/Dom/UrnResolverTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/Dom/UrnResolverTest.php @@ -20,7 +20,7 @@ class UrnResolverTest extends \PHPUnit_Framework_TestCase */ protected $objectManagerHelper; - public function setUp() + protected function setUp() { $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->urnResolver = $this->objectManagerHelper->getObject('Magento\Framework\Config\Dom\UrnResolver'); diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/DomTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/DomTest.php index 1334570e4f07..411f84b64ac3 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/DomTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/DomTest.php @@ -12,7 +12,7 @@ class DomTest extends \PHPUnit_Framework_TestCase */ protected $validationStateMock; - public function setUp() + protected function setUp() { $this->validationStateMock = $this->getMock( '\Magento\Framework\Config\ValidationStateInterface', diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/File/ConfigFilePoolTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/File/ConfigFilePoolTest.php index 38b66f336cd9..558ae4e48b63 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/File/ConfigFilePoolTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/File/ConfigFilePoolTest.php @@ -15,7 +15,7 @@ class ConfigFilePoolTest extends \PHPUnit_Framework_TestCase */ private $configFilePool; - public function setUp() + protected function setUp() { $newPath = [ 'new_key' => 'new_config.php' diff --git a/lib/internal/Magento/Framework/Console/Cli.php b/lib/internal/Magento/Framework/Console/Cli.php index fa5857d47279..6e9110de1ab7 100644 --- a/lib/internal/Magento/Framework/Console/Cli.php +++ b/lib/internal/Magento/Framework/Console/Cli.php @@ -13,6 +13,7 @@ use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Magento\Framework\Setup\FilePermissions; /** * Magento2 CLI Application. This is the hood for all command line tools supported by Magento. @@ -46,6 +47,23 @@ class Cli extends SymfonyApplication */ public function doRun(InputInterface $input, OutputInterface $output) { + // Check to make sure var/generation/Magento folder dir have read/execute permission for the current user + /** @var \Magento\Setup\Model\ObjectManagerProvider $omProvider */ + $omProvider = $this->serviceManager->get('Magento\Setup\Model\ObjectManagerProvider'); + /** @var \Magento\Framework\ObjectManagerInterface $objectManager */ + $objectManager = $omProvider->get(); + /** @var \Magento\Framework\Setup\Filepermissions $filePermissions */ + $filePermissions = $objectManager->get('Magento\Framework\Setup\FilePermissions'); + if ($filePermissions->checkDirectoryPermissionForCLIUser() === false) { + $output->writeln( + "Command line user (" + . get_current_user() + . ") may not have proper read+execute permissions for directories under \"var/generation/\" . " + . "Please address this issue before using Magento command line." + ); + return 0; + } + $exitCode = parent::doRun($input, $output); if ($this->initException) { $output->writeln( diff --git a/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectFactoryTest.php b/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectFactoryTest.php index b0c6c36972e6..b382c14713af 100644 --- a/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectFactoryTest.php +++ b/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectFactoryTest.php @@ -20,7 +20,7 @@ class RedirectFactoryTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\ObjectManagerInterface | \PHPUnit_Framework_MockObject_MockObject */ private $objectManagerMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); diff --git a/lib/internal/Magento/Framework/Controller/Test/Unit/Router/Route/FactoryTest.php b/lib/internal/Magento/Framework/Controller/Test/Unit/Router/Route/FactoryTest.php index af2e8be7992c..b329ea7f1b6c 100644 --- a/lib/internal/Magento/Framework/Controller/Test/Unit/Router/Route/FactoryTest.php +++ b/lib/internal/Magento/Framework/Controller/Test/Unit/Router/Route/FactoryTest.php @@ -23,7 +23,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase */ protected $factory; - public function setUp() + protected function setUp() { $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/Ddl/TriggerTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/Ddl/TriggerTest.php index 33290712d651..adcf5d7060b1 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/Ddl/TriggerTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/Ddl/TriggerTest.php @@ -12,7 +12,7 @@ class TriggerTest extends \PHPUnit_Framework_TestCase */ protected $_object; - public function setUp() + protected function setUp() { $this->_object = new \Magento\Framework\DB\Ddl\Trigger(); } diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/AbstractSearchResultTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/AbstractSearchResultTest.php index c3de50bd1565..06fd8d46fc8b 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/AbstractSearchResultTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/AbstractSearchResultTest.php @@ -42,7 +42,7 @@ class AbstractSearchResultTest extends \PHPUnit_Framework_TestCase */ protected $searchResultIteratorMock; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Collection/FilesystemTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Collection/FilesystemTest.php index e1725d24005d..4b682c089466 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Collection/FilesystemTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Collection/FilesystemTest.php @@ -11,7 +11,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Data\Collection\Filesystem */ private $model; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject('Magento\Framework\Data\Collection\Filesystem'); diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/CollectionTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/CollectionTest.php index e57cc03428f6..a0c3663b3bd5 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/CollectionTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/CollectionTest.php @@ -12,7 +12,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new \Magento\Framework\Data\Collection( $this->getMock('Magento\Framework\Data\Collection\EntityFactory', [], [], '', false) diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/SearchResultProcessorTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/SearchResultProcessorTest.php index e6b3fc800d10..160cf842bfad 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/SearchResultProcessorTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/SearchResultProcessorTest.php @@ -27,7 +27,7 @@ class SearchResultProcessorTest extends \PHPUnit_Framework_TestCase */ protected $searchCriteriaMock; - public function setUp() + protected function setUp() { $this->searchCriteriaMock = $this->getMockBuilder('Magento\Framework\Api\CriteriaInterface') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Tree/Node/CollectionTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Tree/Node/CollectionTest.php index 7908e0ed11be..9c4c49aedafb 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Tree/Node/CollectionTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Tree/Node/CollectionTest.php @@ -15,7 +15,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ protected $collection; - public function setUp() + protected function setUp() { $tree = new \Magento\Framework\Data\Tree(); $node = new \Magento\Framework\Data\Tree\Node(['id' => 'root'], 'id', $tree); diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/TreeTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/TreeTest.php index dabc86ada794..78e5e21e6118 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/TreeTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/TreeTest.php @@ -19,7 +19,7 @@ class TreeTest extends \PHPUnit_Framework_TestCase */ protected $_tree; - public function setUp() + protected function setUp() { $this->_tree = new Tree(); } diff --git a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/ConverterTest.php b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/ConverterTest.php index eff7fb01a8ef..26dc103e3351 100644 --- a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/ConverterTest.php +++ b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/Config/ConverterTest.php @@ -14,7 +14,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_model = new \Magento\Framework\DataObject\Copy\Config\Converter(); } diff --git a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/ConfigTest.php b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/ConfigTest.php index 485f452fc767..515227f775bd 100644 --- a/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/ConfigTest.php +++ b/lib/internal/Magento/Framework/DataObject/Test/Unit/Copy/ConfigTest.php @@ -19,7 +19,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected $_model; - public function setUp() + protected function setUp() { $this->_storageMock = $this->getMock( 'Magento\Framework\DataObject\Copy\Config\Data', diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/CollectionTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/CollectionTest.php index 34cc345eaaf7..f8a4fe92e5d0 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/CollectionTest.php +++ b/lib/internal/Magento/Framework/Event/Test/Unit/CollectionTest.php @@ -36,7 +36,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ protected $observers; - public function setUp() + protected function setUp() { $this->events = [ 'eventName1' => 'someEvent1', diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/ConfigTest.php index 37a395843e9d..1eb4872f8fca 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Event/Test/Unit/ConfigTest.php @@ -27,7 +27,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected $config; - public function setUp() + protected function setUp() { $this->dataContainerMock = $this->getMock('Magento\Framework\Event\Config\Data', ['get'], [], '', false, false); $this->config = new Config($this->dataContainerMock); diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/ObserverFactoryTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/ObserverFactoryTest.php index 6255cdf31c73..dd7d4ede6855 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/ObserverFactoryTest.php +++ b/lib/internal/Magento/Framework/Event/Test/Unit/ObserverFactoryTest.php @@ -25,7 +25,7 @@ class ObserverFactoryTest extends \PHPUnit_Framework_TestCase */ protected $observerFactory; - public function setUp() + protected function setUp() { $this->objectManagerMock = $this->getMock( 'Magento\Framework\ObjectManager\ObjectManager', diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/ObserverTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/ObserverTest.php index 29e91a34d9a3..82fe99f1d152 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/ObserverTest.php +++ b/lib/internal/Magento/Framework/Event/Test/Unit/ObserverTest.php @@ -22,7 +22,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase */ protected $observer; - public function setUp() + protected function setUp() { $this->observer = new Observer(); } diff --git a/lib/internal/Magento/Framework/Exception/Test/Unit/LocalizedExceptionTest.php b/lib/internal/Magento/Framework/Exception/Test/Unit/LocalizedExceptionTest.php index dde0a5730f1d..3e564b390b9b 100644 --- a/lib/internal/Magento/Framework/Exception/Test/Unit/LocalizedExceptionTest.php +++ b/lib/internal/Magento/Framework/Exception/Test/Unit/LocalizedExceptionTest.php @@ -10,8 +10,6 @@ /** * Class LocalizedExceptionTest - * - * @package Magento\Framework\Exception */ class LocalizedExceptionTest extends \PHPUnit_Framework_TestCase { @@ -24,7 +22,7 @@ class LocalizedExceptionTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->defaultRenderer = \Magento\Framework\Phrase::getRenderer(); $rendererMock = $this->getMockBuilder('Magento\Framework\Phrase\Renderer\Placeholder') diff --git a/lib/internal/Magento/Framework/Exception/Test/Unit/NoSuchEntityExceptionTest.php b/lib/internal/Magento/Framework/Exception/Test/Unit/NoSuchEntityExceptionTest.php index 9bb949c5bdb8..711045beaf8d 100644 --- a/lib/internal/Magento/Framework/Exception/Test/Unit/NoSuchEntityExceptionTest.php +++ b/lib/internal/Magento/Framework/Exception/Test/Unit/NoSuchEntityExceptionTest.php @@ -10,8 +10,6 @@ /** * Class NoSuchEntityExceptionTest - * - * @package Magento\Framework\Exception */ class NoSuchEntityExceptionTest extends \PHPUnit_Framework_TestCase { @@ -29,7 +27,7 @@ class NoSuchEntityExceptionTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->defaultRenderer = \Magento\Framework\Phrase::getRenderer(); $this->rendererMock = $this->getMockBuilder('Magento\Framework\Phrase\Renderer\Placeholder') diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpTest.php index 141f4bc99308..a38e5991103f 100644 --- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpTest.php +++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpTest.php @@ -21,7 +21,7 @@ class HttpTest extends \PHPUnit_Framework_TestCase /** @var bool Result of fsockopen() function */ public static $fsockopen; - public function setUp() + protected function setUp() { require_once __DIR__ . '/../_files/http_mock.php'; diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpsTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpsTest.php index 563c7f07cc20..5fd46a44cc01 100644 --- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpsTest.php +++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/Driver/HttpsTest.php @@ -11,7 +11,7 @@ class HttpsTest extends \PHPUnit_Framework_TestCase { public static $fSockOpen; - public function setUp() + protected function setUp() { require_once __DIR__ . '/../_files/http_mock.php'; self::$fSockOpen = 'resource'; diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ReadTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ReadTest.php index da77049529d2..f5ba5b4558d7 100644 --- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ReadTest.php +++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ReadTest.php @@ -37,7 +37,7 @@ class ReadTest extends \PHPUnit_Framework_TestCase */ protected $driver; - public function setUp() + protected function setUp() { $this->driver = $this->getMockForAbstractClass('Magento\Framework\Filesystem\DriverInterface'); $this->resource = $this->getMock('resource'); diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/WriteTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/WriteTest.php index a5d194c6b474..62360d99adcd 100644 --- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/WriteTest.php +++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/WriteTest.php @@ -39,7 +39,7 @@ class WriteTest extends \PHPUnit_Framework_TestCase */ protected $driver; - public function setUp() + protected function setUp() { $this->driver = $this->getMockForAbstractClass('Magento\Framework\Filesystem\DriverInterface'); $this->resource = $this->getMock('resource'); diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/FileResolverTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/FileResolverTest.php index 203c2772b960..5491ce44a7b5 100644 --- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/FileResolverTest.php +++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/FileResolverTest.php @@ -18,7 +18,7 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->model = (new ObjectManager($this))->getObject('Magento\Framework\Filesystem\FileResolver'); } diff --git a/lib/internal/Magento/Framework/Filter/Test/Unit/AbstractFactoryTest.php b/lib/internal/Magento/Framework/Filter/Test/Unit/AbstractFactoryTest.php index 7b1bdc3bf8e8..fd34c568edf4 100644 --- a/lib/internal/Magento/Framework/Filter/Test/Unit/AbstractFactoryTest.php +++ b/lib/internal/Magento/Framework/Filter/Test/Unit/AbstractFactoryTest.php @@ -34,7 +34,7 @@ class AbstractFactoryTest extends \PHPUnit_Framework_TestCase */ protected $_objectManager; - public function setUp() + protected function setUp() { $this->_objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); diff --git a/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/Gd2Test.php b/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/Gd2Test.php index 3bd41103bd96..858bdb91f162 100644 --- a/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/Gd2Test.php +++ b/lib/internal/Magento/Framework/Image/Test/Unit/Adapter/Gd2Test.php @@ -38,7 +38,7 @@ class Gd2Test extends \PHPUnit_Framework_TestCase /** * Setup testing object */ - public function setUp() + protected function setUp() { require_once __DIR__ . '/_files/global_php_mock.php'; $this->objectManager = new ObjectManager($this); diff --git a/lib/internal/Magento/Framework/Image/Test/Unit/AdapterFactoryTest.php b/lib/internal/Magento/Framework/Image/Test/Unit/AdapterFactoryTest.php index af6e0f16516e..fb2f2509dd8b 100644 --- a/lib/internal/Magento/Framework/Image/Test/Unit/AdapterFactoryTest.php +++ b/lib/internal/Magento/Framework/Image/Test/Unit/AdapterFactoryTest.php @@ -14,7 +14,7 @@ class AdapterFactoryTest extends \PHPUnit_Framework_TestCase */ protected $configMock; - public function setUp() + protected function setUp() { $this->configMock = $this->getMock( 'Magento\Framework\Image\Adapter\ConfigInterface', diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/GridStructureTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/GridStructureTest.php index 648437772a1e..115391230434 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/GridStructureTest.php +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/GridStructureTest.php @@ -31,7 +31,7 @@ class GridStructureTest extends \PHPUnit_Framework_TestCase */ protected $object; - public function setUp() + protected function setUp() { $this->connection = $this->getMockBuilder('Magento\Framework\DB\Adapter\AdapterInterface') ->getMock(); diff --git a/lib/internal/Magento/Framework/Json/Test/Unit/Helper/DataTest.php b/lib/internal/Magento/Framework/Json/Test/Unit/Helper/DataTest.php index 430fd140a611..f7d6ec850e06 100644 --- a/lib/internal/Magento/Framework/Json/Test/Unit/Helper/DataTest.php +++ b/lib/internal/Magento/Framework/Json/Test/Unit/Helper/DataTest.php @@ -18,7 +18,7 @@ class DataTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Json\DecoderInterface | \PHPUnit_Framework_MockObject_MockObject */ protected $jsonDecoderMock; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->jsonEncoderMock = $this->getMockBuilder('Magento\Framework\Json\EncoderInterface') diff --git a/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php b/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php index 90d2c26e520e..3833828d5ec2 100644 --- a/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php +++ b/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php @@ -42,7 +42,7 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase const TEST_EXCEPTION_CURRENCY = 'ZZZ'; const TEST_EXCEPTION_CURRENCY_LOCALE = 'es_ES'; - public function setUp() + protected function setUp() { $this->mockEventManager = $this ->getMockBuilder('\Magento\Framework\Event\Manager') diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php index 6abb16ef66f4..1213e164d359 100644 --- a/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php +++ b/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php @@ -12,7 +12,7 @@ class MessageTest extends \PHPUnit_Framework_TestCase */ protected $_messageMock; - public function setUp() + protected function setUp() { $this->_messageMock = $this->getMock( '\Magento\Framework\Mail\Message', diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/FactoryTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/FactoryTest.php index 1e23e3f4ca78..cffafd7bc99c 100644 --- a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/FactoryTest.php +++ b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/FactoryTest.php @@ -27,7 +27,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->objectManagerHelper = new ObjectManagerHelper($this); $this->objectManagerMock = $this->getMock('\Magento\Framework\ObjectManagerInterface'); diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php index 12e278f7f149..c756713077a7 100644 --- a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php +++ b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php @@ -48,7 +48,7 @@ class TransportBuilderTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->templateFactoryMock = $this->getMock('Magento\Framework\Mail\Template\FactoryInterface'); diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/TransportTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/TransportTest.php index 0b332ea094db..807a5871e2e7 100644 --- a/lib/internal/Magento/Framework/Mail/Test/Unit/TransportTest.php +++ b/lib/internal/Magento/Framework/Mail/Test/Unit/TransportTest.php @@ -17,7 +17,7 @@ class TransportTest extends \PHPUnit_Framework_TestCase */ protected $_transport; - public function setUp() + protected function setUp() { $this->_messageMock = $this->getMock('\Magento\Framework\Mail\Message', [], [], '', false); $this->_transport = new \Magento\Framework\Mail\Transport($this->_messageMock); diff --git a/lib/internal/Magento/Framework/Math/Test/Unit/CalculatorTest.php b/lib/internal/Magento/Framework/Math/Test/Unit/CalculatorTest.php index 38737c3a4f4b..c82de66453fa 100644 --- a/lib/internal/Magento/Framework/Math/Test/Unit/CalculatorTest.php +++ b/lib/internal/Magento/Framework/Math/Test/Unit/CalculatorTest.php @@ -17,7 +17,7 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase */ protected $priceCurrency; - public function setUp() + protected function setUp() { $this->priceCurrency = $this->getMockBuilder('Magento\Framework\Pricing\PriceCurrencyInterface')->getMock(); $this->priceCurrency->expects($this->any()) diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/AbstractMessageTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/AbstractMessageTest.php index 3a3ebcfa99d9..12ef632fb127 100644 --- a/lib/internal/Magento/Framework/Message/Test/Unit/AbstractMessageTest.php +++ b/lib/internal/Magento/Framework/Message/Test/Unit/AbstractMessageTest.php @@ -17,7 +17,7 @@ class AbstractMessageTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->model = new TestingMessage(); } diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/CollectionTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/CollectionTest.php index 4e117b275a6a..583aef5acaeb 100644 --- a/lib/internal/Magento/Framework/Message/Test/Unit/CollectionTest.php +++ b/lib/internal/Magento/Framework/Message/Test/Unit/CollectionTest.php @@ -22,7 +22,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $this->objectManager->getObject('Magento\Framework\Message\Collection'); diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/ErrorTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/ErrorTest.php index 7cbd3cdde04f..36e33110c3f4 100644 --- a/lib/internal/Magento/Framework/Message/Test/Unit/ErrorTest.php +++ b/lib/internal/Magento/Framework/Message/Test/Unit/ErrorTest.php @@ -17,7 +17,7 @@ class ErrorTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject('Magento\Framework\Message\Error'); diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php index 7dbcb83b2612..0fec517ca33a 100644 --- a/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php +++ b/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php @@ -58,7 +58,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase */ private $logger; - public function setUp() + protected function setUp() { $this->messagesFactory = $this->getMockBuilder( 'Magento\Framework\Message\CollectionFactory' diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/NoticeTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/NoticeTest.php index 1b07be424130..449c601f8ae4 100644 --- a/lib/internal/Magento/Framework/Message/Test/Unit/NoticeTest.php +++ b/lib/internal/Magento/Framework/Message/Test/Unit/NoticeTest.php @@ -17,7 +17,7 @@ class NoticeTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject('Magento\Framework\Message\Notice'); diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/SuccessTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/SuccessTest.php index d80fbbf9dee5..fedf9880ae76 100644 --- a/lib/internal/Magento/Framework/Message/Test/Unit/SuccessTest.php +++ b/lib/internal/Magento/Framework/Message/Test/Unit/SuccessTest.php @@ -17,7 +17,7 @@ class SuccessTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject('Magento\Framework\Message\Success'); diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/WarningTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/WarningTest.php index c1860525bdee..3d3ee00ca34a 100644 --- a/lib/internal/Magento/Framework/Message/Test/Unit/WarningTest.php +++ b/lib/internal/Magento/Framework/Message/Test/Unit/WarningTest.php @@ -17,7 +17,7 @@ class WarningTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject('Magento\Framework\Message\Warning'); diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index 0c0dabaec456..f100b488652a 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -520,6 +520,7 @@ public function getCollection() /** * Load object data * + * @deprecated * @param integer $modelId * @param null|string $field * @return $this @@ -621,6 +622,7 @@ public function setHasDataChanges($flag) /** * Save object data * + * @deprecated * @return $this * @throws \Exception */ @@ -805,6 +807,7 @@ public function afterSave() /** * Delete object from database * + * @deprecated * @return $this * @throws \Exception */ diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php index 732f670de3fd..6e92aca51dae 100755 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php @@ -41,7 +41,7 @@ protected function prepareData(EntityMetadata $metadata, $data) if ($column['DEFAULT'] == 'CURRENT_TIMESTAMP' || $column['IDENTITY']) { continue; } - if (isset($data[strtolower($column['COLUMN_NAME'])])) { + if (array_key_exists(strtolower($column['COLUMN_NAME']), $data)) { $output[strtolower($column['COLUMN_NAME'])] = $data[strtolower($column['COLUMN_NAME'])]; } } diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/OrchestratorPoolTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/OrchestratorPoolTest.php index 8c1a937f4fbc..d81fbca9f5bc 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/OrchestratorPoolTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/OrchestratorPoolTest.php @@ -27,7 +27,7 @@ class OrchestratorPoolTest extends \PHPUnit_Framework_TestCase */ protected $readOperationMock; - public function setUp() + protected function setUp() { $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Relation/ActionPoolTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Relation/ActionPoolTest.php index 07a60b64641e..39cddfe13e96 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Relation/ActionPoolTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Relation/ActionPoolTest.php @@ -19,7 +19,7 @@ class ActionPoolTest extends \PHPUnit_Framework_TestCase */ protected $objectManagerMock; - public function setUp() + protected function setUp() { $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/UpdateEntityRowTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/UpdateEntityRowTest.php index b27fba1be189..48651cc4788c 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/UpdateEntityRowTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/UpdateEntityRowTest.php @@ -19,7 +19,7 @@ class UpdateEntityRowTest extends \PHPUnit_Framework_TestCase */ protected $metadataPoolMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->metadataPoolMock = $this->getMockBuilder('\Magento\Framework\Model\Entity\MetadataPool') diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/VersionControl/RelationCompositeTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/VersionControl/RelationCompositeTest.php index 2b3e6e98da59..9a0e8f832117 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/VersionControl/RelationCompositeTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/VersionControl/RelationCompositeTest.php @@ -31,7 +31,7 @@ class RelationCompositeTest extends \PHPUnit_Framework_TestCase */ protected $eventManagerMock; - public function setUp() + protected function setUp() { $this->modelMock = $this->getMockBuilder('Magento\Framework\Model\AbstractModel') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/DependencyCheckerTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/DependencyCheckerTest.php index 4c7d4ab21c7b..0c9fa88fd28f 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/DependencyCheckerTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/DependencyCheckerTest.php @@ -34,7 +34,7 @@ class DependencyCheckerTest extends \PHPUnit_Framework_TestCase */ private $loaderMock; - public function setUp() + protected function setUp() { $this->packageInfoMock = $this->getMock('Magento\Framework\Module\PackageInfo', [], [], '', false); $requireMap = [ diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/FullModuleListTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/FullModuleListTest.php index 8371fa598280..6a741c8bd361 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/FullModuleListTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/FullModuleListTest.php @@ -14,7 +14,7 @@ class FullModuleListTest extends \PHPUnit_Framework_TestCase */ private $moduleList; - public function setUp() + protected function setUp() { $loaderMock = $this->getMock('Magento\Framework\Module\ModuleList\Loader', [], [], '', false); $modules = [ diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php index bca582538966..19fb536031d5 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php @@ -24,7 +24,7 @@ class PackageInfoTest extends \PHPUnit_Framework_TestCase */ private $packageInfo; - public function setUp() + protected function setUp() { $this->componentRegistrar = $this->getMock('Magento\Framework\Component\ComponentRegistrar', [], [], '', false); $this->reader = $this->getMock('Magento\Framework\Module\Dir\Reader', [], [], '', false); diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/DomFactoryTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/DomFactoryTest.php index 7511ba15b9f4..4532c8ce77a4 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/DomFactoryTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/DomFactoryTest.php @@ -25,7 +25,7 @@ class DomFactoryTest extends \PHPUnit_Framework_TestCase */ protected $_objectManager; - public function setUp() + protected function setUp() { $this->_object = $this->getMock('Magento\Framework\ObjectManager\Config\Reader\Dom', [], [], '', false); $this->_objectManager = $this->getMock( diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/CompiledTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/CompiledTest.php index a4632df78d42..dd0d2de147f8 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/CompiledTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/CompiledTest.php @@ -34,7 +34,7 @@ class CompiledTest extends \PHPUnit_Framework_TestCase */ private $sharedInstances; - public function setUp() + protected function setUp() { $this->objectManager = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') ->setMethods([]) @@ -212,12 +212,14 @@ private function getSimpleNestedConfig() '_vac_' => [ 'array_value' => 'value', 'array_configured_instance' => [ - '_i_' => 'Magento\Framework\ObjectManager\Test\Unit\Factory\Fixture\Compiled\DependencySharedTesting', + '_i_' => 'Magento\Framework\ObjectManager\Test\Unit' + . '\Factory\Fixture\Compiled\DependencySharedTesting', ], 'array_configured_array' => [ 'array_array_value' => 'value', 'array_array_configured_instance' => [ - '_ins_' => 'Magento\Framework\ObjectManager\Test\Unit\Factory\Fixture\Compiled\DependencyTesting', + '_ins_' => 'Magento\Framework\ObjectManager' + . '\Test\Unit\Factory\Fixture\Compiled\DependencyTesting', ], ], 'array_global_argument' => [ diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Profiler/FactoryDecoratorTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Profiler/FactoryDecoratorTest.php index 900465b0b3f3..082712ff73ee 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Profiler/FactoryDecoratorTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Profiler/FactoryDecoratorTest.php @@ -29,7 +29,7 @@ class FactoryDecoratorTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\ObjectManager\Profiler\FactoryDecorator */ private $model; - public function setUp() + protected function setUp() { require_once __DIR__ . '/../_files/logger_classes.php'; $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php index 8e5e81c52c57..db217e6f9314 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php @@ -23,7 +23,7 @@ class TMapTest extends \PHPUnit_Framework_TestCase */ private $omConfig; - public function setUp() + protected function setUp() { $this->om = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') ->getMockForAbstractClass(); diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CalculatorTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CalculatorTest.php index 1093a75afa2b..001e829a7538 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CalculatorTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CalculatorTest.php @@ -21,7 +21,7 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase */ protected $amountFactoryMock; - public function setUp() + protected function setUp() { $this->amountFactoryMock = $this->getMockBuilder('Magento\Framework\Pricing\Amount\AmountFactory') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CollectionTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CollectionTest.php index 3a1f4dd8af25..94999c8e302c 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CollectionTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CollectionTest.php @@ -19,7 +19,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase */ protected $adjustmentsData; - public function setUp() + protected function setUp() { $adj1 = $this->getMock('Magento\Framework\Pricing\Adjustment\AdjustmentInterface'); $adj1->expects($this->any()) diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/FactoryTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/FactoryTest.php index 194e48c45ad7..0b3bd26c2b02 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/FactoryTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/FactoryTest.php @@ -15,7 +15,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); } diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/PoolTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/PoolTest.php index 52668f779fe4..326e65cdd682 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/PoolTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/PoolTest.php @@ -14,7 +14,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase */ public $model; - public function setUp() + protected function setUp() { $adjustmentsData = [ 'adj1' => ['className' => 'adj1_class', 'sortOrder' => 10], diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Amount/AmountFactoryTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Amount/AmountFactoryTest.php index f692d3c430aa..07fcf2803cc4 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Amount/AmountFactoryTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Amount/AmountFactoryTest.php @@ -29,7 +29,7 @@ class AmountFactoryTest extends \PHPUnit_Framework_TestCase /** * Test setUp */ - public function setUp() + protected function setUp() { $this->objectManagerMock = $this->getMock('Magento\Framework\App\ObjectManager', [], [], '', false); $this->amountMock = $this->getMock('Magento\Framework\Pricing\Amount\Base', [], [], '', false); diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Helper/DataTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Helper/DataTest.php index 9939201bbf91..adad07741ece 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Helper/DataTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Helper/DataTest.php @@ -20,7 +20,7 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected $priceCurrencyMock; - public function setUp() + protected function setUp() { $this->priceCurrencyMock = $this->getMock('Magento\Framework\Pricing\PriceCurrencyInterface'); $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/CollectionTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/CollectionTest.php index 1b04ea1fa786..597c48c2200f 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/CollectionTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/CollectionTest.php @@ -47,7 +47,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase /** * Test setUp */ - public function setUp() + protected function setUp() { $this->pool = new Pool( [ diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/FactoryTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/FactoryTest.php index dfb875ccd340..9945c103cedd 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/FactoryTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/FactoryTest.php @@ -23,7 +23,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase */ protected $objectManagerMock; - public function setUp() + protected function setUp() { $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/PoolTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/PoolTest.php index 222788776848..1eb6dfc1da15 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/PoolTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/PoolTest.php @@ -36,7 +36,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase /** * Test setUp */ - public function setUp() + protected function setUp() { $this->prices = [ 'regular_price' => 'RegularPrice', diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/BaseTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/BaseTest.php index 7a44876b8bf7..37e48144ea33 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/BaseTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/BaseTest.php @@ -28,7 +28,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase */ protected $model; - public function setUp() + protected function setUp() { $this->priceCollection = $this->getMock('Magento\Framework\Pricing\Price\Collection', [], [], '', false); $this->adjustmentCollection = $this->getMock( diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php index 56b21030fec5..5621162ff2cb 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/PriceInfo/FactoryTest.php @@ -45,7 +45,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase /** * SetUp test */ - public function setUp() + protected function setUp() { $this->objectManagerMock = $this->getMock( 'Magento\Framework\ObjectManager\ObjectManager', diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AbstractAdjustmentTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AbstractAdjustmentTest.php index 41c112c91a9d..85c82df62dc6 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AbstractAdjustmentTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AbstractAdjustmentTest.php @@ -27,7 +27,7 @@ class AbstractAdjustmentTest extends \PHPUnit_Framework_TestCase */ protected $data; - public function setUp() + protected function setUp() { $this->priceCurrency = $this->getMock('Magento\Framework\Pricing\PriceCurrencyInterface'); $this->data = ['argument_one' => 1]; diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php index 11eb5463fcbf..fa5581f2988d 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/AmountTest.php @@ -50,7 +50,7 @@ class AmountTest extends \PHPUnit_Framework_TestCase */ protected $priceMock; - public function setUp() + protected function setUp() { $this->priceCurrency = $this->getMock('Magento\Framework\Pricing\PriceCurrencyInterface'); $data = [ diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/LayoutTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/LayoutTest.php index 688b10030f39..3b61c6ed2b1e 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/LayoutTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/LayoutTest.php @@ -32,7 +32,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase */ protected $generalLayout; - public function setUp() + protected function setUp() { $this->layout = $this->getMock('Magento\Framework\View\LayoutInterface'); $this->generalLayout = $this->getMock('Magento\Framework\View\LayoutInterface'); diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php index 2133f8b57b2f..70a53e188284 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php @@ -42,7 +42,7 @@ class PriceBoxTest extends \PHPUnit_Framework_TestCase */ protected $price; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/RendererPoolTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/RendererPoolTest.php index 5cefd3f8315b..a15a19222f82 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/RendererPoolTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/RendererPoolTest.php @@ -37,7 +37,7 @@ class RendererPoolTest extends \PHPUnit_Framework_TestCase */ protected $contextMock; - public function setUp() + protected function setUp() { $this->layoutMock = $this->getMockBuilder('Magento\Framework\View\Layout') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/RenderTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/RenderTest.php index 05a22abf7d38..73e9f3e49331 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/RenderTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/RenderTest.php @@ -42,7 +42,7 @@ class RenderTest extends \PHPUnit_Framework_TestCase */ protected $renderPool; - public function setUp() + protected function setUp() { $this->priceLayout = $this->getMockBuilder('Magento\Framework\Pricing\Render\Layout') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Process/PhpExecutableFinderFactory.php b/lib/internal/Magento/Framework/Process/PhpExecutableFinderFactory.php new file mode 100644 index 000000000000..ff593ee50152 --- /dev/null +++ b/lib/internal/Magento/Framework/Process/PhpExecutableFinderFactory.php @@ -0,0 +1,19 @@ +model = $objectManager->getObject('Magento\Framework\Reflection\FieldNamer'); diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/MethodsMapTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/MethodsMapTest.php index f18f5c118da4..2d33f53d8ee6 100644 --- a/lib/internal/Magento/Framework/Reflection/Test/Unit/MethodsMapTest.php +++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/MethodsMapTest.php @@ -23,7 +23,7 @@ class MethodsMapTest extends \PHPUnit_Framework_TestCase /** * Set up helper. */ - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeCasterTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeCasterTest.php index 4981b541b409..8c52662ca748 100644 --- a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeCasterTest.php +++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeCasterTest.php @@ -20,7 +20,7 @@ class TypeCasterTest extends \PHPUnit_Framework_TestCase /** * Set up helper. */ - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject('Magento\Framework\Reflection\TypeCaster'); diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/Request/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/Request/Config/SchemaLocatorTest.php index 5ae73eb40b63..bb2e21474bc5 100644 --- a/lib/internal/Magento/Framework/Search/Test/Unit/Request/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/Search/Test/Unit/Request/Config/SchemaLocatorTest.php @@ -16,7 +16,7 @@ class SchemaLocatorTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolverMock; - public function setUp() + protected function setUp() { $this->urnResolver = new \Magento\Framework\Config\Dom\UrnResolver(); /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/SessionManagerTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/SessionManagerTest.php index baceed9b9aa3..c32d045ac494 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/SessionManagerTest.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/SessionManagerTest.php @@ -50,7 +50,7 @@ class SessionManagerTest extends \PHPUnit_Framework_TestCase */ public static $isIniSetInvoked; - public function setUp() + protected function setUp() { $this->markTestSkipped('To be fixed in MAGETWO-34751'); global $mockPHPFunctions; diff --git a/setup/src/Magento/Setup/Model/FilePermissions.php b/lib/internal/Magento/Framework/Setup/FilePermissions.php similarity index 89% rename from setup/src/Magento/Setup/Model/FilePermissions.php rename to lib/internal/Magento/Framework/Setup/FilePermissions.php index 8340faabc48c..e70e583c2711 100644 --- a/setup/src/Magento/Setup/Model/FilePermissions.php +++ b/lib/internal/Magento/Framework/Setup/FilePermissions.php @@ -4,11 +4,12 @@ * See COPYING.txt for license details. */ -namespace Magento\Setup\Model; +namespace Magento\Framework\Setup; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Backup\Filesystem\Iterator\Filter; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Driver\File; class FilePermissions { @@ -22,6 +23,11 @@ class FilePermissions */ protected $directoryList; + /** + * @var File + */ + protected $driverFile; + /** * List of required writable directories for installation * @@ -60,13 +66,16 @@ class FilePermissions /** * @param Filesystem $filesystem * @param DirectoryList $directoryList + * @param File $driverFile */ public function __construct( Filesystem $filesystem, - DirectoryList $directoryList + DirectoryList $directoryList, + File $driverFile ) { $this->filesystem = $filesystem; $this->directoryList = $directoryList; + $this->driverFile = $driverFile; } /** @@ -203,6 +212,28 @@ protected function isNonWritable($code) return $this->isReadableDirectory($directory) && !$directory->isWritable(); } + /** + * Checks if var/generation/* has read and execute permissions + * + * @return bool + */ + public function checkDirectoryPermissionForCLIUser() + { + $varGenerationDir = $this->directoryList->getPath(DirectoryList::GENERATION); + $dirs = $this->driverFile->readDirectory($varGenerationDir); + array_unshift($dirs, $varGenerationDir); + + foreach ($dirs as $dir) { + if (!is_dir($dir) + || !is_readable($dir) + || !is_executable($dir) + ) { + return false; + } + } + return true; + } + /** * Checks if directory exists and is readable * diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/BackupRollbackTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/BackupRollbackTest.php index e9b4ad2948db..349b722d1359 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/BackupRollbackTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/BackupRollbackTest.php @@ -56,7 +56,7 @@ class BackupRollbackTest extends \PHPUnit_Framework_TestCase */ private $path; - public function setUp() + protected function setUp() { $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface', [], [], '', false); $this->log = $this->getMock('Magento\Framework\Setup\LoggerInterface', [], [], '', false); diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/ConsoleLoggerTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/ConsoleLoggerTest.php index 26b87a31ce6f..b7040759c4cf 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/ConsoleLoggerTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/ConsoleLoggerTest.php @@ -20,7 +20,7 @@ class ConsoleLoggerTest extends \PHPUnit_Framework_TestCase */ private $consoleLoggerModel; - public function setUp() + protected function setUp() { $this->console = $this->getMock('Symfony\Component\Console\Output\OutputInterface', [], [], '', false); $outputFormatter = $this->getMock( diff --git a/setup/src/Magento/Setup/Test/Unit/Model/FilePermissionsTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/FilePermissionsTest.php similarity index 92% rename from setup/src/Magento/Setup/Test/Unit/Model/FilePermissionsTest.php rename to lib/internal/Magento/Framework/Setup/Test/Unit/FilePermissionsTest.php index 99f782bff45a..29869b89be72 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/FilePermissionsTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/FilePermissionsTest.php @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ -namespace Magento\Setup\Test\Unit\Model; - -use \Magento\Setup\Model\FilePermissions; +namespace Magento\Framework\Setup\Test\Unit; +use \Magento\Framework\Setup\FilePermissions; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem\Driver\File; class FilePermissionsTest extends \PHPUnit_Framework_TestCase { @@ -27,6 +27,11 @@ class FilePermissionsTest extends \PHPUnit_Framework_TestCase */ private $directoryListMock; + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Filesystem\Driver\File + */ + private $driverFileMock; + /** * @var FilePermissions */ @@ -36,6 +41,7 @@ public function setUp() { $this->directoryWriteMock = $this->getMock('Magento\Framework\Filesystem\Directory\Write', [], [], '', false); $this->filesystemMock = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); + $this->driverFileMock = $this->getMock('Magento\Framework\Filesystem\Driver\File', [], [], '', false); $this->filesystemMock ->expects($this->any()) @@ -43,7 +49,11 @@ public function setUp() ->will($this->returnValue($this->directoryWriteMock)); $this->directoryListMock = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false); - $this->filePermissions = new FilePermissions($this->filesystemMock, $this->directoryListMock); + $this->filePermissions = new FilePermissions( + $this->filesystemMock, + $this->directoryListMock, + $this->driverFileMock + ); } public function testGetInstallationWritableDirectories() @@ -132,8 +142,8 @@ public function getApplicationCurrentNonWritableDirectoriesDataProvider() } /** - * @covers \Magento\Setup\Model\FilePermissions::getMissingWritableDirectoriesForInstallation - * @covers \Magento\Setup\Model\FilePermissions::getMissingWritablePathsForInstallation + * @covers \Magento\Framework\FilePermissions::getMissingWritableDirectoriesForInstallation + * @covers \Magento\Framework\FilePermissions::getMissingWritablePathsForInstallation */ public function testGetMissingWritableDirectoriesAndPathsForInstallation() { diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/ListsTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/ListsTest.php index 39bbb0937b17..8dcc587747f5 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/ListsTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/ListsTest.php @@ -50,7 +50,7 @@ class ListsTest extends \PHPUnit_Framework_TestCase 'de_DE', ]; - public function setUp() + protected function setUp() { $this->mockConfig = $this->getMockBuilder('\Magento\Framework\Locale\ConfigInterface') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/SampleData/StateTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/SampleData/StateTest.php index c00f66742bde..9043cf86d077 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/SampleData/StateTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/SampleData/StateTest.php @@ -30,7 +30,7 @@ class StateTest extends \PHPUnit_Framework_TestCase */ protected $absolutePath; - public function setUp() + protected function setUp() { $this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem') ->setMethods(['getDirectoryWrite']) diff --git a/lib/internal/Magento/Framework/Shell/Driver.php b/lib/internal/Magento/Framework/Shell/Driver.php new file mode 100644 index 000000000000..30d5e2beacb1 --- /dev/null +++ b/lib/internal/Magento/Framework/Shell/Driver.php @@ -0,0 +1,47 @@ +commandRenderer = $commandRenderer; + } + + /** + * Execute a command through the command line, passing properly escaped arguments, and return its output + * + * @param string $command Command with optional argument markers '%s' + * @param string[] $arguments Argument values to substitute markers with + * @return Response + * @throws LocalizedException + */ + + public function execute($command, $arguments) + { + $disabled = explode(',', str_replace(' ', ',', ini_get('disable_functions'))); + if (in_array('exec', $disabled)) { + throw new LocalizedException(new \Magento\Framework\Phrase("exec function is disabled.")); + } + + $command = $this->commandRenderer->render($command, $arguments); + exec($command, $output, $exitCode); + $output = implode(PHP_EOL, $output); + return new Response(['output' => $output, 'exit_code' => $exitCode, 'escaped_command' => $command]); + } +} diff --git a/lib/internal/Magento/Framework/Shell/Response.php b/lib/internal/Magento/Framework/Shell/Response.php new file mode 100644 index 000000000000..02ccdc6e2759 --- /dev/null +++ b/lib/internal/Magento/Framework/Shell/Response.php @@ -0,0 +1,47 @@ +getData('output'); + } + + /** + * Get exit code + * + * @return int + * @codeCoverageIgnore + */ + public function getExitCode() + { + return $this->getData('exit_code'); + } + + /** + * Get escaped command + * + * @return string + * @codeCoverageIgnore + */ + public function getEscapedCommand() + { + return $this->getData('escaped_command'); + } +} diff --git a/lib/internal/Magento/Framework/Shell/Test/Unit/CommandRendererBackgroundTest.php b/lib/internal/Magento/Framework/Shell/Test/Unit/CommandRendererBackgroundTest.php index 7b1ad86ce831..bac1f118035e 100644 --- a/lib/internal/Magento/Framework/Shell/Test/Unit/CommandRendererBackgroundTest.php +++ b/lib/internal/Magento/Framework/Shell/Test/Unit/CommandRendererBackgroundTest.php @@ -21,7 +21,7 @@ class CommandRendererBackgroundTest extends \PHPUnit_Framework_TestCase */ protected $osInfo; - public function setUp() + protected function setUp() { $this->osInfo = $this->getMockBuilder('Magento\Framework\OsInfo')->getMock(); } diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php index 6b727549705e..a67cd484ea25 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php @@ -30,7 +30,7 @@ class CookieScopeTest extends \PHPUnit_Framework_TestCase private $requestMock; - public function setUp() + protected function setUp() { $this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') ->getMock(); diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PublicCookieMetadataTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PublicCookieMetadataTest.php index 299faf3aae50..7473eeb45da5 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PublicCookieMetadataTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PublicCookieMetadataTest.php @@ -19,7 +19,7 @@ class PublicCookieMetadataTest extends \PHPUnit_Framework_TestCase /** @var PublicCookieMetadata */ private $publicCookieMetadata; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->publicCookieMetadata = $objectManager->getObject( diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/SensitiveCookieMetadataTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/SensitiveCookieMetadataTest.php index dcd45b308fe9..4f5f0ff22e1b 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/SensitiveCookieMetadataTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/SensitiveCookieMetadataTest.php @@ -24,7 +24,7 @@ class SensitiveCookieMetadataTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Request\Http | \PHPUnit_Framework_MockObject_MockObject */ private $requestMock; - public function setUp() + protected function setUp() { $this->objectManager = new ObjectManager($this); $this->requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http') diff --git a/lib/internal/Magento/Framework/Test/Unit/EventTest.php b/lib/internal/Magento/Framework/Test/Unit/EventTest.php index 214634e604b8..c50f7cef0bf6 100644 --- a/lib/internal/Magento/Framework/Test/Unit/EventTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/EventTest.php @@ -32,7 +32,7 @@ class EventTest extends \PHPUnit_Framework_TestCase */ protected $observer; - public function setUp() + protected function setUp() { $data = [ 'name' => 'ObserverName', diff --git a/lib/internal/Magento/Framework/Test/Unit/FilesystemTest.php b/lib/internal/Magento/Framework/Test/Unit/FilesystemTest.php index fbd281518be6..fd1d6afd40ca 100644 --- a/lib/internal/Magento/Framework/Test/Unit/FilesystemTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/FilesystemTest.php @@ -23,7 +23,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Filesystem\DirectoryList|\PHPUnit_Framework_MockObject_MockObject */ protected $_directoryListMock; - public function setUp() + protected function setUp() { $this->_dirReadFactoryMock = $this->getMock( 'Magento\Framework\Filesystem\Directory\ReadFactory', diff --git a/lib/internal/Magento/Framework/Test/Unit/FlagTest.php b/lib/internal/Magento/Framework/Test/Unit/FlagTest.php index c75882676f3d..819119e682b6 100644 --- a/lib/internal/Magento/Framework/Test/Unit/FlagTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/FlagTest.php @@ -17,7 +17,7 @@ class FlagTest extends \PHPUnit_Framework_TestCase */ protected $flag; - public function setUp() + protected function setUp() { $data = ['flag_code' => 'synchronize']; $this->createInstance($data); diff --git a/lib/internal/Magento/Framework/Test/Unit/RegistryTest.php b/lib/internal/Magento/Framework/Test/Unit/RegistryTest.php index 254a77fe91c9..914c98434137 100644 --- a/lib/internal/Magento/Framework/Test/Unit/RegistryTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/RegistryTest.php @@ -22,7 +22,7 @@ class RegistryTest extends \PHPUnit_Framework_TestCase */ protected $data; - public function setUp() + protected function setUp() { $this->registry = new Registry(); $this->data = [ diff --git a/lib/internal/Magento/Framework/Test/Unit/ShellTest.php b/lib/internal/Magento/Framework/Test/Unit/ShellTest.php index fa9472aee6eb..83505d48162a 100644 --- a/lib/internal/Magento/Framework/Test/Unit/ShellTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/ShellTest.php @@ -20,7 +20,7 @@ class ShellTest extends \PHPUnit_Framework_TestCase */ protected $logger; - public function setUp() + protected function setUp() { $this->logger = $this->getMockBuilder('Zend_Log') ->setMethods(['log']) diff --git a/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php b/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php index 7f06f5ee9591..1e33d4fe2b04 100644 --- a/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/TranslateTest.php @@ -57,7 +57,7 @@ class TranslateTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $directory; - public function setUp() + protected function setUp() { $this->viewDesign = $this->getMock('\Magento\Framework\View\DesignInterface', [], [], '', false); $this->cache = $this->getMock('\Magento\Framework\Cache\FrontendInterface', [], [], '', false); diff --git a/lib/internal/Magento/Framework/Test/Unit/ValidatorFactoryTest.php b/lib/internal/Magento/Framework/Test/Unit/ValidatorFactoryTest.php index b554b20b4129..82048073f75a 100644 --- a/lib/internal/Magento/Framework/Test/Unit/ValidatorFactoryTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/ValidatorFactoryTest.php @@ -20,7 +20,7 @@ class ValidatorFactoryTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\ObjectManagerInterface | \PHPUnit_Framework_MockObject_MockObject */ private $objectManagerMock; - public function setUp() + protected function setUp() { $objectManager = new ObjectManager($this); $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); diff --git a/lib/internal/Magento/Framework/TestFramework/Unit/BaseTestCase.php b/lib/internal/Magento/Framework/TestFramework/Unit/BaseTestCase.php index 4f37d9f963dc..205606bd4178 100644 --- a/lib/internal/Magento/Framework/TestFramework/Unit/BaseTestCase.php +++ b/lib/internal/Magento/Framework/TestFramework/Unit/BaseTestCase.php @@ -13,14 +13,19 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -class BaseTestCase extends \PHPUnit_Framework_TestCase +abstract class BaseTestCase extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + * ObjectManager available since setUp() + * + * @var ObjectManager */ protected $objectManager; - public function setUp() + /** + * {@inheritdoc} + */ + protected function setUp() { $this->objectManager = new ObjectManager($this); } @@ -38,6 +43,13 @@ protected function basicMock($className) ->getMock(); } + /** + * Boolean data-provider + * + * Providing true and false. + * + * @return array + */ public function booleanDataProvider() { return [[true], [false]]; diff --git a/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php b/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php index 29fb12977347..15d05c8ab7c3 100644 --- a/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php +++ b/lib/internal/Magento/Framework/Unserialize/Test/Unit/UnserializeTest.php @@ -13,7 +13,7 @@ class UnserializeTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Unserialize\Unserialize */ protected $unserialize; - public function setUp() + protected function setUp() { $this->unserialize = new \Magento\Framework\Unserialize\Unserialize(); } diff --git a/lib/internal/Magento/Framework/Url/Test/Unit/Helper/DataTest.php b/lib/internal/Magento/Framework/Url/Test/Unit/Helper/DataTest.php index 1db65380ea08..a982aaba5ef7 100644 --- a/lib/internal/Magento/Framework/Url/Test/Unit/Helper/DataTest.php +++ b/lib/internal/Magento/Framework/Url/Test/Unit/Helper/DataTest.php @@ -12,7 +12,7 @@ class DataTest extends \PHPUnit_Framework_TestCase */ protected $objectManager; - public function setUp() + protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); } diff --git a/lib/internal/Magento/Framework/Url/Test/Unit/ScopeResolverTest.php b/lib/internal/Magento/Framework/Url/Test/Unit/ScopeResolverTest.php index baafedf098b2..908b2eba9ad8 100644 --- a/lib/internal/Magento/Framework/Url/Test/Unit/ScopeResolverTest.php +++ b/lib/internal/Magento/Framework/Url/Test/Unit/ScopeResolverTest.php @@ -17,7 +17,7 @@ class ScopeResolverTest extends \PHPUnit_Framework_TestCase */ protected $_object; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->scopeResolverMock = $this->getMockBuilder('Magento\Framework\App\ScopeResolverInterface')->getMock(); diff --git a/lib/internal/Magento/Framework/View/Template/Html/Minifier.php b/lib/internal/Magento/Framework/View/Template/Html/Minifier.php index 03227fb64696..19f90b61c5df 100644 --- a/lib/internal/Magento/Framework/View/Template/Html/Minifier.php +++ b/lib/internal/Magento/Framework/View/Template/Html/Minifier.php @@ -132,7 +132,11 @@ public function minify($file) preg_replace( '#(?)#', '$1', - $this->readFactory->create($dir)->readFile($fileName) + preg_replace( + '#(?)[^\n\r]*#', + '', + $this->readFactory->create($dir)->readFile($fileName) + ) ) ) ) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/Bundle/ManagerTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/Bundle/ManagerTest.php index a9d06fb33309..4cb2e1e0fc22 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/Bundle/ManagerTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/Bundle/ManagerTest.php @@ -30,7 +30,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\View\Asset\Minification|\PHPUnit_Framework_MockObject_MockObject */ private $minificationMock; - public function setUp() + protected function setUp() { $this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/ConfigTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/ConfigTest.php index f4e8c8145a41..c87b5682edbe 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/ConfigTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/ConfigTest.php @@ -33,7 +33,7 @@ class ConfigTest extends \Magento\Framework\TestFramework\Unit\BaseTestCase /** * {@inheritDoc} */ - public function setUp() + protected function setUp() { $this->scopeConfigMock = $this->getMockBuilder('Magento\Framework\App\Config\ScopeConfigInterface') ->getMockForAbstractClass(); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/FileTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/FileTest.php index 91f70c6607a5..9d42226ea11f 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/FileTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/FileTest.php @@ -30,7 +30,7 @@ class FileTest extends \PHPUnit_Framework_TestCase */ private $object; - public function setUp() + protected function setUp() { $this->source = $this->getMock('Magento\Framework\View\Asset\Source', [], [], '', false); $this->context = $this->getMockForAbstractClass('\Magento\Framework\View\Asset\ContextInterface'); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php index 93f710f0fc25..f65aba6b3ee5 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php @@ -40,7 +40,7 @@ class PoolTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') ->getMockForAbstractClass(); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/BlockFactoryTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/BlockFactoryTest.php index 65cbfbb4f9e3..ea63368b46de 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/BlockFactoryTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/BlockFactoryTest.php @@ -17,7 +17,7 @@ class BlockFactoryTest extends \PHPUnit_Framework_TestCase */ protected $objectManagerMock; - public function setUp() + protected function setUp() { $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php index e4061401502b..2149d94ab8ea 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php @@ -27,7 +27,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase */ protected $ipValidatorMock; - public function setUp() + protected function setUp() { $this->contextMock = $this->getMockBuilder('Magento\Framework\View\Element\Template\Context') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationMediatorTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationMediatorTest.php index 9a49625daad2..7411d3aaef64 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationMediatorTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationMediatorTest.php @@ -26,7 +26,7 @@ class InterpretationMediatorTest extends \PHPUnit_Framework_TestCase */ private $interpretationMediator; - public function setUp() + protected function setUp() { $this->interpretationStrategy = $this->getMockBuilder( 'Magento\Framework\View\Element\Message\InterpretationStrategy' diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationStrategyTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationStrategyTest.php index 8ee2678ce322..bff282ff7193 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationStrategyTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationStrategyTest.php @@ -38,7 +38,7 @@ class InterpretationStrategyTest extends \PHPUnit_Framework_TestCase */ private $interpretationStrategy; - public function setUp() + protected function setUp() { $this->renderersPool = $this->getMockBuilder( 'Magento\Framework\View\Element\Message\Renderer\RenderersPool' diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRendererTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRendererTest.php index aa1112439680..4cc19720504e 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRendererTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRendererTest.php @@ -21,7 +21,7 @@ class BlockRendererTest extends \PHPUnit_Framework_TestCase */ private $blockTemplate; - public function setUp() + protected function setUp() { $this->blockTemplate = $this->getMockBuilder( 'Magento\Framework\View\Element\Message\Renderer\BlockRenderer\Template' diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ResolverTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ResolverTest.php index 3459b1eb4263..320f5bc04d84 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ResolverTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ResolverTest.php @@ -30,7 +30,7 @@ class ResolverTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->_viewFileSystemMock = $this->getMock('\Magento\Framework\View\FileSystem', [], [], '', false); $this->_resolver = new \Magento\Framework\View\Element\Template\File\Resolver( diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ValidatorTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ValidatorTest.php index 302e70f03ae4..c66ee1ceba1d 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ValidatorTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Template/File/ValidatorTest.php @@ -60,7 +60,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase * * @return void */ - public function setUp() + protected function setUp() { $this->_fileSystemMock = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false); $this->_scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/BlockTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/BlockTest.php index 630ad5d72c64..28de4f208641 100755 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/BlockTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/BlockTest.php @@ -76,7 +76,7 @@ protected function getBlock(array $arguments) * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. */ - public function setUp() + protected function setUp() { $this->scheduledStructure = $this->getMock( 'Magento\Framework\View\Layout\ScheduledStructure', diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/UiComponentTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/UiComponentTest.php index beb1a2cf3d91..3c585307c168 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/UiComponentTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/UiComponentTest.php @@ -28,7 +28,7 @@ class UiComponentTest extends \PHPUnit_Framework_TestCase */ protected $context; - public function setUp() + protected function setUp() { $this->helper = $this->getMockBuilder('Magento\Framework\View\Layout\ScheduledStructure\Helper') ->setMethods(['scheduleStructure']) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/ScheduledStructure/HelperTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/ScheduledStructure/HelperTest.php index 51139f0d2988..6cb3a5cfdca8 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/ScheduledStructure/HelperTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/ScheduledStructure/HelperTest.php @@ -43,7 +43,7 @@ class HelperTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->scheduledStructureMock = $this->getMockBuilder('Magento\Framework\View\Layout\ScheduledStructure') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/Update/ValidatorTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/Update/ValidatorTest.php index c410749f6f28..50a314426523 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/Update/ValidatorTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Model/Layout/Update/ValidatorTest.php @@ -14,7 +14,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase */ protected $_objectHelper; - public function setUp() + protected function setUp() { $this->_objectHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php index fd270f00f738..90079974edd0 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/ConfigTest.php @@ -69,7 +69,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase */ protected $areaResolverMock; - public function setUp() + protected function setUp() { $this->assetRepo = $this->getMock('Magento\Framework\View\Asset\Repository', [], [], '', false); $this->pageAssets = $this->getMock('Magento\Framework\View\Asset\GroupedCollection', [], [], '', false); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Layout/ReaderTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/Layout/ReaderTest.php index 9e35d9d375be..59e5a21c4637 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/Layout/ReaderTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Layout/ReaderTest.php @@ -51,7 +51,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase */ protected $processorInterface; - public function setUp() + protected function setUp() { $this->processorInterface = $this->getMock( 'Magento\Framework\View\Layout\ProcessorInterface', diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/TitleTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/TitleTest.php index 386e66555023..34ffb54ba60e 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/TitleTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/TitleTest.php @@ -26,7 +26,7 @@ class TitleTest extends \PHPUnit_Framework_TestCase /** * @return void */ - public function setUp() + protected function setUp() { $this->scopeConfigMock = $this->getMockBuilder('Magento\Framework\App\Config\ScopeConfigInterface') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php index 994c1a84dd3b..a30c7a107103 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php @@ -34,7 +34,7 @@ class MinifierTest extends \PHPUnit_Framework_TestCase /** * Initialize testable object */ - public function setUp() + protected function setUp() { $this->htmlDirectory = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\WriteInterface') ->getMock(); @@ -96,6 +96,12 @@ public function testMinify() someMethod(); ?>
    inline text + TEXT; $expectedContent = << Test titleText Link some textsomeMethod(); ?>
    inline text + inline text TEXT; $this->appDirectory->expects($this->once()) diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/Response/FieldsFilterTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/Response/FieldsFilterTest.php index d63e180edf93..d59bcb77846b 100644 --- a/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/Response/FieldsFilterTest.php +++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/Response/FieldsFilterTest.php @@ -29,7 +29,7 @@ class FieldsFilterTest extends \PHPUnit_Framework_TestCase /** * Setup SUT */ - public function setUp() + protected function setUp() { $this->requestMock = $this->getMock('Magento\Framework\Webapi\Rest\Request', [], [], '', false); $this->processor = new FieldsFilter($this->requestMock); diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php index 36cf65fba97b..6e592647e4b4 100644 --- a/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php +++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php @@ -42,7 +42,7 @@ class ServiceInputProcessorTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $fieldNamer; - public function setUp() + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->objectManagerMock = $this->getMockBuilder('\Magento\Framework\ObjectManagerInterface') diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 58c1a264f4ee..5592df350a56 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -19,7 +19,8 @@ "ext-gd": "*", "ext-openssl": "*", "lib-libxml": "*", - "ext-xsl": "*" + "ext-xsl": "*", + "symfony/process": "~2.1" }, "suggest": { "ext-imagick": "Use Image Magick >=3.0.0 as an optional alternative image processing library" diff --git a/nginx.conf.sample b/nginx.conf.sample index 04e6dda144b3..5de47a5fe6a8 100644 --- a/nginx.conf.sample +++ b/nginx.conf.sample @@ -163,3 +163,21 @@ location ~ (index|get|static|report|404|503)\.php$ { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } + +gzip on; +gzip_disable "msie6"; + +gzip_comp_level 6; +gzip_min_length 1100; +gzip_proxied any; +gzip_types + text/plain + text/css + text/js + text/xml + text/javascript + application/javascript + application/x-javascript + application/json + application/xml + application/xml+rss; diff --git a/pub/cron.php b/pub/cron.php index 6c868222a234..091e94b9d18e 100644 --- a/pub/cron.php +++ b/pub/cron.php @@ -20,9 +20,6 @@ } try { - if (empty($opt['group'])) { - $opt['group'] = 'default'; - } foreach ($opt as $key => $value) { $opt[$key] = escapeshellarg($value); } diff --git a/setup/config/di.config.php b/setup/config/di.config.php index 1fb42803996e..9c73aae47535 100644 --- a/setup/config/di.config.php +++ b/setup/config/di.config.php @@ -38,6 +38,7 @@ 'Magento\Setup\Controller\Marketplace', 'Magento\Setup\Controller\SystemConfig', 'Magento\Setup\Controller\InstallExtensionGrid', + 'Magento\Setup\Controller\MarketplaceCredentials', 'Magento\Setup\Controller\Session' ], 'instance' => [ diff --git a/setup/config/states.home.config.php b/setup/config/states.home.config.php index 78e947b2ee7b..ddb6c7430248 100644 --- a/setup/config/states.home.config.php +++ b/setup/config/states.home.config.php @@ -49,13 +49,13 @@ ], [ 'id' => 'root.upgrade', - 'url' => 'select-version', - 'templateUrl' => "$base/select-version", + 'url' => 'marketplace-credentials', + 'templateUrl' => "$base/marketplace-credentials", 'title' => 'System Upgrade', - 'controller' => 'selectVersionController', - 'header' => 'Step 1: Select Version', + 'controller' => 'MarketplaceCredentialsController', 'order' => 1, - 'nav' => true, + 'nav' => false, + 'noMenu' => true, 'type' => 'upgrade' ], ], diff --git a/setup/config/states.upgrade.config.php b/setup/config/states.upgrade.config.php index c210cb7c1fac..dd1f8938f458 100644 --- a/setup/config/states.upgrade.config.php +++ b/setup/config/states.upgrade.config.php @@ -11,13 +11,24 @@ 'upgrade' => 'System Upgrade', ], 'navUpdater' => [ + [ + 'id' => 'root.select-version', + 'url' => 'select-version', + 'templateUrl' => "$base/select-version", + 'title' => 'System Upgrade', + 'controller' => 'selectVersionController', + 'header' => 'Step 1: Select Version', + 'order' => 2, + 'nav' => true, + 'type' => 'upgrade' + ], [ 'id' => 'root.readiness-check-upgrade', 'url' => 'readiness-check-updater', 'templateUrl' => "$base/readiness-check-updater", 'title' => "Readiness \n Check", 'header' => 'Step 2: Readiness Check', - 'order' => 2, + 'order' => 3, 'nav' => true, 'type' => 'upgrade' ], @@ -29,7 +40,7 @@ 'header' => 'Step 2: Readiness Check', 'controller' => 'readinessCheckController', 'nav' => false, - 'order' => 3, + 'order' => 4, 'type' => 'upgrade' ], [ @@ -39,7 +50,7 @@ 'title' => 'Create Backup', 'controller' => 'createBackupController', 'header' => 'Step 3: Create Backup', - 'order' => 4, + 'order' => 5, 'nav' => true, 'type' => 'upgrade' ], @@ -51,7 +62,7 @@ 'header' => 'Step 3: Create Backup', 'controller' => 'completeBackupController', 'nav' => false, - 'order' => 5, + 'order' => 6, 'type' => 'upgrade' ], [ @@ -61,7 +72,7 @@ 'title' => "System \n Upgrade", 'controller' => 'startUpdaterController', 'header' => 'Step 4: System Upgrade', - 'order' => 6, + 'order' => 7, 'nav' => true, 'type' => 'upgrade' ], @@ -70,7 +81,7 @@ 'url' => 'updater-success', 'templateUrl' => "$base/updater-success", 'controller' => 'updaterSuccessController', - 'order' => 7, + 'order' => 8, 'noMenu' => true ], [ diff --git a/setup/pub/magento/setup/app.js b/setup/pub/magento/setup/app.js index 71d9c50b4e8e..7da6d4dae759 100644 --- a/setup/pub/magento/setup/app.js +++ b/setup/pub/magento/setup/app.js @@ -28,7 +28,8 @@ var app = angular.module( 'updater-success', 'home', 'auth-dialog', - 'system-config' + 'system-config', + 'marketplace-credentials' ]); app.config(['$httpProvider', '$stateProvider', function ($httpProvider, $stateProvider) { diff --git a/setup/pub/magento/setup/main.js b/setup/pub/magento/setup/main.js index cf505721cbcd..70e768bac22c 100644 --- a/setup/pub/magento/setup/main.js +++ b/setup/pub/magento/setup/main.js @@ -46,7 +46,7 @@ main.controller('navigationController', .error(function (result) { }); }, - 120000 + 25000 ); $scope.moduleName = $localStorage.moduleName; diff --git a/setup/pub/magento/setup/marketplace-credentials.js b/setup/pub/magento/setup/marketplace-credentials.js new file mode 100644 index 000000000000..29d20dc004fc --- /dev/null +++ b/setup/pub/magento/setup/marketplace-credentials.js @@ -0,0 +1,87 @@ +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +'use strict'; +angular.module('marketplace-credentials', ['ngStorage']) + .controller('MarketplaceCredentialsController', ['$scope', '$state', '$http', '$localStorage', '$rootScope', '$sce', + function ($scope, $state, $http, $localStorage, $rootScope, $sce) { + $scope.showCredsForm = false; + $scope.user = { + username : $localStorage.marketplaceUsername ? $localStorage.marketplaceUsername : '', + password : '', + submitted : false + }; + + $scope.upgradeProcessError = false; + + $http.get('index.php/select-version/installedSystemPackage', {'responseType' : 'json'}) + .success(function (data) { + if (data.responseType == 'error') { + $scope.upgradeProcessError = true; + $scope.upgradeProcessErrorMessage = $sce.trustAsHtml(data.error); + } else { + if (!$rootScope.authRequest || !$rootScope.isMarketplaceAuthorized) { + $scope.isHiddenSpinner = false; + $http.post('index.php/marketplace/check-auth', []) + .success(function (response) { + if (response.success) { + $localStorage.marketplaceUsername = $scope.user.username = response.data.username; + $localStorage.isMarketplaceAuthorized = true; + $scope.nextState(); + } else { + $localStorage.isMarketplaceAuthorized = false; + $scope.showCredsForm = true; + } + $rootScope.isMarketplaceAuthorized = $localStorage.isMarketplaceAuthorized; + $rootScope.authRequest = true; + }); + } else { + $rootScope.isMarketplaceAuthorized = $localStorage.isMarketplaceAuthorized; + $scope.nextState(); + } + } + }) + .error(function (data) { + $scope.upgradeProcessError = true; + }); + + $scope.errors = false; + + $scope.saveAuthJson = function () { + if ($scope.auth.$valid) { + $http.post('index.php/marketplace/save-auth-json', $scope.user) + .success(function (data) { + $scope.saveAuthJson.result = data; + if ($scope.saveAuthJson.result.success) { + $scope.logout = false; + $localStorage.isMarketplaceAuthorized = true; + $scope.errors = false; + $scope.nextState(); + } else { + $localStorage.isMarketplaceAuthorized = false; + $scope.errors = true; + } + $rootScope.isMarketplaceAuthorized = $localStorage.isMarketplaceAuthorized; + $localStorage.marketplaceUsername = $scope.user.username; + }) + .error(function (data) { + $scope.saveAuthJson.failed = data; + $localStorage.isMarketplaceAuthorized = false; + $scope.errors = true; + + }); + } else { + $scope.validate(); + } + }; + + $scope.validate = function() { + if ($scope.user.$valid) { + $scope.user.submitted = false; + } else { + $scope.user.submitted = true; + } + } + }]); diff --git a/setup/pub/magento/setup/select-version.js b/setup/pub/magento/setup/select-version.js index 9f7ea9ec66d4..8e9eba9c5c41 100644 --- a/setup/pub/magento/setup/select-version.js +++ b/setup/pub/magento/setup/select-version.js @@ -28,7 +28,7 @@ angular.module('select-version', ['ngStorage']) $http.get('index.php/select-version/systemPackage', {'responseType' : 'json'}) .success(function (data) { if (data.responseType != 'error') { - if (data.packages.length <= 1) { + if (data.packages.length == 1 && data.packages[0].versions.length <=1) { $scope.upgradeProcessError = true; $scope.upgradeProcessErrorMessage = "You're already using the latest version, there's nothing for us to do."; } else { diff --git a/setup/src/Magento/Setup/Controller/Environment.php b/setup/src/Magento/Setup/Controller/Environment.php index 338c97ceb3af..f01130a71221 100644 --- a/setup/src/Magento/Setup/Controller/Environment.php +++ b/setup/src/Magento/Setup/Controller/Environment.php @@ -47,13 +47,13 @@ class Environment extends AbstractActionController /** * Constructor * - * @param \Magento\Setup\Model\FilePermissions $permissions + * @param \Magento\Framework\Setup\FilePermissions $permissions * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Setup\Model\CronScriptReadinessCheck $cronScriptReadinessCheck * @param \Magento\Setup\Model\PhpReadinessCheck $phpReadinessCheck */ public function __construct( - \Magento\Setup\Model\FilePermissions $permissions, + \Magento\Framework\Setup\FilePermissions $permissions, \Magento\Framework\Filesystem $filesystem, \Magento\Setup\Model\CronScriptReadinessCheck $cronScriptReadinessCheck, \Magento\Setup\Model\PhpReadinessCheck $phpReadinessCheck diff --git a/setup/src/Magento/Setup/Controller/MarketplaceCredentials.php b/setup/src/Magento/Setup/Controller/MarketplaceCredentials.php new file mode 100644 index 000000000000..d67289c5d2ac --- /dev/null +++ b/setup/src/Magento/Setup/Controller/MarketplaceCredentials.php @@ -0,0 +1,22 @@ +setTerminal(true); + return $view; + } +} diff --git a/setup/src/Magento/Setup/Controller/SelectVersion.php b/setup/src/Magento/Setup/Controller/SelectVersion.php index d78194a23ee7..5b1d11058fcc 100644 --- a/setup/src/Magento/Setup/Controller/SelectVersion.php +++ b/setup/src/Magento/Setup/Controller/SelectVersion.php @@ -61,4 +61,22 @@ public function systemPackageAction() return new JsonModel($data); } + + /** + * Gets installed system package + * + * @return JsonModel + */ + public function installedSystemPackageAction() + { + $data = []; + try { + $data['packages'] = $this->systemPackage->getInstalledSystemPackages([]); + $data['responseType'] = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; + } catch (\Exception $e) { + $data['error'] = $e->getMessage(); + $data['responseType'] = ResponseTypeInterface::RESPONSE_TYPE_ERROR; + } + return new JsonModel($data); + } } diff --git a/setup/src/Magento/Setup/Controller/Session.php b/setup/src/Magento/Setup/Controller/Session.php index 4fddb7d950b0..0c3c08ac0118 100644 --- a/setup/src/Magento/Setup/Controller/Session.php +++ b/setup/src/Magento/Setup/Controller/Session.php @@ -46,10 +46,13 @@ public function prolongAction() /** @var \Magento\Framework\App\State $adminAppState */ $adminAppState = $objectManager->get('Magento\Framework\App\State'); $adminAppState->setAreaCode(\Magento\Framework\App\Area::AREA_ADMIN); - - /* @var \Magento\Backend\Model\Auth\Session $session */ $sessionConfig = $objectManager->get('Magento\Backend\Model\Session\AdminConfig'); - $sessionConfig->setCookiePath('/setup'); + /** @var \Magento\Backend\Model\Url $backendUrl */ + $backendUrl = $objectManager->get('Magento\Backend\Model\Url'); + $urlPath = parse_url($backendUrl->getBaseUrl(), PHP_URL_PATH); + $cookiePath = $urlPath . 'setup'; + $sessionConfig->setCookiePath($cookiePath); + /* @var \Magento\Backend\Model\Auth\Session $session */ $session = $objectManager->create( 'Magento\Backend\Model\Auth\Session', [ diff --git a/setup/src/Magento/Setup/Model/ConfigModel.php b/setup/src/Magento/Setup/Model/ConfigModel.php index 3bc01dac2b83..c8fd7fce0b37 100644 --- a/setup/src/Magento/Setup/Model/ConfigModel.php +++ b/setup/src/Magento/Setup/Model/ConfigModel.php @@ -10,6 +10,7 @@ use Magento\Framework\Config\Data\ConfigData; use Magento\Framework\App\DeploymentConfig\Writer; use Magento\Framework\Setup\Option\AbstractConfigOption; +use Magento\Framework\Setup\FilePermissions; class ConfigModel { diff --git a/setup/src/Magento/Setup/Model/Installer.php b/setup/src/Magento/Setup/Model/Installer.php index c9e10f391a63..d2c37704e420 100644 --- a/setup/src/Magento/Setup/Model/Installer.php +++ b/setup/src/Magento/Setup/Model/Installer.php @@ -38,6 +38,7 @@ use Magento\Setup\Validator\DbValidator; use \Magento\Backend\Setup\ConfigOptionsList as BackendConfigOptionsList; use Magento\SampleData; +use Magento\Framework\Setup\FilePermissions; /** * Class Installer contains the logic to install Magento application. diff --git a/setup/src/Magento/Setup/Model/InstallerFactory.php b/setup/src/Magento/Setup/Model/InstallerFactory.php index 453cbc067957..b95675a2267f 100644 --- a/setup/src/Magento/Setup/Model/InstallerFactory.php +++ b/setup/src/Magento/Setup/Model/InstallerFactory.php @@ -50,7 +50,7 @@ public function __construct(ServiceLocatorInterface $serviceLocator, ResourceFac public function create(LoggerInterface $log) { return new Installer( - $this->serviceLocator->get('Magento\Setup\Model\FilePermissions'), + $this->serviceLocator->get('Magento\Framework\Setup\FilePermissions'), $this->serviceLocator->get('Magento\Framework\App\DeploymentConfig\Writer'), $this->serviceLocator->get('Magento\Framework\App\DeploymentConfig\Reader'), $this->serviceLocator->get('Magento\Framework\App\DeploymentConfig'), diff --git a/setup/src/Magento/Setup/Model/MarketplaceManager.php b/setup/src/Magento/Setup/Model/MarketplaceManager.php index 79d613302aeb..895623530bb6 100644 --- a/setup/src/Magento/Setup/Model/MarketplaceManager.php +++ b/setup/src/Magento/Setup/Model/MarketplaceManager.php @@ -6,11 +6,6 @@ namespace Magento\Setup\Model; -use Zend\ServiceManager\ServiceLocatorInterface; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; -use Zend\View\Model\JsonModel; - class MarketplaceManager { /** @@ -81,7 +76,7 @@ public function __construct( $this->composerInformation = $composerInformation; $this->curlClient = $curl; $this->filesystem = $filesystem; - $this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); + $this->directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR); } /** @@ -245,7 +240,8 @@ public function getAuthJsonData() */ public function getAuthJson() { - $directory = $this->getFilesystem()->getDirectoryRead(DirectoryList::COMPOSER_HOME); + $directory = $this->getFilesystem() + ->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME); if ($directory->isExist($this->pathToAuthFile) && $directory->isReadable($this->pathToAuthFile)) { try { $data = $directory->readFile($this->pathToAuthFile); @@ -265,21 +261,20 @@ public function getAuthJson() public function removeCredentials() { $serviceUrl = $this->getCredentialBaseUrl(); - $directory = $this->getFilesystem()->getDirectoryRead(DirectoryList::COMPOSER_HOME); + $directory = $this->getFilesystem() + ->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME); if ($directory->isExist($this->pathToAuthFile) && $directory->isReadable($this->pathToAuthFile)) { try { $authJsonData = $this->getAuthJson(); - if (!empty($authJsonData) && isset($authJsonData['http-basic'][$serviceUrl])) { + if (isset($authJsonData['http-basic']) && isset($authJsonData['http-basic'][$serviceUrl])) { unset($authJsonData['http-basic'][$serviceUrl]); - if (empty($authJsonData['http-basic'])) { - return unlink(getenv('COMPOSER_HOME') . DIRECTORY_SEPARATOR . $this->pathToAuthFile); + $path = \Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME + . DIRECTORY_SEPARATOR . $this->pathToAuthFile; + if ($authJsonData === ['http-basic' => []]) { + return $this->getDirectory()->delete($path); } else { $data = json_encode($authJsonData, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); - $this->getDirectory()->writeFile( - DirectoryList::COMPOSER_HOME . DIRECTORY_SEPARATOR . $this->pathToAuthFile, - $data - ); - return true; + return $data !== false && $this->getDirectory()->writeFile($path, $data); } } } catch (\Exception $e) { @@ -306,15 +301,17 @@ public function saveAuthJson($username, $password) ] ] ]; - $json = new JsonModel($authContent); + $json = new \Zend\View\Model\JsonModel($authContent); $json->setOption('prettyPrint', true); $jsonContent = $json->serialize(); return $this->getDirectory()->writeFile( - DirectoryList::COMPOSER_HOME . DIRECTORY_SEPARATOR . $this->pathToAuthFile, + \Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME . + DIRECTORY_SEPARATOR . $this->pathToAuthFile, $jsonContent ) && $this->getDirectory()->changePermissions( - DirectoryList::COMPOSER_HOME . DIRECTORY_SEPARATOR . $this->pathToAuthFile, + \Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME . + DIRECTORY_SEPARATOR . $this->pathToAuthFile, \Magento\Framework\Filesystem\DriverInterface::WRITEABLE_FILE_MODE ); } @@ -417,7 +414,7 @@ public function loadPackagesForInstallFromCache() } /** - * @return ServiceLocatorInterface + * @return \Zend\ServiceManager\ServiceLocatorInterface */ public function getServiceLocator() { @@ -449,7 +446,7 @@ public function getFilesystem() } /** - * @return Filesystem\Directory\Write|Filesystem\Directory\WriteInterface + * @return \Magento\Framework\Filesystem\Directory\WriteInterface */ public function getDirectory() { diff --git a/setup/src/Magento/Setup/Model/SystemPackage.php b/setup/src/Magento/Setup/Model/SystemPackage.php index 985c6480a484..6ac9b9d3a60b 100755 --- a/setup/src/Magento/Setup/Model/SystemPackage.php +++ b/setup/src/Magento/Setup/Model/SystemPackage.php @@ -58,15 +58,6 @@ public function getPackageVersions() $result = []; $systemPackages = []; $systemPackages = $this->getInstalledSystemPackages($systemPackages); - if (empty($systemPackages)) { - // git cloned Magento does not include system package - throw new \RuntimeException( - 'We\'re sorry, no components are available because you cloned the Magento 2 GitHub repository. ' . - 'You must manually update components as discussed in the ' . - '' . - 'Installation Guide.' - ); - } foreach ($systemPackages as $systemPackage) { $versions = []; $systemPackageInfo = $this->infoCommand->run($systemPackage); @@ -156,6 +147,7 @@ public function getSystemPackageVersions($systemPackageInfo, $versions) /** * @param array $systemPackages * @return array + * @throws \RuntimeException */ public function getInstalledSystemPackages($systemPackages) { @@ -175,6 +167,14 @@ public function getInstalledSystemPackages($systemPackages) } } } + if (empty($systemPackages)) { + throw new \RuntimeException( + 'We\'re sorry, no components are available because you cloned the Magento 2 GitHub repository. ' . + 'You must manually update components as discussed in the ' . + '' . + 'Installation Guide.' + ); + } return $systemPackages; } diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php index d0bcb4b3ac24..bb218249a432 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php @@ -14,7 +14,7 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Setup\Model\FilePermissions|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Setup\FilePermissions|\PHPUnit_Framework_MockObject_MockObject */ private $permissions; @@ -41,7 +41,7 @@ class EnvironmentTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $this->permissions = $this->getMock('Magento\Setup\Model\FilePermissions', [], [], '', false); + $this->permissions = $this->getMock('Magento\Framework\Setup\FilePermissions', [], [], '', false); $this->cronScriptReadinessCheck = $this->getMock( 'Magento\Setup\Model\CronScriptReadinessCheck', [], diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/SelectVersionTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/SelectVersionTest.php index 48b73674faff..3127dd297e48 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/SelectVersionTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/SelectVersionTest.php @@ -67,4 +67,33 @@ public function testSystemPackageActionActionWithError() $this->assertArrayHasKey('responseType', $variables); $this->assertEquals(ResponseTypeInterface::RESPONSE_TYPE_ERROR, $variables['responseType']); } + + public function testInstalledSystemPackageAction() + { + $this->systemPackage->expects($this->once()) + ->method('getInstalledSystemPackages') + ->willReturn([ + 'package' => 'magento/product-community-edition', + 'versions' => [ + 'id' => 'magento/product-community-edition', + 'name' => 'Version 1.0.0' + ] + ]); + $jsonModel = $this->controller->installedSystemPackageAction(); + $this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel); + $variables = $jsonModel->getVariables(); + $this->assertArrayHasKey('responseType', $variables); + $this->assertEquals(ResponseTypeInterface::RESPONSE_TYPE_SUCCESS, $variables['responseType']); + } + + public function testInstalledSystemPackageActionWithError() + { + $this->systemPackage->expects($this->once()) + ->method('getInstalledSystemPackages') + ->will($this->throwException(new \Exception("Test error message"))); + $jsonModel = $this->controller->installedSystemPackageAction(); + $variables = $jsonModel->getVariables(); + $this->assertArrayHasKey('responseType', $variables); + $this->assertEquals(ResponseTypeInterface::RESPONSE_TYPE_ERROR, $variables['responseType']); + } } diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/SessionTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/SessionTest.php index 9e03cf480b0f..bb826dda5e12 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/SessionTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/SessionTest.php @@ -31,7 +31,6 @@ public function setUp() $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', ['get'], [], '', false); $this->objectManager = $objectManager; $this->objectManagerProvider = $objectManagerProvider; - $this->serviceManager = $this->getMock('Zend\ServiceManager\ServiceManager', ['get'], [], '', false); } @@ -52,10 +51,12 @@ public function testUnloginAction() $sessionConfigMock = $this->getMock('Magento\Backend\Model\Session\AdminConfig', ['setCookiePath'], [], '', false); $sessionConfigMock->expects($this->once())->method('setCookiePath'); + $urlMock = $this->getMock('\Magento\Backend\Model\Url', [], [], '', false); $returnValueMap = [ ['Magento\Framework\App\State', $stateMock], - ['Magento\Backend\Model\Session\AdminConfig', $sessionConfigMock] + ['Magento\Backend\Model\Session\AdminConfig', $sessionConfigMock], + ['Magento\Backend\Model\Url', $urlMock] ]; $this->serviceManager->expects($this->once())->method('get')->will($this->returnValue($deployConfigMock)); @@ -69,6 +70,7 @@ public function testUnloginAction() ->method('create') ->will($this->returnValue($sessionMock)); $controller = new Session($this->serviceManager, $this->objectManagerProvider); + $urlMock->expects($this->once())->method('getBaseUrl'); $controller->prolongAction(); } diff --git a/setup/src/Magento/Setup/Test/Unit/Model/ConfigModelTest.php b/setup/src/Magento/Setup/Test/Unit/Model/ConfigModelTest.php index eabe0089b551..018626caa208 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/ConfigModelTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/ConfigModelTest.php @@ -37,7 +37,7 @@ class ConfigModelTest extends \PHPUnit_Framework_TestCase private $configData; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Setup\Model\FilePermissions + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Setup\FilePermissions */ private $filePermissions; @@ -53,7 +53,7 @@ public function setUp() $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); $this->configOptionsList = $this->getMock('Magento\Backend\Setup\ConfigOptionsList', [], [], '', false); $this->configData = $this->getMock('Magento\Framework\Config\Data\ConfigData', [], [], '', false); - $this->filePermissions = $this->getMock('\Magento\Setup\Model\FilePermissions', [], [], '', false); + $this->filePermissions = $this->getMock('\Magento\Framework\Setup\FilePermissions', [], [], '', false); $this->deploymentConfig->expects($this->any())->method('get'); diff --git a/setup/src/Magento/Setup/Test/Unit/Model/InstallerFactoryTest.php b/setup/src/Magento/Setup/Test/Unit/Model/InstallerFactoryTest.php index a93ac4d1a2ef..935843866855 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/InstallerFactoryTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/InstallerFactoryTest.php @@ -14,8 +14,8 @@ public function testCreate() { $returnValueMap = [ [ - 'Magento\Setup\Model\FilePermissions', - $this->getMock('Magento\Setup\Model\FilePermissions', [], [], '', false), + 'Magento\Framework\Setup\FilePermissions', + $this->getMock('Magento\Framework\Setup\FilePermissions', [], [], '', false), ], [ 'Magento\Framework\App\DeploymentConfig\Writer', diff --git a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php index e786f2795f1f..f45d9f6bbd90 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php @@ -27,7 +27,7 @@ class InstallerTest extends \PHPUnit_Framework_TestCase private $object; /** - * @var \Magento\Setup\Model\FilePermissions|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Setup\FilePermissions|\PHPUnit_Framework_MockObject_MockObject */ private $filePermissions; @@ -150,7 +150,7 @@ class InstallerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->filePermissions = $this->getMock('Magento\Setup\Model\FilePermissions', [], [], '', false); + $this->filePermissions = $this->getMock('Magento\Framework\Setup\FilePermissions', [], [], '', false); $this->configWriter = $this->getMock('Magento\Framework\App\DeploymentConfig\Writer', [], [], '', false); $this->configReader = $this->getMock('Magento\Framework\App\DeploymentConfig\Reader', [], [], '', false); $this->config = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); diff --git a/setup/src/Magento/Setup/Test/Unit/Model/MarketplaceManagerTest.php b/setup/src/Magento/Setup/Test/Unit/Model/MarketplaceManagerTest.php index dddc25279328..ec708eb61325 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/MarketplaceManagerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/MarketplaceManagerTest.php @@ -486,9 +486,12 @@ public function testRemoveCredentials() ->method('getCredentialBaseUrl') ->will($this->returnValue($this->checkingCredentialsUrl)); $marketplaceManager - ->expects($this->never()) + ->expects($this->once()) ->method('getDirectory') ->will($this->returnValue($directory)); + $directory + ->expects($this->once()) + ->method('delete'); $directory ->expects($this->never()) ->method('writeFile'); @@ -633,7 +636,6 @@ public function testGetPackagesForInstallEmptyData() ->method('loadPackagesForInstallFromCache') ->will($this->returnValue(false)); - $this->assertFalse($marketplaceManager->getPackagesForInstall()); } diff --git a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php index c01658ef232d..256f7b25921c 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php @@ -57,7 +57,7 @@ public function testCheckPhpVersionPrettyVersion() { $this->composerInfo->expects($this->once())->method('getRequiredPhpVersion')->willReturn('1.0'); $multipleConstraints = $this->getMockForAbstractClass( - 'Composer\Package\LinkConstraint\LinkConstraintInterface', + 'Composer\Semver\Constraint\ConstraintInterface', [], '', false @@ -68,7 +68,7 @@ public function testCheckPhpVersionPrettyVersion() ->willThrowException(new \UnexpectedValueException()); $this->versionParser->expects($this->at(2))->method('normalize')->willReturn('1.0'); $currentPhpVersion = $this->getMockForAbstractClass( - 'Composer\Package\LinkConstraint\LinkConstraintInterface', + 'Composer\Semver\Constraint\ConstraintInterface', [], '', false @@ -89,7 +89,7 @@ public function testCheckPhpVersionPrettyVersionFailed() { $this->composerInfo->expects($this->once())->method('getRequiredPhpVersion')->willReturn('1.0'); $multipleConstraints = $this->getMockForAbstractClass( - 'Composer\Package\LinkConstraint\LinkConstraintInterface', + 'Composer\Semver\Constraint\ConstraintInterface', [], '', false @@ -100,7 +100,7 @@ public function testCheckPhpVersionPrettyVersionFailed() ->willThrowException(new \UnexpectedValueException()); $this->versionParser->expects($this->at(2))->method('normalize')->willReturn('1.0'); $currentPhpVersion = $this->getMockForAbstractClass( - 'Composer\Package\LinkConstraint\LinkConstraintInterface', + 'Composer\Semver\Constraint\ConstraintInterface', [], '', false @@ -120,7 +120,7 @@ public function testCheckPhpVersionPrettyVersionFailed() private function setUpNoPrettyVersionParser() { $multipleConstraints = $this->getMockForAbstractClass( - 'Composer\Package\LinkConstraint\LinkConstraintInterface', + 'Composer\Semver\Constraint\ConstraintInterface', [], '', false @@ -128,7 +128,7 @@ private function setUpNoPrettyVersionParser() $this->versionParser->expects($this->at(0))->method('parseConstraints')->willReturn($multipleConstraints); $this->versionParser->expects($this->at(1))->method('normalize')->willReturn('1.0'); $currentPhpVersion = $this->getMockForAbstractClass( - 'Composer\Package\LinkConstraint\LinkConstraintInterface', + 'Composer\Semver\Constraint\ConstraintInterface', [], '', false @@ -156,7 +156,7 @@ public function testCheckPhpVersionFailed() { $this->composerInfo->expects($this->once())->method('getRequiredPhpVersion')->willReturn('1.0'); $multipleConstraints = $this->getMockForAbstractClass( - 'Composer\Package\LinkConstraint\LinkConstraintInterface', + 'Composer\Semver\Constraint\ConstraintInterface', [], '', false @@ -164,7 +164,7 @@ public function testCheckPhpVersionFailed() $this->versionParser->expects($this->at(0))->method('parseConstraints')->willReturn($multipleConstraints); $this->versionParser->expects($this->at(1))->method('normalize')->willReturn('1.0'); $currentPhpVersion = $this->getMockForAbstractClass( - 'Composer\Package\LinkConstraint\LinkConstraintInterface', + 'Composer\Semver\Constraint\ConstraintInterface', [], '', false diff --git a/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php b/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php index b87f8f130c3a..b9dde9b9176a 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php @@ -263,7 +263,7 @@ public function testGetAllowedEnterpriseVersions($ceCurrentVersion, $expectedRes ->with('magento/product-enterprise-edition') ->willReturn(['available_versions' => ['1.0.0', '1.0.1', '1.0.2']]); $require = $this->getMock('\Composer\Package\Link', [], [], '', false); - $constraintMock = $this->getMock('\Composer\Package\LinkConstraint\VersionConstraint', [], [], '', false); + $constraintMock = $this->getMock('\Composer\Semver\Constraint\Constraint', [], [], '', false); $constraintMock->expects($this->any())->method('getPrettyString') ->willReturn('1.0.1'); $require->expects($this->any()) diff --git a/setup/view/layout/layout.phtml b/setup/view/layout/layout.phtml index 274f5e3d366b..2cc0e6ef3b6b 100644 --- a/setup/view/layout/layout.phtml +++ b/setup/view/layout/layout.phtml @@ -45,6 +45,7 @@ ->appendFile($this->basePath() . '/pub/magento/setup/home.js') ->appendFile($this->basePath() . '/pub/magento/setup/auth-dialog.js') ->appendFile($this->basePath() . '/pub/magento/setup/system-config.js') + ->appendFile($this->basePath() . '/pub/magento/setup/marketplace-credentials.js') ->appendFile($this->basePath() . '/pub/magento/setup/install-extension-grid.js'); ?> + diff --git a/setup/view/magento/setup/popupauth.phtml b/setup/view/magento/setup/popupauth.phtml index 1a4593f8647b..24be0eb00a3f 100644 --- a/setup/view/magento/setup/popupauth.phtml +++ b/setup/view/magento/setup/popupauth.phtml @@ -36,9 +36,26 @@ >
    - Sign in to sync your Magento Marketplace Purchases + To upgrade or install purchases, enter your access keys
    + + + + + + + + + + + + + +
    Need to find your keys?
    1. Go to your + Magento Marketplace account page. +
    2. On the "Access keys" page, copy your public and private keys.
    3. Enter keys below: