forked from laravel/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSupportPluralizerTest.php
More file actions
executable file
·56 lines (44 loc) · 1.76 KB
/
SupportPluralizerTest.php
File metadata and controls
executable file
·56 lines (44 loc) · 1.76 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
class SupportPluralizerTest extends PHPUnit_Framework_TestCase {
public function testBasicSingular()
{
$this->assertEquals('child', str_singular('children'));
$this->assertEquals('test', str_singular('tests'));
$this->assertEquals('deer', str_singular('deer'));
$this->assertEquals('criterion', str_singular('criteria'));
}
public function testBasicPlural()
{
$this->assertEquals('children', str_plural('child'));
$this->assertEquals('tests', str_plural('test'));
$this->assertEquals('deer', str_plural('deer'));
}
public function testCaseSensitiveSingularUsage()
{
$this->assertEquals('Child', str_singular('Children'));
$this->assertEquals('CHILD', str_singular('CHILDREN'));
$this->assertEquals('Test', str_singular('Tests'));
$this->assertEquals('TEST', str_singular('TESTS'));
$this->assertEquals('Deer', str_singular('Deer'));
$this->assertEquals('DEER', str_singular('DEER'));
$this->assertEquals('Criterion', str_singular('Criteria'));
$this->assertEquals('CRITERION', str_singular('CRITERIA'));
}
public function testCaseSensitiveSingularPlural()
{
$this->assertEquals('Children', str_plural('Child'));
$this->assertEquals('CHILDREN', str_plural('CHILD'));
$this->assertEquals('Tests', str_plural('Test'));
$this->assertEquals('TESTS', str_plural('TEST'));
$this->assertEquals('tests', str_plural('test'));
$this->assertEquals('Deer', str_plural('Deer'));
$this->assertEquals('DEER', str_plural('DEER'));
}
public function testIfEndOfWordPlural()
{
$this->assertEquals('VortexFields', str_plural('VortexField'));
$this->assertEquals('MatrixFields', str_plural('MatrixField'));
$this->assertEquals('IndexFields', str_plural('IndexField'));
$this->assertEquals('VertexFields', str_plural('VertexField'));
}
}