Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
ParameterTest Class Reference
Inheritance diagram for ParameterTest:

Public Member Functions

 testTokenize ($string, $expectedValue)
 
 testGetValue ($string, $expectedValue)
 
 sampleTokenizeStringProvider ()
 
 sampleGetValueStringProvider ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $_filter
 

Detailed Description

Definition at line 10 of file ParameterTest.php.

Member Function Documentation

◆ sampleGetValueStringProvider()

sampleGetValueStringProvider ( )
Returns
array

Definition at line 60 of file ParameterTest.php.

61  {
62  return [
63  [" direct_url='about-magento-demo-store'", "direct_url='about-magento-demo-store'"],
64  [" direct_url='about-magento-demo-store\\[newDemo]", "direct_url='about-magento-demo-store\\[newDemo]"],
65  [' ', '']
66  ];
67  }

◆ sampleTokenizeStringProvider()

sampleTokenizeStringProvider ( )
Returns
array

Definition at line 47 of file ParameterTest.php.

48  {
49  return [
50  ["%20direct_url='about-magento-demo-store'", ['direct_url' => 'about-magento-demo-store']],
51  [" direct_url='about-magento-demo-store\\[newDemo]",
52  ['direct_url' => 'about-magento-demo-store\\[newDemo]']],
53  [" ", []]
54  ];
55  }

◆ setUp()

setUp ( )
protected

Definition at line 17 of file ParameterTest.php.

18  {
19  $this->_filter = new Parameter();
20  }

◆ testGetValue()

testGetValue (   $string,
  $values 
)
Parameters
string$stringString to get value of
string$expectedValue@dataProvider sampleGetValueStringProvider
string$string
array$values@dataProvider getValueDataProvider

Definition at line 38 of file ParameterTest.php.

39  {
40  $this->_filter->setString($string);
41  $this->assertEquals($expectedValue, $this->_filter->getValue());
42  }

◆ testTokenize()

testTokenize (   $string,
  $params 
)
Parameters
string$stringString to tokenize
string$expectedValue@dataProvider sampleTokenizeStringProvider

@dataProvider tokenizeDataProvider

Parameters
string$string
array$params

Definition at line 27 of file ParameterTest.php.

28  {
29  $this->_filter->setString($string);
30  $this->assertEquals($expectedValue, $this->_filter->tokenize());
31  }

Field Documentation

◆ $_filter

$_filter
protected

Definition at line 15 of file ParameterTest.php.


The documentation for this class was generated from the following file: