diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/FlatTableBuilderTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/FlatTableBuilderTest.php index c57dd950dc3e01c038631b52d2eb76657f1c25b1..7e5a8305467e8e979a9ccc79d39d7ffdb70bb339 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/FlatTableBuilderTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/FlatTableBuilderTest.php @@ -141,7 +141,7 @@ class FlatTableBuilderTest extends \PHPUnit_Framework_TestCase [$tableName], ['catalog_product_website'] ) - ->willReturn( + ->willReturnOnConsecutiveCalls( $tableName, 'catalog_product_website' ); @@ -184,12 +184,12 @@ class FlatTableBuilderTest extends \PHPUnit_Framework_TestCase ], [ $temporaryTableName, - "e.{$linkField} = ${temporaryTableName}.{$linkField}", + "e.{$linkField} = {$temporaryTableName}.{$linkField}", [$linkField] ], [ $temporaryValueTableName, - "e.${linkField} = " . $temporaryValueTableName . ".${linkField}", + "e.{$linkField} = " . $temporaryValueTableName . ".{$linkField}", [$linkField] ] )->willReturnSelf(); diff --git a/app/code/Magento/Indexer/Setup/RecurringData.php b/app/code/Magento/Indexer/Setup/RecurringData.php new file mode 100644 index 0000000000000000000000000000000000000000..bd6f8f0241dc81cf5a632a355f5193c82e180023 --- /dev/null +++ b/app/code/Magento/Indexer/Setup/RecurringData.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © 2016 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Indexer\Setup; + +use Magento\Framework\Setup\InstallDataInterface; +use Magento\Framework\Setup\ModuleContextInterface; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Indexer\Model\IndexerFactory; +use Magento\Framework\Indexer\ConfigInterface; + +/** + * Recurring data upgrade for indexer module + */ +class RecurringData implements InstallDataInterface +{ + /** + * @var IndexerFactory + */ + private $indexerFactory; + + /** + * @var ConfigInterface + */ + private $configInterface; + + /** + * RecurringData constructor. + * + * @param IndexerFactory $indexerFactory + * @param ConfigInterface $configInterface + */ + public function __construct( + IndexerFactory $indexerFactory, + ConfigInterface $configInterface + ) { + $this->indexerFactory = $indexerFactory; + $this->configInterface = $configInterface; + } + + /** + * {@inheritdoc} + */ + public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) + { + foreach (array_keys($this->configInterface->getIndexers()) as $indexerId) { + $indexer = $this->indexerFactory->create()->load($indexerId); + if ($indexer->isScheduled()) { + $indexer->getView()->unsubscribe()->subscribe(); + } + } + } +} diff --git a/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php b/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php index 1e1d217715d260e5f43c437b7a91431215d338f1..4b656ee299dddc04527d2be6145b49e3098c3578 100644 --- a/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php +++ b/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php @@ -602,7 +602,9 @@ abstract class AbstractProduct extends \Magento\Rule\Model\Condition\AbstractCon */ public function getMappedSqlField() { - if (!$this->isAttributeSetOrCategory()) { + if ($this->getAttribute() == 'sku') { + $mappedSqlField = 'e.sku'; + } elseif (!$this->isAttributeSetOrCategory()) { $mappedSqlField = $this->getEavAttributeTableAlias() . '.value'; } elseif ($this->getAttribute() == 'category_ids') { $mappedSqlField = 'e.entity_id'; diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml index da44fd2eaf99e55e925d9c946b6d7e8ee8370408..58435b066261ed28cc7f33ff01fc250940b6eb17 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/CreateConfigurableProductEntityTest.xml @@ -110,7 +110,7 @@ <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertConfigurableProductPage" /> </variation> <variation name="CreateConfigurableProductEntityTestVariation6" summary="Create Configurable Product with Creating New Category and New Attribute (Required Fields Only)" ticketId="MAGETWO-13361"> - <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, stable:no</data> + <data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test</data> <data name="product/data/configurable_attributes_data/dataset" xsi:type="string">two_searchable_options</data> <data name="product/data/name" xsi:type="string">Configurable Product %isolation%</data> <data name="product/data/sku" xsi:type="string">configurable_sku_%isolation%</data> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/testcase.xml index 9880acee6bbccfb7c3569d136a3f1cf4ce479055..d34a96100f74e9b087ed3415e21a571dadb5ca44 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/testcase.xml @@ -13,7 +13,8 @@ <step name="createProducts" module="Magento_Catalog" next="addProducts"/> <step name="addProducts" module="Magento_Sales" next="updateProductsData"/> <step name="updateProductsData" module="Magento_Sales" next="fillBillingAddress"/> - <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder"/> + <step name="fillBillingAddress" module="Magento_Sales" next="fillShippingAddress"/> + <step name="fillShippingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder"/> <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder"/> <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder"/> <step name="submitOrder" module="Magento_Sales"/> diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/etc/testcase.xml index 53f10b10d38b6329a9b5119088e89443fb85105c..89cf35b73bc3ed292a152358fd5265a71d566983 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/etc/testcase.xml @@ -79,7 +79,8 @@ <step name="selectStore" module="Magento_Sales" next="addProducts" /> <step name="addProducts" module="Magento_Sales" next="fillAccountInformation" /> <step name="fillAccountInformation" module="Magento_Sales" next="fillBillingAddress" /> - <step name="fillBillingAddress" module="Magento_Sales" next="selectShippingMethodForOrder" /> + <step name="fillBillingAddress" module="Magento_Sales" next="fillShippingAddress" /> + <step name="fillShippingAddress" module="Magento_Sales" next="selectShippingMethodForOrder" /> <step name="selectShippingMethodForOrder" module="Magento_Sales" next="saveCreditCardOnBackend" /> <step name="saveCreditCardOnBackend" module="Magento_Vault" next="submitOrderNegative" /> <step name="submitOrderNegative" module="Magento_Sales" /> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php index b86ac18ea3dd4a70a5b3ba2530edbf89cfe1068c..c25b96a624bfda79865d81f73f3208f0bc38d74a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php @@ -291,29 +291,28 @@ class Create extends Block $saveAddress = 'No', $setShippingAddress = true ) { - if ($setShippingAddress) { + if ($setShippingAddress !== false) { $this->getShippingAddressBlock()->uncheckSameAsBillingShippingAddress(); } $this->getBillingAddressBlock()->fill($billingAddress); $this->getBillingAddressBlock()->saveInAddressBookBillingAddress($saveAddress); $this->getTemplateBlock()->waitLoader(); + if ($setShippingAddress) { + $this->getShippingAddressBlock()->setSameAsBillingShippingAddress(); + $this->getTemplateBlock()->waitLoader(); + } } /** * Fill Shipping Address. * - * @param FixtureInterface $shippingAddress [optional] + * @param FixtureInterface $shippingAddress * @return void */ - public function fillShippingAddress(FixtureInterface $shippingAddress = null) + public function fillShippingAddress(FixtureInterface $shippingAddress) { - if (!$shippingAddress) { - $this->getShippingAddressBlock()->setSameAsBillingShippingAddress(); - $this->getTemplateBlock()->waitLoader(); - } else { - $this->getShippingAddressBlock()->fill($shippingAddress); - $this->getTemplateBlock()->waitLoader(); - } + $this->getShippingAddressBlock()->fill($shippingAddress); + $this->getTemplateBlock()->waitLoader(); } /** diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php index f6d0c8325bfc38500c4cd5a5d7289e8b3416439a..4d8321e1d9b2bd04780a06b1a61621b34aae387b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php @@ -29,6 +29,13 @@ class FillBillingAddressStep implements TestStepInterface */ protected $billingAddress; + /** + * Shipping Address fixture. + * + * @var Address + */ + protected $shippingAddress; + /** * Save Address. * @@ -46,17 +53,20 @@ class FillBillingAddressStep implements TestStepInterface /** * @param OrderCreateIndex $orderCreateIndex * @param Address $billingAddress - * @param string $saveAddress + * @param Address $shippingAddress [optional] + * @param string $saveAddress [optional] * @param bool $setShippingAddress [optional] */ public function __construct( OrderCreateIndex $orderCreateIndex, Address $billingAddress, + Address $shippingAddress = null, $saveAddress = 'No', $setShippingAddress = true ) { $this->orderCreateIndex = $orderCreateIndex; $this->billingAddress = $billingAddress; + $this->shippingAddress = $shippingAddress; $this->saveAddress = $saveAddress; $this->setShippingAddress = $setShippingAddress; } @@ -68,6 +78,9 @@ class FillBillingAddressStep implements TestStepInterface */ public function run() { + if ($this->shippingAddress !== null) { + $this->setShippingAddress = null; + } $this->orderCreateIndex->getCreateBlock() ->fillBillingAddress($this->billingAddress, $this->saveAddress, $this->setShippingAddress); diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillShippingAddressStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillShippingAddressStep.php index 8ff05dfca95bb016b4b72e5db07f5fa2ffb139ca..a9d6433c6695830cee27a4589c401b3d9dcf4a34 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillShippingAddressStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillShippingAddressStep.php @@ -48,6 +48,8 @@ class FillShippingAddressStep implements TestStepInterface */ public function run() { - $this->orderCreateIndex->getCreateBlock()->fillShippingAddress($this->shippingAddress); + if ($this->shippingAddress !== null) { + $this->orderCreateIndex->getCreateBlock()->fillShippingAddress($this->shippingAddress); + } } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml index ec2da3f2607b2dda7e4b375e11192f9844d839fd..eebdf2128dc70e8dc90a0867040e1e3682462768 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml @@ -11,7 +11,8 @@ <step name="createOrder" module="Magento_Sales" next="openOrder" /> <step name="openOrder" module="Magento_Sales" next="reorder" /> <step name="reorder" module="Magento_Sales" next="fillBillingAddress" /> - <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder" /> + <step name="fillBillingAddress" module="Magento_Sales" next="fillShippingAddress" /> + <step name="fillShippingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder" /> <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder" /> <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder" /> <step name="submitOrder" module="Magento_Sales" /> @@ -42,7 +43,8 @@ <step name="selectCustomerOrder" module="Magento_Sales" next="selectStore" /> <step name="selectStore" module="Magento_Sales" next="addProducts" /> <step name="addProducts" module="Magento_Sales" next="fillBillingAddress" /> - <step name="fillBillingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder" /> + <step name="fillBillingAddress" module="Magento_Sales" next="fillShippingAddress" /> + <step name="fillShippingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder" /> <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder" /> <step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder" /> <step name="submitOrder" module="Magento_Sales" next="openSalesOrderOnFrontendForGuest" /> @@ -61,7 +63,8 @@ <step name="addProducts" module="Magento_Sales" next="updateProductsData" /> <step name="updateProductsData" module="Magento_Sales" next="fillAccountInformation" /> <step name="fillAccountInformation" module="Magento_Sales" next="fillBillingAddress" /> - <step name="fillBillingAddress" module="Magento_Sales" next="selectShippingMethodForOrder" /> + <step name="fillBillingAddress" module="Magento_Sales" next="fillShippingAddress" /> + <step name="fillShippingAddress" module="Magento_Sales" next="selectShippingMethodForOrder" /> <step name="selectShippingMethodForOrder" module="Magento_Sales" next="selectPaymentMethodForOrder" /> <step name="selectPaymentMethodForOrder" module="Magento_Sales" next="submitOrder" /> <step name="submitOrder" module="Magento_Sales" next="createInvoice" /> diff --git a/dev/tests/functional/tests/app/Magento/Setup/Test/TestCase/UpgradeSystemTest.php b/dev/tests/functional/tests/app/Magento/Setup/Test/TestCase/UpgradeSystemTest.php index 43c101176bdac80f4540c013f13b58d9b4a600d9..1314c1503b2f310db1ff80b461b05de986962935 100644 --- a/dev/tests/functional/tests/app/Magento/Setup/Test/TestCase/UpgradeSystemTest.php +++ b/dev/tests/functional/tests/app/Magento/Setup/Test/TestCase/UpgradeSystemTest.php @@ -74,7 +74,7 @@ class UpgradeSystemTest extends Injectable ); $version = $upgrade['upgradeVersion']; - $suffix = "( (CE|EE))$"; + $suffix = "( (CE|EE|B2B))$"; $normalVersion = '(0|[1-9]\d*)'; $preReleaseVersion = "((0(?!\\d+(\\.|\\+|{$suffix}))|[1-9A-Za-z])[0-9A-Za-z-]*)"; $buildVersion = '([0-9A-Za-z][0-9A-Za-z-]*)'; diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Vault/Test/etc/testcase.xml index 6b4f31a329d679872c48841cfad346c53012ac7d..cd34b9664820892b4275c93e7b7e43afaaf2f1e4 100644 --- a/dev/tests/functional/tests/app/Magento/Vault/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/etc/testcase.xml @@ -37,7 +37,8 @@ <step name="selectStore" module="Magento_Sales" next="addProducts" /> <step name="addProducts" module="Magento_Sales" next="fillAccountInformation" /> <step name="fillAccountInformation" module="Magento_Sales" next="fillBillingAddress" /> - <step name="fillBillingAddress" module="Magento_Sales" next="selectShippingMethodForOrder" /> + <step name="fillBillingAddress" module="Magento_Sales" next="fillShippingAddress" /> + <step name="fillShippingAddress" module="Magento_Sales" next="selectShippingMethodForOrder" /> <step name="selectShippingMethodForOrder" module="Magento_Sales" next="saveCreditCardOnBackend" /> <step name="saveCreditCardOnBackend" module="Magento_Vault" next="submitOrder" /> <step name="submitOrder" module="Magento_Sales" next="reorder" /> diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/ModuleDBChangeTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/ModuleDBChangeTest.php index 4029454ee523052fedcc9592b778fea9704b7abf..87bd329ef3b5611475c6ee9486cdc9f27c4ea5fe 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/ModuleDBChangeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/ModuleDBChangeTest.php @@ -22,6 +22,16 @@ class ModuleDBChangeTest extends \PHPUnit_Framework_TestCase */ protected static $changedFileList = ''; + /** + * @var string Path for Magento's composer.json + */ + protected static $composerFilePath = BP . '/composer.json'; + + /** + * @var bool Is tests executes on develop branch + */ + protected static $isOnDevVersion = false; + /** * Set changed files paths and list for all projects */ @@ -30,6 +40,13 @@ class ModuleDBChangeTest extends \PHPUnit_Framework_TestCase foreach (glob(self::$changedFilesPattern) as $changedFile) { self::$changedFileList .= file_get_contents($changedFile) . PHP_EOL; } + + if (file_exists(self::$composerFilePath)) { + $jsonData = json_decode(file_get_contents(self::$composerFilePath)); + if (substr((string) $jsonData->version, -4) == '-dev') { + self::$isOnDevVersion = true; + } + } } /** @@ -37,6 +54,9 @@ class ModuleDBChangeTest extends \PHPUnit_Framework_TestCase */ public function testModuleXmlFiles() { + if (self::$isOnDevVersion) { + $this->markTestSkipped('This test isn\'t applicable to the developer version of Magento'); + } preg_match_all('|etc/module\.xml$|mi', self::$changedFileList, $matches); $this->assertEmpty( reset($matches), @@ -50,6 +70,9 @@ class ModuleDBChangeTest extends \PHPUnit_Framework_TestCase */ public function testModuleSetupFiles() { + if (self::$isOnDevVersion) { + $this->markTestSkipped('This test isn\'t applicable to the developer version of Magento'); + } preg_match_all('|app/code/Magento/[^/]+/Setup/[^/]+$|mi', self::$changedFileList, $matches); $this->assertEmpty( reset($matches), diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index cd7a236f723590ffe5138fa063dabfa5968c8c3b..2cbf5da0bfbbba3ab562942c068913f5d0f12069 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -40,13 +40,13 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->connectionMock = $this->getMock(\Magento\Framework\DB\Adapter\Pdo\Mysql::class, [], [], '', false); - $this->resourceMock = $this->getMock( - \Magento\Framework\App\ResourceConnection::class, - [], - [], - '', - false, - false + $this->resourceMock = $this->getMock( + \Magento\Framework\App\ResourceConnection::class, + [], + [], + '', + false, + false ); $this->connectionMock->expects($this->any()) @@ -57,19 +57,19 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase ->method('getConnection') ->willReturn($this->connectionMock); - $this->triggerFactoryMock = $this->getMock( + $this->triggerFactoryMock = $this->getMock( \Magento\Framework\DB\Ddl\TriggerFactory::class, [], [], '', false, false ); - $this->viewCollectionMock = $this->getMockForAbstractClass( + $this->viewCollectionMock = $this->getMockForAbstractClass( \Magento\Framework\Mview\View\CollectionInterface::class, [], '', false, false, true, [] ); - $this->viewMock = $this->getMockForAbstractClass( + $this->viewMock = $this->getMockForAbstractClass( \Magento\Framework\Mview\ViewInterface::class, [], '', false, false, true, [] ); $this->resourceMock->expects($this->any()) ->method('getTableName') - ->willReturn($this->tableName); + ->will($this->returnArgument(0)); $this->model = new Subscription( $this->resourceMock, @@ -96,11 +96,15 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase $this->assertEquals('columnName', $this->model->getColumnName()); } + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ public function testCreate() { $triggerName = 'trigger_name'; $this->resourceMock->expects($this->atLeastOnce())->method('getTriggerName')->willReturn($triggerName); $triggerMock = $this->getMockBuilder(\Magento\Framework\DB\Ddl\Trigger::class) + ->setMethods(['setName', 'getName', 'setTime', 'setEvent', 'setTable', 'addStatement']) ->disableOriginalConstructor() ->getMock(); $triggerMock->expects($this->exactly(3)) @@ -121,11 +125,38 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase ->method('setTable') ->with($this->tableName) ->will($this->returnSelf()); - $triggerMock->expects($this->exactly(6)) + + $triggerMock->expects($this->at(4)) + ->method('addStatement') + ->with("INSERT IGNORE INTO test_view_cl (entity_id) VALUES (NEW.columnName);") + ->will($this->returnSelf()); + + $triggerMock->expects($this->at(5)) + ->method('addStatement') + ->with("INSERT IGNORE INTO other_test_view_cl (entity_id) VALUES (NEW.columnName);") + ->will($this->returnSelf()); + + $triggerMock->expects($this->at(11)) + ->method('addStatement') + ->with("INSERT IGNORE INTO test_view_cl (entity_id) VALUES (NEW.columnName);") + ->will($this->returnSelf()); + + $triggerMock->expects($this->at(12)) + ->method('addStatement') + ->with("INSERT IGNORE INTO other_test_view_cl (entity_id) VALUES (NEW.columnName);") + ->will($this->returnSelf()); + + $triggerMock->expects($this->at(18)) + ->method('addStatement') + ->with("INSERT IGNORE INTO test_view_cl (entity_id) VALUES (OLD.columnName);") + ->will($this->returnSelf()); + + $triggerMock->expects($this->at(19)) ->method('addStatement') + ->with("INSERT IGNORE INTO other_test_view_cl (entity_id) VALUES (OLD.columnName);") ->will($this->returnSelf()); - $changelogMock = $this->getMockForAbstractClass( + $changelogMock = $this->getMockForAbstractClass( \Magento\Framework\Mview\View\ChangelogInterface::class, [], '', false, false, true, [] ); $changelogMock->expects($this->exactly(3)) @@ -143,7 +174,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase ->method('create') ->will($this->returnValue($triggerMock)); - $otherChangelogMock = $this->getMockForAbstractClass( + $otherChangelogMock = $this->getMockForAbstractClass( \Magento\Framework\Mview\View\ChangelogInterface::class, [], '', false, false, true, [] ); $otherChangelogMock->expects($this->exactly(3)) @@ -153,7 +184,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase ->method('getColumnName') ->will($this->returnValue('entity_id')); - $otherViewMock = $this->getMockForAbstractClass( + $otherViewMock = $this->getMockForAbstractClass( \Magento\Framework\Mview\ViewInterface::class, [], '', false, false, true, [] ); $otherViewMock->expects($this->exactly(1)) @@ -216,7 +247,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase ->method('create') ->will($this->returnValue($triggerMock)); - $otherChangelogMock = $this->getMockForAbstractClass( + $otherChangelogMock = $this->getMockForAbstractClass( \Magento\Framework\Mview\View\ChangelogInterface::class, [], '', false, false, true, [] ); $otherChangelogMock->expects($this->exactly(3)) @@ -226,7 +257,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase ->method('getColumnName') ->will($this->returnValue('entity_id')); - $otherViewMock = $this->getMockForAbstractClass( + $otherViewMock = $this->getMockForAbstractClass( \Magento\Framework\Mview\ViewInterface::class, [], '', false, false, true, [] ); $otherViewMock->expects($this->exactly(1)) diff --git a/lib/internal/Magento/Framework/Mview/etc/mview.xsd b/lib/internal/Magento/Framework/Mview/etc/mview.xsd index d171699c3784a8437985b6d741b0bc5d8297373a..0521691e852368d1e157733ff31e71c3ea41a07f 100644 --- a/lib/internal/Magento/Framework/Mview/etc/mview.xsd +++ b/lib/internal/Magento/Framework/Mview/etc/mview.xsd @@ -106,7 +106,7 @@ <xs:simpleType name="subscriptionModelType"> <xs:annotation> <xs:documentation> - Subscription model must be a valid PHP class or interface name. + DEPRECATED. Subscription model must be a valid PHP class or interface name. </xs:documentation> </xs:annotation> <xs:restriction base="xs:string">