Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Browse files Browse the repository at this point in the history
Accepted Community Pull Requests:
 - #27519: PhpUnit 8 Migration - Framework & AdminAnalytics (by @ihor-sviziev)
 - #27322: MFTF: Add `<magentoCron` instruction - Magento: Backend / Braintree / Captcha (by @lbajsarowicz)
 - #27321: MFTF: Add `<magentoCron` instruction - Magento_Bundle (by @lbajsarowicz)
  • Loading branch information
slavvka authored Apr 9, 2020
2 parents e344d30 + a9c148c commit 42e615f
Show file tree
Hide file tree
Showing 38 changed files with 50 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,27 @@
use Magento\Framework\App\ProductMetadataInterface;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Magento\Framework\App\CacheInterface;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

/**
* Class CanViewNotificationTest
*/
class CanViewNotificationTest extends \PHPUnit\Framework\TestCase
class CanViewNotificationTest extends TestCase
{
/** @var CanViewNotification */
private $canViewNotification;

/** @var Logger|\PHPUnit_Framework_MockObject_MockObject */
/** @var Logger|MockObject */
private $viewerLoggerMock;

/** @var ProductMetadataInterface|\PHPUnit_Framework_MockObject_MockObject */
/** @var ProductMetadataInterface|MockObject */
private $productMetadataMock;

/** @var Log|\PHPUnit_Framework_MockObject_MockObject */
/** @var Log|MockObject */
private $logMock;

/** @var $cacheStorageMock \PHPUnit_Framework_MockObject_MockObject|CacheInterface */
/** @var $cacheStorageMock MockObject|CacheInterface */
private $cacheStorageMock;

public function setUp()
protected function setUp(): void
{
$this->cacheStorageMock = $this->getMockBuilder(CacheInterface::class)
->getMockForAbstractClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<field key="firstname">John1</field>
<field key="lastname">Doe1</field>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<!-- Reset admin order filter -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<createData entity="Simple_US_Customer" stepKey="customer"/>
<createData entity="BraintreeConfig" stepKey="BraintreeConfigurationData"/>
<createData entity="CustomBraintreeConfigurationData" stepKey="CustomBraintreeConfigurationData"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>

<after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

<!--Create New Customer-->
<createData stepKey="createCustomer" entity="Simple_US_Customer"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
<field key="group_id">3</field>
</createData>

<magentoCron stepKey="runCronIndex" groups="index"/>

<!--Login as Admin User-->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@
<requiredEntity createDataKey="createBundleOption1_2"/>
<requiredEntity createDataKey="simpleProduct4"/>
</createData>

<magentoCron stepKey="runCronIndex" groups="index"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@
<requiredEntity createDataKey="createBundleRadioButtonsOption"/>
<requiredEntity createDataKey="simpleProduct2"/>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@
<requiredEntity createDataKey="createBundleOption1_2"/>
<requiredEntity createDataKey="simpleProduct4"/>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct3"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
<!--Admin login-->
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
</before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
<requiredEntity createDataKey="bundleOption"/>
<requiredEntity createDataKey="createSimpleProduct2"/>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>

<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
<argument name="productId" value="$$createProduct.id$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<before>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<createData entity="ApiBundleProductPriceViewRange" stepKey="createDynamicBundleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<createData entity="FixedBundleProduct" stepKey="createFixedBundleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct0"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<!-- Delete the bundled product -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct3"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct4"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<!--Clear Filters-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>

<magentoCron stepKey="runCronIndex" groups="index"/>
<!-- Admin Login-->
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
</before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<!-- Delete the bundled product we created in the test body -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<before>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<requiredEntity createDataKey="createBundleOption"/>
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<!-- Delete Simple Product -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>

<magentoCron stepKey="runCronIndex" groups="index"/>
<!--Admin login-->
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
</before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<before>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
</before>
<after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<!-- Delete the bundled product -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>

<!--Admin login-->
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct3"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct4"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<!--Clear Filters-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<before>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>

<after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<createData entity="SimpleProduct2" stepKey="simpleProduct8"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct9"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct10"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>

<magentoCron stepKey="runCronIndex" groups="index"/>
<!-- Admin Login-->
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
<actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct3"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct4"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<!--Logging out-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>

<magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<!-- Delete the bundled product -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<createData entity="ApiSimpleProduct" stepKey="createSimpleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<magentoCLI command="config:set checkout/options/guest_checkout 1" stepKey="enableGuestCheckout"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4254,5 +4254,7 @@
['Magento\Elasticsearch\Elasticsearch5\Model\Adapter\DataMapper\ProductDataMapperProxy'],
['Magento\Elasticsearch\Elasticsearch5\Model\Adapter\DataMapper\ProductDataMapper'],
['Magento\Elasticsearch\Model\Adapter\DataMapper\DataMapperResolver'],
['Magento\Elasticsearch\Model\Adapter\Container\Attribute']
['Magento\Elasticsearch\Model\Adapter\Container\Attribute'],
['PHPUnit_Framework_MockObject_MockObject', 'PHPUnit\Framework\MockObject\MockObject'],
['PHPUnit\Framework\BaseTestListener'],
];

0 comments on commit 42e615f

Please sign in to comment.