forked from wp-cli/wp-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-inflector.php
More file actions
37 lines (31 loc) · 848 Bytes
/
test-inflector.php
File metadata and controls
37 lines (31 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
use WP_CLI\Inflector;
use WP_CLI\Tests\TestCase;
class InflectorTest extends TestCase {
/**
* @dataProvider dataProviderPluralize
*/
public function testPluralize( $singular, $expected ) {
$this->assertEquals( $expected, Inflector::pluralize( $singular ) );
}
public function dataProviderPluralize() {
return [
[ 'string', 'strings' ], // regular
[ 'person', 'people' ], // irregular
[ 'scissors', 'scissors' ], // uncountable
];
}
/**
* @dataProvider dataProviderSingularize
*/
public function testSingularize( $singular, $expected ) {
$this->assertEquals( $expected, Inflector::singularize( $singular ) );
}
public function dataProviderSingularize() {
return [
[ 'strings', 'string' ], // regular
[ 'people', 'person' ], // irregular
[ 'scissors', 'scissors' ], // uncountable
];
}
}