Hoa central
Public Member Functions | List of all members
Hoa\Mail\Test\Unit\Content\Encoder\QuotedPrintable Class Reference
Inheritance diagram for Hoa\Mail\Test\Unit\Content\Encoder\QuotedPrintable:

Public Member Functions

 case_encode_rfc2045_section_6_7_rule1 ()
 
 case_encode_rfc2045_section6_7_rule2 ()
 
 case_encode_rfc2045_section6_7_rule3 ()
 
 case_encode_rfc2045_section_6_7_rule4 ()
 
 case_encode_rfc2045_section_6_7_rule5 ()
 
 case_encode_rfc2047_sections_4_and_5 ()
 
- Public Member Functions inherited from Hoa\Test\Unit\Suite
 __construct ()
 
 getTestedClassName ()
 
 getTestedClassNamespace ()
 
 beforeTestMethod ($methodName)
 

Detailed Description

Class .

Test suite of the quoted-printable encoder.

Definition at line 50 of file QuotedPrintable.php.

Member Function Documentation

Hoa\Mail\Test\Unit\Content\Encoder\QuotedPrintable::case_encode_rfc2045_section6_7_rule2 ( )

Definition at line 81 of file QuotedPrintable.php.

82  {
83  $this
84  ->given(
85  $notEncoded = array_map(
86  'chr',
87  array_merge(
88  range(33, 60),
89  range(62, 126)
90  )
91  )
92  )
93  ->when(function () use ($notEncoded) {
94  foreach ($notEncoded as $char) {
95  $this
96  ->string($char)
97  ->isEqualTo(SUT::encode($char));
98  }
99  });
100  }
Hoa\Mail\Test\Unit\Content\Encoder\QuotedPrintable::case_encode_rfc2045_section6_7_rule3 ( )

Definition at line 102 of file QuotedPrintable.php.

103  {
104  $this
105  ->given($tab = 'abc' . "\t\t" . 'def')
106  ->when($result = SUT::encode($tab))
107  ->then
108  ->string($result)
109  ->isEqualTo('abc' . "\t\t" . 'def')
110 
111  ->given($tab = 'abc' . "\t\t" . CRLF)
112  ->when($result = SUT::encode($tab))
113  ->then
114  ->string($result)
115  ->isEqualTo('abc' . "\t" . '=09' . CRLF)
116 
117  ->given($space = 'abc def')
118  ->when($result = SUT::encode($space))
119  ->then
120  ->string($result)
121  ->isEqualTo('abc def')
122 
123  ->given($space = 'abc ' . CRLF)
124  ->when($result = SUT::encode($space))
125  ->then
126  ->string($result)
127  ->isEqualTo('abc =20' . CRLF);
128  }
Hoa\Mail\Test\Unit\Content\Encoder\QuotedPrintable::case_encode_rfc2045_section_6_7_rule1 ( )

Definition at line 52 of file QuotedPrintable.php.

53  {
54  $this
55  ->given($datum = 'abc')
56  ->when($result = SUT::encode($datum))
57  ->then
58  ->string($result)
59  ->isEqualTo('abc')
60 
61  // 8bits.
62  ->given($datum = 'fôöbàr')
63  ->when($result = SUT::encode($datum))
64  ->then
65  ->string($result)
66  ->isEqualTo('f=C3=B4=C3=B6b=C3=A0r')
67 
68  ->given($datum = '😄!')
69  ->when($result = SUT::encode($datum))
70  ->then
71  ->string($result)
72  ->isEqualTo('=F0=9F=98=84!')
73 
74  ->given($datum = 'abc' . CRLF . 'def')
75  ->when($result = SUT::encode($datum))
76  ->then
77  ->string($result)
78  ->isEqualTo('abc' . CRLF . 'def');
79  }
Hoa\Mail\Test\Unit\Content\Encoder\QuotedPrintable::case_encode_rfc2045_section_6_7_rule4 ( )

Definition at line 130 of file QuotedPrintable.php.

131  {
132  $this
133  ->given($datum = 'abc' . CRLF . 'def' . CRLF . 'ghi' . CRLF)
134  ->when($result = SUT::encode($datum))
135  ->then
136  ->string($result)
137  ->isEqualTo($datum);
138  }
Hoa\Mail\Test\Unit\Content\Encoder\QuotedPrintable::case_encode_rfc2045_section_6_7_rule5 ( )

Definition at line 140 of file QuotedPrintable.php.

141  {
142  $this
143  ->given($datum = 'abc')
144  ->when($result = SUT::encode($datum))
145  ->then
146  ->string($result)
147  ->isEqualTo('abc')
148 
149  ->given(
150  $datum =
151  'abc def ghi jkl mno pqr stu vwx yz ' .
152  'abc def ghi jkl mno pqr stu vwx yz ' .
153  'abc def ghi jkl mno pqr stu vwx yz' . CRLF
154  )
155  ->when($result = SUT::encode($datum))
156  ->then
157  ->string($result)
158  ->isEqualTo(
159  'abc def ghi jkl mno pqr stu vwx yz abc def ghi jkl mno pqr stu vwx yz abc =' . CRLF .
160  'def ghi jkl mno pqr stu vwx yz' . CRLF
161  );
162  }
Hoa\Mail\Test\Unit\Content\Encoder\QuotedPrintable::case_encode_rfc2047_sections_4_and_5 ( )

Definition at line 164 of file QuotedPrintable.php.

165  {
166  $this
167  ->given(
168  $decoded = '😄!',
169  $encoded = '=?utf-8?Q?=F0=9F=98=84!?='
170  )
171  ->when($result = SUT::encode($decoded, true))
172  ->then
173  ->string($result)
174  ->isEqualTo($encoded);
175  }

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