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
framework
Encryption
Test
Unit
UrlCoderTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Encryption\Test\Unit
;
7
8
class
UrlCoderTest
extends
\PHPUnit\Framework\TestCase
9
{
13
protected
$_urlCoder
;
14
18
protected
$_urlMock
;
19
23
protected
$_url
=
'http://example.com'
;
24
28
protected
$_encodeUrl
=
'aHR0cDovL2V4YW1wbGUuY29t'
;
29
30
protected
function
setUp
()
31
{
32
$this->_urlMock = $this->createMock(\
Magento
\Framework\UrlInterface::class);
33
$this->_urlCoder = new \Magento\Framework\Encryption\UrlCoder($this->_urlMock);
34
}
35
36
public
function
testDecode
()
37
{
38
$this->_urlMock->expects(
39
$this->once()
40
)->method(
41
'sessionUrlVar'
42
)->with(
43
$this->_url
44
)->will(
45
$this->returnValue(
'expected'
)
46
);
47
$this->assertEquals(
'expected'
, $this->_urlCoder->decode($this->_encodeUrl));
48
}
49
50
public
function
testEncode
()
51
{
52
$this->assertEquals($this->_encodeUrl, $this->_urlCoder->encode($this->_url));
53
}
54
}
Magento\Framework\Encryption\Test\Unit\UrlCoderTest\$_urlMock
$_urlMock
Definition:
UrlCoderTest.php:18
Magento\Framework\Encryption\Test\Unit\UrlCoderTest
Definition:
UrlCoderTest.php:8
Magento\Framework\Encryption\Test\Unit\UrlCoderTest\$_url
$_url
Definition:
UrlCoderTest.php:23
Magento\Framework\Encryption\Test\Unit\UrlCoderTest\$_urlCoder
$_urlCoder
Definition:
UrlCoderTest.php:13
Magento\Framework\Encryption\Test\Unit\UrlCoderTest\$_encodeUrl
$_encodeUrl
Definition:
UrlCoderTest.php:28
Magento
Magento\Framework\Encryption\Test\Unit\UrlCoderTest\setUp
setUp()
Definition:
UrlCoderTest.php:30
Magento\Framework\Encryption\Test\Unit
Magento\Framework\Encryption\Test\Unit\UrlCoderTest\testEncode
testEncode()
Definition:
UrlCoderTest.php:50
Magento\Framework\Encryption\Test\Unit\UrlCoderTest\testDecode
testDecode()
Definition:
UrlCoderTest.php:36