Changeset 48999
- Timestamp:
- 09/18/2020 02:11:11 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/pomo/pluralForms.php
r48937 r48999 200 200 * Ensures that an exception is thrown when an invalid plural form is encountered. 201 201 * 202 * The `@expectedException Exception` notation for PHPUnit cannot be used because expecting an203 * exception of type `Exception` is not supported before PHPUnit 3.7. The CI tests for PHP 5.2204 * run on PHPUnit 3.6.205 *206 202 * @ticket 41562 207 203 * @dataProvider data_exceptions 208 204 */ 209 public function test_exceptions( $expression, $expected_exception, $call_get ) { 210 try { 211 $plural_forms = new Plural_Forms( $expression ); 212 if ( $call_get ) { 213 $plural_forms->get( 1 ); 214 } 215 } catch ( Exception $e ) { 216 $this->assertSame( $expected_exception, $e->getMessage() ); 217 return; 218 } 219 220 $this->fail( 'Expected exception was not thrown.' ); 205 public function test_exceptions( $expression, $expected_message, $call_get ) { 206 $this->expectException( 'Exception' ); 207 $this->expectExceptionMessage( $expected_message ); 208 209 $plural_forms = new Plural_Forms( $expression ); 210 if ( $call_get ) { 211 $plural_forms->get( 1 ); 212 } 221 213 } 222 214
Note: See TracChangeset
for help on using the changeset viewer.