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

Public Member Functions

 case_basic ()
 
 case_content_type ()
 
 case_no_content_by_default ()
 
 case_initial_content ()
 
 case_append_content ()
 
 case_prepend_content ()
 
 case_get_content ()
 
- Public Member Functions inherited from Hoa\Test\Unit\Suite
 __construct ()
 
 getTestedClassName ()
 
 getTestedClassNamespace ()
 
 beforeTestMethod ($methodName)
 

Detailed Description

Class .

Test suite of the text content.

Definition at line 50 of file Text.php.

Member Function Documentation

Hoa\Mail\Test\Unit\Content\Text::case_append_content ( )

Definition at line 106 of file Text.php.

107  {
108  $this
109  ->given(
110  $te = 'foo',
111  $xt = 'bar',
112  $text = $te . $xt,
113  $content = new SUT()
114  )
115  ->when($result = $content->append($te)->get())
116  ->then
117  ->string($result)
118  ->isEqualTo($te)
119 
120  ->when($result = $content->append($xt)->get())
121  ->then
122  ->string($result)
123  ->isEqualTo($text);
124  }
$content
Definition: Hoa.php:119
Hoa\Mail\Test\Unit\Content\Text::case_basic ( )

Definition at line 52 of file Text.php.

53  {
54  $this
55  ->given(
56  $text = 'foobar',
57  $content = new SUT($text)
58  )
59  ->when($result = $content->getFormattedContent())
60  ->then
61  ->string($result)
62  ->isEqualTo(
63  'content-transfer-encoding: quoted-printable' . CRLF .
64  'content-disposition: inline' . CRLF .
65  'content-type: text/plain; charset=utf-8' . CRLF .
66  CRLF .
67  'foobar'
68  );
69  }
$content
Definition: Hoa.php:119
Hoa\Mail\Test\Unit\Content\Text::case_content_type ( )

Definition at line 71 of file Text.php.

72  {
73  $this
74  ->given($content = new SUT())
75  ->when($result = $content->getHeaders())
76  ->then
77  ->array($result)
78  ->hasKey('content-type')
79  ->string($result['content-type'])
80  ->isEqualTo('text/plain; charset=utf-8');
81  }
$content
Definition: Hoa.php:119
Hoa\Mail\Test\Unit\Content\Text::case_get_content ( )

Definition at line 146 of file Text.php.

147  {
148  $this
149  ->given(
150  $text = 'foobar',
151  $content = new SUT($text)
152  )
153  ->when($result = $content->getFormattedContent(false))
154  ->then
155  ->string($result)
156  ->isEqualTo('foobar')
157 
158  ->given(
159  $text = 'fôòbār',
160  $content = new SUT($text)
161  )
162  ->when($result = $content->getFormattedContent(false))
163  ->then
164  ->string($result)
165  ->isEqualTo('f=C3=B4=C3=B2b=C4=81r');
166  }
$content
Definition: Hoa.php:119
Hoa\Mail\Test\Unit\Content\Text::case_initial_content ( )

Definition at line 93 of file Text.php.

94  {
95  $this
96  ->given(
97  $text = 'foobar',
98  $content = new SUT($text)
99  )
100  ->when($result = $content->get())
101  ->then
102  ->string($result)
103  ->isEqualTo($text);
104  }
$content
Definition: Hoa.php:119
Hoa\Mail\Test\Unit\Content\Text::case_no_content_by_default ( )

Definition at line 83 of file Text.php.

84  {
85  $this
86  ->given($content = new SUT())
87  ->when($result = $content->get())
88  ->then
89  ->string($result)
90  ->isEmpty();
91  }
$content
Definition: Hoa.php:119
Hoa\Mail\Test\Unit\Content\Text::case_prepend_content ( )

Definition at line 126 of file Text.php.

127  {
128  $this
129  ->given(
130  $te = 'foo',
131  $xt = 'bar',
132  $text = $te . $xt,
133  $content = new SUT()
134  )
135  ->when($result = $content->append($xt)->get())
136  ->then
137  ->string($result)
138  ->isEqualTo($xt)
139 
140  ->when($result = $content->prepend($te)->get())
141  ->then
142  ->string($result)
143  ->isEqualTo($text);
144  }
$content
Definition: Hoa.php:119

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