@@ -45,6 +45,34 @@ public function setUp()
45
45
$ this ->fixture = new FilterHelper ();
46
46
}
47
47
48
+ /*
49
+ * Tests for filter ASCII85Decode
50
+ */
51
+
52
+ public function testDecodeFilterASCII85Decode ()
53
+ {
54
+ $ compressed = '6Z6g\Eb0<5ARlp)FE2)5B) ' ; // = Compressed string
55
+ $ result = $ this ->fixture ->decodeFilter ('ASCII85Decode ' , $ compressed );
56
+
57
+ $ this ->assertEquals ('Compressed string ' , $ result );
58
+ }
59
+
60
+ /*
61
+ * Tests for filter ASCIIHexDecode
62
+ */
63
+
64
+ public function testDecodeFilterASCIIHexDecode ()
65
+ {
66
+ $ compressed = '43 6f 6d 70 72 65 73 73 65 64 20 73 74 72 69 6e 67 ' ; // = Compressed string
67
+ $ result = $ this ->fixture ->decodeFilter ('ASCIIHexDecode ' , $ compressed );
68
+
69
+ $ this ->assertEquals ('Compressed string ' , $ result );
70
+ }
71
+
72
+ /*
73
+ * Tests for filter FlateDecode
74
+ */
75
+
48
76
public function testDecodeFilterFlateDecode ()
49
77
{
50
78
$ compressed = gzcompress ('Compress me ' , 9 );
@@ -74,4 +102,72 @@ public function testDecodeFilterFlateDecodeUncompressedString()
74
102
75
103
$ this ->fixture ->decodeFilter ('FlateDecode ' , 'something ' );
76
104
}
105
+
106
+ /**
107
+ * How does function behave if an uncompressed string was given.
108
+ */
109
+ public function testDecodeFilterUnknownFilter ()
110
+ {
111
+ $ result = $ this ->fixture ->decodeFilter ('a string ' .rand (), 'something ' );
112
+ $ this ->assertEquals ('something ' , $ result );
113
+ }
114
+
115
+ /*
116
+ * Test for filters not being implemented yet.
117
+ */
118
+
119
+ /**
120
+ * CCITTFaxDecode
121
+ */
122
+ public function testDecodeFilterCCITTFaxDecode ()
123
+ {
124
+ $ this ->expectException (Exception::class);
125
+ $ this ->expectExceptionMessage ('Decode CCITTFaxDecode not implemented yet. ' );
126
+
127
+ $ this ->fixture ->decodeFilter ('CCITTFaxDecode ' , '' );
128
+ }
129
+
130
+ /**
131
+ * Crypt
132
+ */
133
+ public function testDecodeFilterCrypt ()
134
+ {
135
+ $ this ->expectException (Exception::class);
136
+ $ this ->expectExceptionMessage ('Decode Crypt not implemented yet. ' );
137
+
138
+ $ this ->fixture ->decodeFilter ('Crypt ' , '' );
139
+ }
140
+
141
+ /**
142
+ * DCTDecode
143
+ */
144
+ public function testDecodeFilterDCTDecode ()
145
+ {
146
+ $ this ->expectException (Exception::class);
147
+ $ this ->expectExceptionMessage ('Decode DCTDecode not implemented yet. ' );
148
+
149
+ $ this ->fixture ->decodeFilter ('DCTDecode ' , '' );
150
+ }
151
+
152
+ /**
153
+ * JBIG2Decode
154
+ */
155
+ public function testDecodeFilterJBIG2Decode ()
156
+ {
157
+ $ this ->expectException (Exception::class);
158
+ $ this ->expectExceptionMessage ('Decode JBIG2Decode not implemented yet. ' );
159
+
160
+ $ this ->fixture ->decodeFilter ('JBIG2Decode ' , '' );
161
+ }
162
+
163
+ /**
164
+ * JPXDecode
165
+ */
166
+ public function testDecodeFilterJPXDecode ()
167
+ {
168
+ $ this ->expectException (Exception::class);
169
+ $ this ->expectExceptionMessage ('Decode JPXDecode not implemented yet. ' );
170
+
171
+ $ this ->fixture ->decodeFilter ('JPXDecode ' , '' );
172
+ }
77
173
}
0 commit comments