Skip to content

Commit

Permalink
MAGETWO-32775: Prepare pull request for Checkout related modules MSC
Browse files Browse the repository at this point in the history
- stitic tests fix
  • Loading branch information
Ievgen Shakhsuvarov committed Jan 23, 2015
1 parent 2c0d42f commit 8d6b9c7
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function getCheckboxText();
* Returns the agreement status.
*
* @return bool Agreement status.
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
*/
public function getIsActive();

Expand All @@ -54,6 +55,7 @@ public function getIsActive();
*
* @return bool * true - HTML.
* * false - plain text.
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
*/
public function getIsHtml();
}
1 change: 1 addition & 0 deletions app/code/Magento/Directory/Model/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public function setRates(array $rates)
* @param string $id
* @param string $field
* @return $this
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function load($id, $field = null)
{
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Payment/Model/Method/AbstractMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @method AbstractMethod setStore()
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibleModel implements
MethodInterface,
Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/Payment/Model/Method/Cc.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*/
namespace Magento\Payment\Model\Method;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Cc extends \Magento\Payment\Model\Method\AbstractMethod
{
/**
Expand Down Expand Up @@ -52,6 +55,7 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
\Magento\Framework\Model\Context $context,
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Payment/Model/Method/Free.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Free extends \Magento\Payment\Model\Method\AbstractMethod
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
\Magento\Framework\Model\Context $context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public function getBaseAmount();
* Returns the value of the availability flag for the current shipping method.
*
* @return bool
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
*/
public function getAvailable();
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ interface PaymentMethodManagementInterface
* @param int $cartId The cart ID.
* @param \Magento\Quote\Api\Data\PaymentInterface $method The payment method.
* @return int Payment method ID.
* @throws \Magento\Framework\Exception\State\InvalidTransitionException The billing or shipping address is not set, or the specified payment method is not available.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
* @throws \Magento\Framework\Exception\State\InvalidTransitionException The billing or shipping address
* is not set, or the specified payment method is not available.
*/
public function set($cartId, \Magento\Quote\Api\Data\PaymentInterface $method);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ interface ShippingMethodManagementInterface
* @return bool
* @throws \Magento\Framework\Exception\InputException The shipping method is not valid for an empty cart.
* @throws \Magento\Framework\Exception\CouldNotSaveException The shipping method could not be saved.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart contains only virtual products so the shipping method does not apply.
* @throws \Magento\Framework\Exception\StateException The billing or shipping address is not set.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart contains only virtual products
* so the shipping method does not apply.
*/
public function set($cartId, $carrierCode, $methodCode);

Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Quote/Model/QuoteManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

/**
* Class QuoteManagement
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class QuoteManagement implements \Magento\Quote\Api\CartManagementInterface
{
Expand Down Expand Up @@ -102,6 +104,7 @@ class QuoteManagement implements \Magento\Quote\Api\CartManagementInterface
* @param QuoteRepository $quoteRepository
* @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
* @param \Magento\Customer\Model\CustomerFactory $customerModelFactory
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
EventManager $eventManager,
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Tax/Model/Quote/ToOrderConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class ToOrderConverter
* @param QuoteAddress $address
* @param array $additional
* @return array
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function beforeConvert(QuoteAddressToOrder $subject, QuoteAddress $address, $additional = [])
{
Expand All @@ -32,6 +33,7 @@ public function beforeConvert(QuoteAddressToOrder $subject, QuoteAddress $addres
* @param QuoteAddressToOrder $subject
* @param OrderInterface $order
* @return OrderInterface
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function afterConvert(QuoteAddressToOrder $subject, OrderInterface $order)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testSave()
{
// sales/gift_options/allow_order must be set to 1 in system configuration
// @todo remove next statement when \Magento\TestFramework\TestCase\WebapiAbstract::_updateAppConfig is fixed
$this->markTestIncomplete('This test relies on system configuration state.');
$this->markTestIncomplete('This test relies on system configuration state.');
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->objectManager->create('Magento\Quote\Model\Quote');
$quote->load('test_order_item_with_message', 'reserved_order_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ public function testSetCouponSuccess()

$this->assertEquals($quoteWithCoupon->getCouponCode(), $couponCode);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ protected function setUp()
],
[],
'',
false);
false
);
$this->messageMock = $this->getMock('Magento\GiftMessage\Model\Message', [], [], '', false);
$this->quoteItemMock = $this->getMock(
'\Magento\Quote\Model\Quote\Item',
Expand All @@ -85,7 +86,8 @@ protected function setUp()
],
[],
'',
false);
false
);
$this->quoteMock = $this->getMock(
'\Magento\Quote\Model\Quote',
[
Expand All @@ -97,7 +99,8 @@ protected function setUp()
],
[],
'',
false);
false
);
$this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface');
$this->giftMessageManagerMock =
$this->getMock('Magento\GiftMessage\Model\GiftMessageManager', [], [], '', false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ protected function setUp()
],
[],
'',
false);
false
);
$this->messageMock = $this->getMock('Magento\GiftMessage\Model\Message', [], [], '', false);
$this->quoteItemMock = $this->getMock(
'\Magento\Qote\Model\Quote\Item',
Expand All @@ -86,7 +87,8 @@ protected function setUp()
],
[],
'',
false);
false
);
$this->quoteMock = $this->getMock(
'\Magento\Quote\Model\Quote',
[
Expand All @@ -96,7 +98,8 @@ protected function setUp()
],
[],
'',
false);
false
);
$this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface');
$this->giftMessageManagerMock =
$this->getMock('Magento\GiftMessage\Model\GiftMessageManager', [], [], '', false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

use \Magento\Framework\Exception\NoSuchEntityException;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class QuoteManagementTest extends \PHPUnit_Framework_TestCase
{
/**
Expand Down Expand Up @@ -520,7 +523,8 @@ public function testSubmit()
->willReturn($baseOrder);
$this->quoteAddressToOrderAddress->expects($this->at(0))
->method('convert')
->with($shippingAddress,
->with(
$shippingAddress,
[
'address_type' => 'shipping',
'email' => 'customer@example.com'
Expand All @@ -529,7 +533,8 @@ public function testSubmit()
->willReturn($convertedShippingAddress);
$this->quoteAddressToOrderAddress->expects($this->at(1))
->method('convert')
->with($billingAddress,
->with(
$billingAddress,
[
'address_type' => 'billing',
'email' => 'customer@example.com'
Expand Down

0 comments on commit 8d6b9c7

Please sign in to comment.