Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Magento\Framework\DataObject;

/**
* Produce html output using the given data source.
*
* phpcs:disable Magento2.Classes.AbstractApi
* Backend grid item abstract renderer
* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
Expand Down Expand Up @@ -53,7 +56,7 @@ public function getColumn()
* Renders grid column
*
* @param DataObject $row
* @return string
* @return string
*/
public function render(DataObject $row)
{
Expand All @@ -62,7 +65,7 @@ public function render(DataObject $row)
$result .= $this->getColumn()->getEditOnly() ? ''
: '<span class="admin__grid-control-value">' . $this->_getValue($row) . '</span>';

return $result . $this->_getInputValueElement($row) . '</div>' ;
return $result . $this->_getInputValueElement($row) . '</div>';
}
return $this->_getValue($row);
}
Expand Down Expand Up @@ -90,6 +93,7 @@ protected function _getValue(DataObject $row)
if (is_string($getter)) {
return $row->{$getter}();
} elseif (is_callable($getter)) {
//phpcs:ignore Magento2.Functions.DiscouragedFunction
return call_user_func($getter, $row);
}
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private function addVisibilityFilter(SearchCriteriaInterface $searchCriteria, bo
{
if ($isFilter && $isSearch) {
// Index already contains products filtered by visibility: catalog, search, both
return ;
return;
}
$visibilityIds = $isSearch
? $this->visibility->getVisibleInSearchIds()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SchemaLocator implements SchemaLocatorInterface
*
* @var string
*/
private $schema ;
private $schema;

/**
* @param Reader $moduleReader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,62 @@
*/
namespace Magento\Payment\Test\Unit\Gateway\Data;

use Magento\Payment\Gateway\Data\PaymentDataObject;
use Magento\Payment\Gateway\Data\OrderAdapterInterface;
use Magento\Payment\Gateway\Data\PaymentDataObject;
use Magento\Payment\Model\InfoInterface;
use PHPUnit\Framework\MockObject\MockObject;

/**
* Class PaymentDataObjectTest
* Tests for PaymentDataObject
*/
class PaymentDataObjectTest extends \PHPUnit\Framework\TestCase
{
/** @var PaymentDataObject */
/**
* @var PaymentDataObject
*/
protected $model;

/**
* @var OrderAdapterInterface|\PHPUnit_Framework_MockObject_MockObject
* @var OrderAdapterInterface|MockObject
*/
protected $orderMock;

/**
* @var InfoInterface|\PHPUnit_Framework_MockObject_MockObject
* @var InfoInterface|\MockObject
*/
protected $paymentMock;

/**
* @inheritdoc
*/
protected function setUp()
{
$this->orderMock = $this->getMockBuilder(\Magento\Payment\Gateway\Data\OrderAdapterInterface::class)
$this->orderMock = $this->getMockBuilder(OrderAdapterInterface::class)
->getMockForAbstractClass();

$this->paymentMock = $this->getMockBuilder(\Magento\Payment\Model\InfoInterface::class)
$this->paymentMock = $this->getMockBuilder(InfoInterface::class)
->getMockForAbstractClass();

$this->model = new PaymentDataObject($this->orderMock, $this->paymentMock);
}

public function testGetOrder()
/**
* Verify can get order
*
* @return void
*/
public function testGetOrder(): void
{
$this->assertSame($this->orderMock, $this->model->getOrder()) ;
$this->assertSame($this->orderMock, $this->model->getOrder());
}

public function testGetPayment()
/**
* Verify can get payment
*
* @return void
*/
public function testGetPayment(): void
{
$this->assertSame($this->paymentMock, $this->model->getPayment()) ;
$this->assertSame($this->paymentMock, $this->model->getPayment());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class UpdateQuoteItemsTest extends \PHPUnit\Framework\TestCase
/**
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Quote\Model\ResourceModel\Quote
*/
private $quoteResource ;
private $quoteResource;

protected function setUp()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected function _addStoresFieldset($model, $form)
'fieldset_html_class' => 'store'
]
);
return ;
return;
}

$renderer = $this->getLayout()->createBlock(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@
var last;

// Skip empty text nodes form the end
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling);

if (last && last.nodeName == 'TABLE')
ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
Expand Down