-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWordizeHelperTest.php
More file actions
109 lines (101 loc) · 3.28 KB
/
Copy pathWordizeHelperTest.php
File metadata and controls
109 lines (101 loc) · 3.28 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
App::uses('View', 'View');
App::uses('Helper', 'View');
App::uses('WordizeHelper', 'View/Helper');
/**
* WordizeHelper Test Case
*
*/
class WordizeHelperTest extends CakeTestCase {
/**
* setUp method
*
* @return void
*/
public function setUp() {
parent::setUp();
$View = new View();
$this->Wordize = new WordizeHelper($View);
}
/**
* tearDown method
*
* @return void
*/
public function tearDown() {
unset($this->Wordize);
parent::tearDown();
}
/**
* testExtensify method
*
* @return void
*/
/**
* @dataProvider additionProvider
*/
public function testExtensify( $b, $a ) {
// $this->markTestSkipped();
$this->assertEquals( $this->Wordize->extensify( $a ), $b );
}
public static function additionProvider() {
return array(
array( 'zero', 0 ),
array( 'one', 1 ),
array( 'ten', 10 ),
array( 'fourty-six', 46 ),
array( 'fourty-one', ' 41 ' ),
array( null, array() ),
array( 'nineteen', 19 ),
array( 'one hundred nineteen', 119 ),
array( 'ninety-eight', 98 ),
array( 'eight hundred ninety-nine', 899 ),
array( 'four hundred fifty-three', 453 ),
array( 'seven hundred six', 706 ),
array( 'three thousand eight hundred sixty-five', 3865 ),
array( 'seven thousand sixty-five', 7065 ),
array( 'thirty-seven thousand six hundred five', 37605 ),
);
}
/**
* @dataProvider cacheProvider
*/
public function testCache( $b, $a ) {
// $this->markTestSkipped();
$this->assertEquals( $this->Wordize->extensify( $a ), $b );
}
public static function cacheProvider() {
return array(
array( 'one', 1 ),
array( 'one hundred nineteen', 119 ),
array( 'eight hundred ninety-nine', 899 ),
array( 'four hundred fifty-three', 453 ),
array( 'four hundred fifty-three', 453 ),
array( 'four hundred fifty-three', 453 ),
array( 'four hundred fifty-three', 453 ),
array( 'four hundred fifty-three', 453 ),
array( 'four hundred fifty-three', 453 ),
array( 'fourty-one', ' 41 ' ),
array( 'nineteen', 19 ),
array( 'four hundred fifty-three', 453 ),
array( 'four hundred fifty-three', 453 ),
array( 'three thousand eight hundred sixty-five', 3865 ),
array( 'three thousand eight hundred sixty-five', 3865 ),
array( 'three thousand eight hundred sixty-five', 3865 ),
array( 'three thousand eight hundred sixty-five', 3865 ),
array( 'ten', 10 ),
array( 'fourty-six', 46 ),
array( 'three thousand eight hundred sixty-five', 3865 ),
array( 'three thousand eight hundred sixty-five', 3865 ),
array( 'ninety-eight', 98 ),
array( 'three thousand eight hundred sixty-five', 3865 ),
array( 'three thousand eight hundred sixty-five', 3865 ),
array( 'seven thousand sixty-five', 7065 ),
array( 'seven thousand sixty-five', 7065 ),
array( 'seven thousand sixty-five', 7065 ),
array( 'seven thousand sixty-five', 7065 ),
array( 'seven thousand sixty-five', 7065 ),
array( 'seven thousand sixty-five', 7065 ),
);
}
}