Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 2125cd8

Browse files
author
Oleksii Korshenko
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-65199-PR-8685
2 parents aaac3fd + 9750ba1 commit 2125cd8

File tree

11 files changed

+246
-380
lines changed

11 files changed

+246
-380
lines changed

Block/Adminhtml/CaseInfoTest.php

Lines changed: 8 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
*/
66
namespace Magento\Signifyd\Block\Adminhtml;
77

8-
use Magento\Backend\Block\Template;
98
use Magento\Framework\App\RequestInterface;
109
use Magento\Framework\ObjectManagerInterface;
1110
use Magento\Framework\View\Element\Template\Context;
1211
use Magento\Framework\View\LayoutInterface;
1312
use Magento\Sales\Model\Order;
14-
use Magento\Sales\Model\OrderRepository;
1513
use Magento\TestFramework\Helper\Bootstrap;
1614

1715
class CaseInfoTest extends \PHPUnit_Framework_TestCase
@@ -31,16 +29,6 @@ class CaseInfoTest extends \PHPUnit_Framework_TestCase
3129
*/
3230
private $layout;
3331

34-
/**
35-
* @var string
36-
*/
37-
private static $submitButton = 'Submit Guarantee Request';
38-
39-
/**
40-
* @var string
41-
*/
42-
private static $cancelButton = 'Cancel Guarantee Request';
43-
4432
/**
4533
* @inheritdoc
4634
*/
@@ -52,15 +40,18 @@ protected function setUp()
5240
}
5341

5442
/**
55-
* Checks that block does not give contents
56-
* if Signifyd module is inactive.
43+
* Checks that block has contents when case entity for order is exists
44+
* even if Signifyd module is inactive.
5745
*
5846
* @magentoConfigFixture current_store fraud_protection/signifyd/active 0
47+
* @magentoDataFixture Magento/Signifyd/_files/case.php
5948
* @magentoAppArea adminhtml
6049
*/
6150
public function testModuleIsInactive()
6251
{
63-
static::assertEmpty($this->getBlockContents());
52+
$this->order->loadByIncrementId('100000001');
53+
54+
static::assertNotEmpty($this->getBlockContents());
6455
}
6556

6657
/**
@@ -96,71 +87,8 @@ public function testCaseEntityExists()
9687

9788
$html = $this->getBlockContents();
9889
static::assertNotEmpty($html);
99-
static::assertContains('Some Team', $html);
100-
static::assertContains('col-case-score-green', $html);
101-
}
102-
103-
/**
104-
* Checks state of Guarantee action buttons on order page.
105-
*
106-
* @covers \Magento\Signifyd\Block\Adminhtml\CaseInfo::getButtons
107-
* @magentoConfigFixture current_store fraud_protection/signifyd/active 1
108-
* @magentoDataFixture Magento/Signifyd/_files/case.php
109-
* @magentoAppArea adminhtml
110-
*/
111-
public function testSubmitButtonAvailable()
112-
{
113-
$this->order->loadByIncrementId('100000001');
114-
115-
$blockContents = $this->getBlockContents();
116-
117-
static::assertContains(self::$submitButton, $blockContents);
118-
static::assertNotContains(self::$cancelButton, $blockContents);
119-
}
120-
121-
/**
122-
* Checks that guarantee action buttons is unavailable on order page.
123-
*
124-
* @covers \Magento\Signifyd\Block\Adminhtml\CaseInfo::getButtons
125-
* @magentoConfigFixture current_store fraud_protection/signifyd/active 1
126-
* @magentoDataFixture Magento/Signifyd/_files/case.php
127-
* @magentoAppArea adminhtml
128-
*/
129-
public function testButtonsUnavailable()
130-
{
131-
$this->order->loadByIncrementId('100000001');
132-
$this->order->setState(Order::STATE_CANCELED);
133-
134-
/** @var OrderRepository $orderRepository */
135-
$orderRepository = $this->objectManager->get(OrderRepository::class);
136-
$orderRepository->save($this->order);
137-
138-
$blockContents = $this->getBlockContents();
139-
140-
static::assertNotContains(self::$submitButton, $blockContents);
141-
static::assertNotContains(self::$cancelButton, $blockContents);
142-
}
143-
144-
/**
145-
* Checks action buttons for case entity with Guarantee submitted.
146-
*
147-
* @covers \Magento\Signifyd\Block\Adminhtml\CaseInfo::getButtons
148-
* @magentoConfigFixture current_store fraud_protection/signifyd/active 1
149-
* @magentoDataFixture Magento/Signifyd/_files/approved_case.php
150-
* @magentoAppArea adminhtml
151-
*/
152-
public function testButtonsForApprovedCase()
153-
{
154-
$this->order->loadByIncrementId('100000001');
155-
156-
/** @var OrderRepository $orderRepository */
157-
$orderRepository = $this->objectManager->get(OrderRepository::class);
158-
$orderRepository->save($this->order);
159-
160-
$blockContents = $this->getBlockContents();
161-
162-
static::assertNotContains(self::$submitButton, $blockContents);
163-
static::assertContains(self::$cancelButton, $blockContents);
90+
static::assertContains('Processing', $html);
91+
static::assertContains('Good', $html);
16492
}
16593

16694
/**

Controller/Adminhtml/Guarantee/CancelTest.php

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)