|
25 | 25 | namespace PHP_Typography\Tests; |
26 | 26 |
|
27 | 27 | use PHP_Typography\Strings; |
| 28 | +use PHP_Typography\U; |
28 | 29 | use PHP_Typography\Text_Parser\Token; |
29 | 30 |
|
30 | 31 | /** |
@@ -167,78 +168,78 @@ protected function assert_tokens_not_same( $expected_value, array $actual_tokens |
167 | 168 | protected function assert_smart_quotes_style( $style, $open, $close ) { |
168 | 169 | switch ( $style ) { |
169 | 170 | case 'doubleCurled': |
170 | | - $this->assertSame( Strings::uchr( 8220 ), $open, "Opening quote $open did not match quote style $style." ); |
171 | | - $this->assertSame( Strings::uchr( 8221 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 171 | + $this->assertSame( U::DOUBLE_QUOTE_OPEN, $open, "Opening quote $open did not match quote style $style." ); |
| 172 | + $this->assertSame( U::DOUBLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." ); |
172 | 173 | break; |
173 | 174 |
|
174 | 175 | case 'doubleCurledReversed': |
175 | | - $this->assertSame( Strings::uchr( 8221 ), $open, "Opening quote $open did not match quote style $style." ); |
176 | | - $this->assertSame( Strings::uchr( 8221 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 176 | + $this->assertSame( U::DOUBLE_QUOTE_CLOSE, $open, "Opening quote $open did not match quote style $style." ); |
| 177 | + $this->assertSame( U::DOUBLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." ); |
177 | 178 | break; |
178 | 179 |
|
179 | 180 | case 'doubleLow9': |
180 | | - $this->assertSame( Strings::uchr( 8222 ), $open, "Opening quote $open did not match quote style $style." ); |
181 | | - $this->assertSame( Strings::uchr( 8221 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 181 | + $this->assertSame( U::DOUBLE_LOW_9_QUOTE, $open, "Opening quote $open did not match quote style $style." ); |
| 182 | + $this->assertSame( U::DOUBLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." ); |
182 | 183 | break; |
183 | 184 |
|
184 | 185 | case 'doubleLow9Reversed': |
185 | | - $this->assertSame( Strings::uchr( 8222 ), $open, "Opening quote $open did not match quote style $style." ); |
186 | | - $this->assertSame( Strings::uchr( 8220 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 186 | + $this->assertSame( U::DOUBLE_LOW_9_QUOTE, $open, "Opening quote $open did not match quote style $style." ); |
| 187 | + $this->assertSame( U::DOUBLE_QUOTE_OPEN, $close, "Closeing quote $close did not match quote style $style." ); |
187 | 188 | break; |
188 | 189 |
|
189 | 190 | case 'singleCurled': |
190 | | - $this->assertSame( Strings::uchr( 8216 ), $open, "Opening quote $open did not match quote style $style." ); |
191 | | - $this->assertSame( Strings::uchr( 8217 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 191 | + $this->assertSame( U::SINGLE_QUOTE_OPEN, $open, "Opening quote $open did not match quote style $style." ); |
| 192 | + $this->assertSame( U::SINGLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." ); |
192 | 193 | break; |
193 | 194 |
|
194 | 195 | case 'singleCurledReversed': |
195 | | - $this->assertSame( Strings::uchr( 8217 ), $open, "Opening quote $open did not match quote style $style." ); |
196 | | - $this->assertSame( Strings::uchr( 8217 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 196 | + $this->assertSame( U::SINGLE_QUOTE_CLOSE, $open, "Opening quote $open did not match quote style $style." ); |
| 197 | + $this->assertSame( U::SINGLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." ); |
197 | 198 | break; |
198 | 199 |
|
199 | 200 | case 'singleLow9': |
200 | | - $this->assertSame( Strings::uchr( 8218 ), $open, "Opening quote $open did not match quote style $style." ); |
201 | | - $this->assertSame( Strings::uchr( 8217 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 201 | + $this->assertSame( U::SINGLE_LOW_9_QUOTE, $open, "Opening quote $open did not match quote style $style." ); |
| 202 | + $this->assertSame( U::SINGLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." ); |
202 | 203 | break; |
203 | 204 |
|
204 | 205 | case 'singleLow9Reversed': |
205 | | - $this->assertSame( Strings::uchr( 8218 ), $open, "Opening quote $open did not match quote style $style." ); |
206 | | - $this->assertSame( Strings::uchr( 8216 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 206 | + $this->assertSame( U::SINGLE_LOW_9_QUOTE, $open, "Opening quote $open did not match quote style $style." ); |
| 207 | + $this->assertSame( U::SINGLE_QUOTE_OPEN, $close, "Closeing quote $close did not match quote style $style." ); |
207 | 208 | break; |
208 | 209 |
|
209 | 210 | case 'doubleGuillemetsFrench': |
210 | | - $this->assertSame( Strings::uchr( 171, 8239 ), $open, "Opening quote $open did not match quote style $style." ); |
211 | | - $this->assertSame( Strings::uchr( 8239, 187 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 211 | + $this->assertSame( U::GUILLEMET_OPEN . U::NO_BREAK_NARROW_SPACE, $open, "Opening quote $open did not match quote style $style." ); |
| 212 | + $this->assertSame( U::NO_BREAK_NARROW_SPACE . U::GUILLEMET_CLOSE, $close, "Closeing quote $close did not match quote style $style." ); |
212 | 213 | break; |
213 | 214 |
|
214 | 215 | case 'doubleGuillemets': |
215 | | - $this->assertSame( Strings::uchr( 171 ), $open, "Opening quote $open did not match quote style $style." ); |
216 | | - $this->assertSame( Strings::uchr( 187 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 216 | + $this->assertSame( U::GUILLEMET_OPEN, $open, "Opening quote $open did not match quote style $style." ); |
| 217 | + $this->assertSame( U::GUILLEMET_CLOSE, $close, "Closeing quote $close did not match quote style $style." ); |
217 | 218 | break; |
218 | 219 |
|
219 | 220 | case 'doubleGuillemetsReversed': |
220 | | - $this->assertSame( Strings::uchr( 187 ), $open, "Opening quote $open did not match quote style $style." ); |
221 | | - $this->assertSame( Strings::uchr( 171 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 221 | + $this->assertSame( U::GUILLEMET_CLOSE, $open, "Opening quote $open did not match quote style $style." ); |
| 222 | + $this->assertSame( U::GUILLEMET_OPEN, $close, "Closeing quote $close did not match quote style $style." ); |
222 | 223 | break; |
223 | 224 |
|
224 | 225 | case 'singleGuillemets': |
225 | | - $this->assertSame( Strings::uchr( 8249 ), $open, "Opening quote $open did not match quote style $style." ); |
226 | | - $this->assertSame( Strings::uchr( 8250 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 226 | + $this->assertSame( U::SINGLE_ANGLE_QUOTE_OPEN, $open, "Opening quote $open did not match quote style $style." ); |
| 227 | + $this->assertSame( U::SINGLE_ANGLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." ); |
227 | 228 | break; |
228 | 229 |
|
229 | 230 | case 'singleGuillemetsReversed': |
230 | | - $this->assertSame( Strings::uchr( 8250 ), $open, "Opening quote $open did not match quote style $style." ); |
231 | | - $this->assertSame( Strings::uchr( 8249 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 231 | + $this->assertSame( U::SINGLE_ANGLE_QUOTE_CLOSE, $open, "Opening quote $open did not match quote style $style." ); |
| 232 | + $this->assertSame( U::SINGLE_ANGLE_QUOTE_OPEN, $close, "Closeing quote $close did not match quote style $style." ); |
232 | 233 | break; |
233 | 234 |
|
234 | 235 | case 'cornerBrackets': |
235 | | - $this->assertSame( Strings::uchr( 12300 ), $open, "Opening quote $open did not match quote style $style." ); |
236 | | - $this->assertSame( Strings::uchr( 12301 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 236 | + $this->assertSame( U::LEFT_CORNER_BRACKET, $open, "Opening quote $open did not match quote style $style." ); |
| 237 | + $this->assertSame( U::RIGHT_CORNER_BRACKET, $close, "Closeing quote $close did not match quote style $style." ); |
237 | 238 | break; |
238 | 239 |
|
239 | 240 | case 'whiteCornerBracket': |
240 | | - $this->assertSame( Strings::uchr( 12302 ), $open, "Opening quote $open did not match quote style $style." ); |
241 | | - $this->assertSame( Strings::uchr( 12303 ), $close, "Closeing quote $close did not match quote style $style." ); |
| 241 | + $this->assertSame( U::LEFT_WHITE_CORNER_BRACKET, $open, "Opening quote $open did not match quote style $style." ); |
| 242 | + $this->assertSame( U::RIGHT_WHITE_CORNER_BRACKET, $close, "Closeing quote $close did not match quote style $style." ); |
242 | 243 | break; |
243 | 244 |
|
244 | 245 | default: |
|
0 commit comments