@@ -14,7 +14,7 @@ class Hm_Test_Searchable extends TestCase {
14
14
15
15
public function setUp (): void {
16
16
require __DIR__ .'/../bootstrap.php ' ;
17
- Mock_Searchable_Entity ::resetTestData ();
17
+ Searchable_Wrapper ::resetTestData ();
18
18
}
19
19
20
20
/**
@@ -24,7 +24,7 @@ public function setUp(): void {
24
24
* @runInSeparateProcess
25
25
*/
26
26
public function test_getBy_with_id_search () {
27
- $ results = Mock_Searchable_Entity ::getBy (1 );
27
+ $ results = Searchable_Wrapper ::getBy (1 );
28
28
29
29
$ this ->assertIsArray ($ results );
30
30
$ this ->assertCount (1 , $ results );
@@ -38,7 +38,7 @@ public function test_getBy_with_id_search() {
38
38
* @runInSeparateProcess
39
39
*/
40
40
public function test_getBy_with_custom_column () {
41
- $ results = Mock_Searchable_Entity ::getBy ('active ' , 'status ' );
41
+ $ results = Searchable_Wrapper ::getBy ('active ' , 'status ' );
42
42
43
43
$ this ->assertIsArray ($ results );
44
44
$ this ->assertCount (3 , $ results ); // John, Bob, Charlie
@@ -54,7 +54,7 @@ public function test_getBy_with_custom_column() {
54
54
* @runInSeparateProcess
55
55
*/
56
56
public function test_getBy_return_first_match () {
57
- $ result = Mock_Searchable_Entity ::getBy ('active ' , 'status ' , true );
57
+ $ result = Searchable_Wrapper ::getBy ('active ' , 'status ' , true );
58
58
59
59
$ this ->assertIsArray ($ result );
60
60
$ this ->assertEquals (1 , $ result ['id ' ]);
@@ -68,7 +68,7 @@ public function test_getBy_return_first_match() {
68
68
* @runInSeparateProcess
69
69
*/
70
70
public function test_getBy_no_matches () {
71
- $ results = Mock_Searchable_Entity ::getBy (999 );
71
+ $ results = Searchable_Wrapper ::getBy (999 );
72
72
73
73
$ this ->assertIsArray ($ results );
74
74
$ this ->assertCount (0 , $ results );
@@ -80,7 +80,7 @@ public function test_getBy_no_matches() {
80
80
* @runInSeparateProcess
81
81
*/
82
82
public function test_getBy_no_matches_return_first () {
83
- $ result = Mock_Searchable_Entity ::getBy (999 , 'id ' , true );
83
+ $ result = Searchable_Wrapper ::getBy (999 , 'id ' , true );
84
84
85
85
$ this ->assertNull ($ result );
86
86
}
@@ -91,7 +91,7 @@ public function test_getBy_no_matches_return_first() {
91
91
* @runInSeparateProcess
92
92
*/
93
93
public function test_getBy_non_existent_column () {
94
- $ results = Mock_Searchable_Entity ::getBy ('test ' , 'non_existent_column ' );
94
+ $ results = Searchable_Wrapper ::getBy ('test ' , 'non_existent_column ' );
95
95
96
96
$ this ->assertIsArray ($ results );
97
97
$ this ->assertCount (0 , $ results );
@@ -103,7 +103,7 @@ public function test_getBy_non_existent_column() {
103
103
* @runInSeparateProcess
104
104
*/
105
105
public function test_getBy_multiple_matches () {
106
- $ results = Mock_Searchable_Entity ::getBy (30 , 'age ' );
106
+ $ results = Searchable_Wrapper ::getBy (30 , 'age ' );
107
107
108
108
$ this ->assertIsArray ($ results );
109
109
$ this ->assertCount (2 , $ results ); // John and Charlie both age 30
@@ -119,7 +119,7 @@ public function test_getBy_multiple_matches() {
119
119
* @runInSeparateProcess
120
120
*/
121
121
public function test_getBy_string_search () {
122
- $ results =
Mock_Searchable_Entity ::
getBy (
'[email protected] ' ,
'email ' );
122
+ $ results =
Searchable_Wrapper ::
getBy (
'[email protected] ' ,
'email ' );
123
123
124
124
$ this ->assertIsArray ($ results );
125
125
$ this ->assertCount (1 , $ results );
@@ -132,7 +132,7 @@ public function test_getBy_string_search() {
132
132
* @runInSeparateProcess
133
133
*/
134
134
public function test_getBy_empty_dataset () {
135
- $ results = Mock_Empty_Searchable_Entity ::getBy (1 );
135
+ $ results = Empty_Searchable_Wrapper ::getBy (1 );
136
136
137
137
$ this ->assertIsArray ($ results );
138
138
$ this ->assertCount (0 , $ results );
@@ -144,7 +144,7 @@ public function test_getBy_empty_dataset() {
144
144
* @runInSeparateProcess
145
145
*/
146
146
public function test_getBy_empty_dataset_return_first () {
147
- $ result = Mock_Empty_Searchable_Entity ::getBy (1 , 'id ' , true );
147
+ $ result = Empty_Searchable_Wrapper ::getBy (1 , 'id ' , true );
148
148
149
149
$ this ->assertNull ($ result );
150
150
}
@@ -156,11 +156,11 @@ public function test_getBy_empty_dataset_return_first() {
156
156
* @runInSeparateProcess
157
157
*/
158
158
public function test_getBy_null_value_search () {
159
- Mock_Searchable_Entity ::setTestData ([
159
+ Searchable_Wrapper ::setTestData ([
160
160
['id ' => 1 , 'name ' => 'Test ' , 'email ' => null , 'status ' => 'active ' ]
161
161
]);
162
162
163
- $ results = Mock_Searchable_Entity ::getBy (null , 'email ' );
163
+ $ results = Searchable_Wrapper ::getBy (null , 'email ' );
164
164
165
165
$ this ->assertIsArray ($ results );
166
166
$ this ->assertCount (0 , $ results );
@@ -172,13 +172,13 @@ public function test_getBy_null_value_search() {
172
172
* @runInSeparateProcess
173
173
*/
174
174
public function test_getBy_missing_vs_null_column () {
175
- Mock_Searchable_Entity ::setTestData ([
175
+ Searchable_Wrapper ::setTestData ([
176
176
['id ' => 1 , 'name ' => 'Test1 ' , 'email ' => null ],
177
177
['id ' => 2 , 'name ' => 'Test2 ' ]
178
178
]);
179
179
180
- $ nullResults = Mock_Searchable_Entity ::getBy (null , 'email ' );
181
- $ missingResults = Mock_Searchable_Entity ::getBy ('anything ' , 'missing_column ' );
180
+ $ nullResults = Searchable_Wrapper ::getBy (null , 'email ' );
181
+ $ missingResults = Searchable_Wrapper ::getBy ('anything ' , 'missing_column ' );
182
182
183
183
$ this ->assertCount (0 , $ nullResults );
184
184
$ this ->assertCount (0 , $ missingResults );
@@ -190,13 +190,13 @@ public function test_getBy_missing_vs_null_column() {
190
190
* @runInSeparateProcess
191
191
*/
192
192
public function test_getBy_boolean_value_search () {
193
- Mock_Searchable_Entity ::setTestData ([
193
+ Searchable_Wrapper ::setTestData ([
194
194
['id ' => 1 , 'name ' => 'Test1 ' , 'active ' => true ],
195
195
['id ' => 2 , 'name ' => 'Test2 ' , 'active ' => false ],
196
196
['id ' => 3 , 'name ' => 'Test3 ' , 'active ' => true ]
197
197
]);
198
198
199
- $ results = Mock_Searchable_Entity ::getBy (true , 'active ' );
199
+ $ results = Searchable_Wrapper ::getBy (true , 'active ' );
200
200
201
201
$ this ->assertIsArray ($ results );
202
202
$ this ->assertCount (2 , $ results );
@@ -212,12 +212,12 @@ public function test_getBy_boolean_value_search() {
212
212
* @runInSeparateProcess
213
213
*/
214
214
public function test_getBy_numeric_string_search () {
215
- Mock_Searchable_Entity ::setTestData ([
215
+ Searchable_Wrapper ::setTestData ([
216
216
['id ' => 1 , 'name ' => 'Test ' , 'code ' => '123 ' ],
217
217
['id ' => 2 , 'name ' => 'Test2 ' , 'code ' => 123 ]
218
218
]);
219
219
220
- $ results = Mock_Searchable_Entity ::getBy ('123 ' , 'code ' );
220
+ $ results = Searchable_Wrapper ::getBy ('123 ' , 'code ' );
221
221
222
222
$ this ->assertIsArray ($ results );
223
223
$ this ->assertCount (1 , $ results );
0 commit comments