Skip to content

Commit

Permalink
Merge pull request #4194 from magento-engcom/MAGETWO-99645
Browse files Browse the repository at this point in the history
Fixed issues:
- MAGETWO-99645 Integration of Allure reports in Magento 2.2
  • Loading branch information
slavvka authored May 14, 2019
2 parents 3a49c28 + 911f546 commit 0175f09
Show file tree
Hide file tree
Showing 16 changed files with 323 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function getMemorizedDataProvider(): array
/**
* Test method isMemorizingAllowed.
*
* @aram bool|null $variableValue
* @param bool|null $variableValue
* @param bool $flag
* @param bool $expected
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface;
use Magento\ConfigurableProduct\Model\Product\Type\Collection\SalableProcessor;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable\AttributeFactory;
use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection;
use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\CollectionFactory;
use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\Collection as ProductCollection;
use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\CollectionFactory
as ProductCollectionFactory;
use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\ConfigurableFactory;
use Magento\Customer\Model\Session;
use Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend;
Expand All @@ -27,7 +30,6 @@
* @SuppressWarnings(PHPMD.LongVariable)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.TooManyFields)
* @codingStandardsIgnoreFile
*/
class ConfigurableTest extends \PHPUnit\Framework\TestCase
{
Expand Down Expand Up @@ -154,8 +156,7 @@ protected function setUp()
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
$this->productCollectionFactory = $this->getMockBuilder(
\Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\CollectionFactory::class)
$this->productCollectionFactory = $this->getMockBuilder(ProductCollectionFactory::class)
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
Expand Down Expand Up @@ -281,8 +282,7 @@ public function testSave()
$product->expects($this->atLeastOnce())
->method('getData')
->willReturnMap($dataMap);
$attribute = $this->getMockBuilder(
\Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class)
$attribute = $this->getMockBuilder(Attribute::class)
->disableOriginalConstructor()
->setMethods(['addData', 'setStoreId', 'setProductId', 'save', '__wakeup', '__sleep'])
->getMock();
Expand Down Expand Up @@ -464,8 +464,7 @@ public function testGetConfigurableAttributesAsArray($productStore)
$eavAttribute->expects($this->once())->method('getSource')->willReturn($attributeSource);
$eavAttribute->expects($this->atLeastOnce())->method('getStoreLabel')->willReturn('Store Label');

$attribute = $this->getMockBuilder(
\Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class)
$attribute = $this->getMockBuilder(Attribute::class)
->disableOriginalConstructor()
->setMethods(['getProductAttribute', '__wakeup', '__sleep'])
->getMock();
Expand Down Expand Up @@ -524,7 +523,7 @@ public function testGetConfigurableAttributesNewProduct()
$this->assertEquals([], $this->model->getConfigurableAttributes($product));
}

public function testGetConfigurableAttributes()
public function testGetConfigurableAttributes()
{
$configurableAttributes = '_cache_instance_configurable_attributes';

Expand Down Expand Up @@ -591,8 +590,7 @@ public function testHasOptionsConfigurableAttribute()
->setMethods(['__wakeup', 'getAttributeCode', 'getOptions', 'hasData', 'getData'])
->disableOriginalConstructor()
->getMock();
$attributeMock = $this->getMockBuilder(
\Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class)
$attributeMock = $this->getMockBuilder(Attribute::class)
->disableOriginalConstructor()
->getMock();

Expand Down Expand Up @@ -698,7 +696,7 @@ function ($value) {
->disableOriginalConstructor()
->getMock();
$usedAttributeMock = $this->getMockBuilder(
\Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class
Attribute::class
)
->setMethods(['getProductAttribute'])
->disableOriginalConstructor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function testSalesOrderBeforeSaveSetForced()
* The method should check that the payment is available, as this is not always the case.
*
* @expectedException \Magento\Framework\Exception\LocalizedException
* @exceptedExceptionMessage Please provide payment for the order.
* @expectedExceptionMessage Please provide payment for the order.
*/
public function testDoesNothingWhenNoPaymentIsAvailable()
{
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"ramsey/uuid": "~3.7.3"
},
"require-dev": {
"allure-framework/allure-phpunit": "~1.2.0",
"magento/magento2-functional-testing-framework": "2.4.0",
"phpunit/phpunit": "~6.2.0",
"squizlabs/php_codesniffer": "3.2.2",
Expand Down
98 changes: 97 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions dev/tests/api-functional/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,61 @@
<!-- Test listeners -->
<listeners>
<listener class="Magento\TestFramework\Event\PhpUnit"/>
<listener class="Yandex\Allure\Adapter\AllureAdapter">
<arguments>
<string>var/allure-results</string> <!-- XML files output folder -->
<boolean>true</boolean> <!-- Whether to delete previous results on rerun -->
<array> <!-- A list of custom annotations to ignore (optional) -->
<element key="codingStandardsIgnoreFile">
<string>codingStandardsIgnoreFile</string>
</element>
<element key="codingStandardsIgnoreStart">
<string>codingStandardsIgnoreStart</string>
</element>
<element key="codingStandardsIgnoreEnd">
<string>codingStandardsIgnoreEnd</string>
</element>
<element key="expectedExceptionMessageRegExp">
<string>expectedExceptionMessageRegExp</string>
</element>
<element key="magentoAdminConfigFixture">
<string>magentoAdminConfigFixture</string>
</element>
<element key="magentoAppArea">
<string>magentoAppArea</string>
</element>
<element key="magentoAppIsolation">
<string>magentoAppIsolation</string>
</element>
<element key="magentoCache">
<string>magentoCache</string>
</element>
<element key="magentoComponentsDir">
<string>magentoComponentsDir</string>
</element>
<element key="magentoConfigFixture">
<string>magentoConfigFixture</string>
</element>
<element key="magentoDataFixture">
<string>magentoDataFixture</string>
</element>
<element key="magentoDataFixtureBeforeTransaction">
<string>magentoDataFixtureBeforeTransaction</string>
</element>
<element key="magentoDbIsolation">
<string>magentoDbIsolation</string>
</element>
<element key="magentoIndexerDimensionMode">
<string>magentoIndexerDimensionMode</string>
</element>
<element key="magentoApiDataFixture">
<string>magentoApiDataFixture</string>
</element>
<element key="Override">
<string>Override</string>
</element>
</array>
</arguments>
</listener>
</listeners>
</phpunit>
28 changes: 28 additions & 0 deletions dev/tests/integration/framework/tests/unit/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,32 @@
<php>
<ini name="date.timezone" value="America/Los_Angeles"/>
</php>
<listeners>
<listener class="Yandex\Allure\Adapter\AllureAdapter">
<arguments>
<string>var/allure-results</string> <!-- XML files output directory -->
<boolean>true</boolean> <!-- Whether to delete previous results on rerun -->
<array> <!-- A list of custom annotations to ignore (optional) -->
<element key="magentoAdminConfigFixture">
<string>magentoAdminConfigFixture</string>
</element>
<element key="magentoAppIsolation">
<string>magentoAppIsolation</string>
</element>
<element key="magentoComponentsDir">
<string>magentoComponentsDir</string>
</element>
<element key="magentoConfigFixture">
<string>magentoConfigFixture</string>
</element>
<element key="@magentoDbIsolation">
<string>magentoDataFixture</string>
</element>
<element key="magentoDbIsolation">
<string>magentoDbIsolation</string>
</element>
</array>
</arguments>
</listener>
</listeners>
</phpunit>
53 changes: 53 additions & 0 deletions dev/tests/integration/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,58 @@
<listeners>
<listener class="Magento\TestFramework\Event\PhpUnit"/>
<listener class="Magento\TestFramework\ErrorLog\Listener"/>
<listener class="Yandex\Allure\Adapter\AllureAdapter">
<arguments>
<string>var/allure-results</string> <!-- XML files output directory -->
<boolean>true</boolean> <!-- Whether to delete previous results on rerun -->
<array> <!-- A list of custom annotations to ignore (optional) -->
<element key="codingStandardsIgnoreFile">
<string>codingStandardsIgnoreFile</string>
</element>
<element key="codingStandardsIgnoreStart">
<string>codingStandardsIgnoreStart</string>
</element>
<element key="codingStandardsIgnoreEnd">
<string>codingStandardsIgnoreEnd</string>
</element>
<element key="expectedExceptionMessageRegExp">
<string>expectedExceptionMessageRegExp</string>
</element>
<element key="magentoAdminConfigFixture">
<string>magentoAdminConfigFixture</string>
</element>
<element key="magentoAppArea">
<string>magentoAppArea</string>
</element>
<element key="magentoAppIsolation">
<string>magentoAppIsolation</string>
</element>
<element key="magentoCache">
<string>magentoCache</string>
</element>
<element key="magentoComponentsDir">
<string>magentoComponentsDir</string>
</element>
<element key="magentoConfigFixture">
<string>magentoConfigFixture</string>
</element>
<element key="magentoDataFixture">
<string>magentoDataFixture</string>
</element>
<element key="magentoDataFixtureBeforeTransaction">
<string>magentoDataFixtureBeforeTransaction</string>
</element>
<element key="magentoDbIsolation">
<string>magentoDbIsolation</string>
</element>
<element key="magentoIndexerDimensionMode">
<string>magentoIndexerDimensionMode</string>
</element>
<element key="security">
<string>security</string>
</element>
</array>
</arguments>
</listener>
</listeners>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Catalog\Pricing\Price\TierPrice;
use Magento\Customer\Model\Group;
use Magento\Customer\Model\Group as CustomerGroup;

/**
* @group indexer_dimension
Expand Down Expand Up @@ -54,7 +54,7 @@ public function testTierPrice()

$tierPrice = $this->objectManager->create(ProductTierPriceInterfaceFactory::class)
->create();
$tierPrice->setCustomerGroupId(Group::CUST_GROUP_ALL);
$tierPrice->setCustomerGroupId(CustomerGroup::CUST_GROUP_ALL);
$tierPrice->setQty(1.00);
$tierPrice->setValue($tierPriceValue);
$tierPriceManagement = $this->objectManager->create(ScopedProductTierPriceManagementInterface::class);
Expand Down
Loading

0 comments on commit 0175f09

Please sign in to comment.