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

Public Member Functions

 case_content_type ()
 
 case_add_contents_from_constructor ()
 
 case_basic ()
 
- Public Member Functions inherited from Hoa\Test\Unit\Suite
 __construct ()
 
 getTestedClassName ()
 
 getTestedClassNamespace ()
 
 beforeTestMethod ($methodName)
 

Detailed Description

Class .

Test suite of the alternative content.

Definition at line 52 of file Alternative.php.

Member Function Documentation

Hoa\Mail\Test\Unit\Content\Alternative::case_add_contents_from_constructor ( )

Definition at line 63 of file Alternative.php.

64  {
65  $this
66  ->given(
67  $content1 = new Text('foo'),
68  $content2 = new Text('bar'),
69  $alternative = new SUT([$content1, $content2])
70  )
71  ->when($result = count($alternative->getContent()))
72  ->then
73  ->integer($result)
74  ->isEqualTo(2);
75  }
Hoa\Mail\Test\Unit\Content\Alternative::case_basic ( )

Definition at line 77 of file Alternative.php.

78  {
79  $this
80  ->given(
81  $this->function->microtime = function () use (&$microtime) {
82  return $microtime = 42;
83  },
84  $content1 = new Text('foo'),
85  $content2 = new Html('<strong>foo</strong>'),
86  $alternative = new SUT([$content1, $content2])
87  )
88  ->when($result = $alternative->getFormattedContent())
89  ->then
90  ->string($result)
91  ->isEqualTo(
92  'content-type: multipart/alternative; boundary="__bndry-3d469222fa3ab341c0d491b98a8aa315"' . CRLF .
93  CRLF .
94 
95  // Content 1.
96  '--__bndry-3d469222fa3ab341c0d491b98a8aa315' . CRLF .
97  $content1->getFormattedContent() . CRLF .
98 
99  // Content 2.
100  '--__bndry-3d469222fa3ab341c0d491b98a8aa315' . CRLF .
101  $content2->getFormattedContent() . CRLF .
102 
103  '--__bndry-3d469222fa3ab341c0d491b98a8aa315' .
104  '--' . CRLF
105  );
106  }
Hoa\Mail\Test\Unit\Content\Alternative::case_content_type ( )

Definition at line 54 of file Alternative.php.

55  {
56  $this
57  ->when($result = new SUT())
58  ->then
59  ->string($result['content-type'])
60  ->isEqualTo('multipart/alternative');
61  }

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