Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-payment
Test
Unit
Gateway
Http
Converter
HtmlFormConverterTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Payment\Test\Unit\Gateway\Http\Converter
;
7
8
use
Magento\Payment\Gateway\Http\Converter\HtmlFormConverter
;
9
10
class
HtmlFormConverterTest
extends
\PHPUnit\Framework\TestCase
11
{
12
public
function
testConvert
()
13
{
14
$expectedResult = [
15
'parameter1'
=>
'val1'
,
16
'parameter2'
=>
'val2'
,
17
'parameter3'
=>
'val3'
18
];
19
20
$converter =
new
HtmlFormConverter
();
21
static::assertEquals($expectedResult, $converter->convert($this->getValidFormHtml()));
22
}
23
24
public
function
testConvertNotValidHtml
()
25
{
26
$converter =
new
HtmlFormConverter
();
27
$result
= $converter->convert(
'Not html. Really not.'
);
28
$this->assertNotNull(
$result
);
29
}
30
36
private
function
getValidFormHtml()
37
{
38
return
'
39
<!DOCTYPE HTML>
40
<html>
41
<head>
42
<meta charset="utf-8">
43
<title>Title</title>
44
</head>
45
<body>
46
47
<form action="some">
48
<p><input type="radio" name="parameter1" value="val1">val1<Br>
49
<input type="radio" name="parameter2" value="val2">val2<Br>
50
<input type="radio" name="parameter3" value="val3">val3</p>
51
<p><input type="submit"></p>
52
</form>
53
54
</body>
55
</html>
56
'
;
57
}
58
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Payment\Gateway\Http\Converter\HtmlFormConverter
Definition:
HtmlFormConverter.php:18
Magento\Payment\Test\Unit\Gateway\Http\Converter
Definition:
HtmlFormConverterTest.php:6
Magento\Payment\Test\Unit\Gateway\Http\Converter\HtmlFormConverterTest\testConvert
testConvert()
Definition:
HtmlFormConverterTest.php:12
Magento\Payment\Test\Unit\Gateway\Http\Converter\HtmlFormConverterTest\testConvertNotValidHtml
testConvertNotValidHtml()
Definition:
HtmlFormConverterTest.php:24
Magento\Payment\Test\Unit\Gateway\Http\Converter\HtmlFormConverterTest
Definition:
HtmlFormConverterTest.php:10