Skip to content

Commit 78bf50d

Browse files
committed
Add more test cases
We add zero output and testcase for num_to_wd_small
1 parent 9752c25 commit 78bf50d

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

ntwIndia/Test/ntwIndiaTest.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,47 @@ public function test_less_than_hundred() {
7272
$this->assertEquals( $wd, $this->ntw->num_to_word( $num ) );
7373
}
7474
}
75+
76+
public function test_zero_value() {
77+
$num = 0;
78+
$word = 'Zero';
79+
$this->assertEquals( $word, $this->ntw->num_to_word( $num ) );
80+
}
81+
82+
public function test_num_to_wd_small() {
83+
$num_to_wd = array(
84+
'0' => 'Zero',
85+
'1' => 'One',
86+
'2' => 'Two',
87+
'3' => 'Three',
88+
'4' => 'Four',
89+
'5' => 'Five',
90+
'6' => 'Six',
91+
'7' => 'Seven',
92+
'8' => 'Eight',
93+
'9' => 'Nine',
94+
'10' => 'Ten',
95+
'11' => 'Eleven',
96+
'12' => 'Twelve',
97+
'13' => 'Thirteen',
98+
'14' => 'Fourteen',
99+
'15' => 'Fifteen',
100+
'16' => 'Sixteen',
101+
'17' => 'Seventeen',
102+
'18' => 'Eighteen',
103+
'19' => 'Nineteen',
104+
'20' => 'Twenty',
105+
'30' => 'Thirty',
106+
'40' => 'Forty',
107+
'50' => 'Fifty',
108+
'60' => 'Sixty',
109+
'70' => 'Seventy',
110+
'80' => 'Eighty',
111+
'90' => 'Ninety',
112+
);
113+
114+
foreach ( $num_to_wd as $num => $wd ) {
115+
$this->assertEquals( $wd, $this->ntw->num_to_wd_small( $num ) );
116+
}
117+
}
75118
}

0 commit comments

Comments
 (0)