|
7 | 7 | class ezFunctionsTest extends EZTestCase |
8 | 8 | { |
9 | 9 | protected function setUp(): void |
10 | | - { |
| 10 | + { |
11 | 11 | \clearInstance(); |
12 | 12 | } |
13 | 13 |
|
@@ -58,146 +58,159 @@ public function testDropColumn() |
58 | 58 |
|
59 | 59 | public function testEq() |
60 | 60 | { |
61 | | - $this->assertInternalType('array', eq('field', 'data')); |
| 61 | + $this->assertIsArray(eq('field', 'data')); |
62 | 62 | $this->assertArraySubset([1 => EQ], eq('field', 'data')); |
63 | 63 | } |
64 | 64 |
|
65 | 65 | public function testNeq() |
66 | 66 | { |
67 | | - $this->assertInternalType('array', neq('field', 'data')); |
| 67 | + $this->assertIsArray(neq('field', 'data')); |
68 | 68 | $this->assertArraySubset([3 => _AND], neq('field', 'data', _AND)); |
69 | 69 | } |
70 | 70 |
|
71 | 71 | public function testNe() |
72 | 72 | { |
73 | | - $this->assertInternalType('array', ne('field', 'data')); |
| 73 | + $this->assertIsArray(ne('field', 'data')); |
74 | 74 | $this->assertArraySubset([4 => 'extra'], ne('field', 'data', _AND, 'extra')); |
75 | 75 | } |
76 | 76 |
|
77 | 77 | public function testLt() |
78 | 78 | { |
79 | | - $this->assertInternalType('array', lt('field', 'data')); |
| 79 | + $this->assertIsArray(lt('field', 'data')); |
80 | 80 | $this->assertArraySubset([2 => 'data'], lt('field', 'data')); |
81 | 81 | } |
82 | 82 |
|
83 | 83 | public function testLte() |
84 | 84 | { |
85 | | - $this->assertInternalType('array', lte('field', 'data')); |
| 85 | + $this->assertIsArray(lte('field', 'data')); |
86 | 86 | $this->assertArraySubset([0 => 'field'], lte('field', 'data')); |
87 | 87 | } |
88 | 88 |
|
89 | 89 | public function testGt() |
90 | 90 | { |
91 | | - $this->assertInternalType('array', gt('field', 'data')); |
| 91 | + $this->assertIsArray(gt('field', 'data')); |
92 | 92 | $this->assertArraySubset([0 => 'field'], gt('field', 'data')); |
93 | 93 | } |
94 | 94 |
|
95 | 95 | public function testGte() |
96 | 96 | { |
97 | | - $this->assertInternalType('array', gte('field', 'data')); |
| 97 | + $this->assertIsArray(gte('field', 'data')); |
98 | 98 | $this->assertArraySubset([0 => 'field'], gte('field', 'data')); |
99 | 99 | } |
100 | 100 |
|
101 | 101 | public function testIsNull() |
102 | 102 | { |
103 | | - $this->assertInternalType('array', isNull('field')); |
| 103 | + $this->assertIsArray(isNull('field')); |
104 | 104 | $this->assertArraySubset([2 => 'null'], isNull('field')); |
105 | 105 | } |
106 | 106 |
|
107 | 107 | public function testIsNotNull() |
108 | 108 | { |
109 | | - $this->assertInternalType('array', isNotNull('field')); |
| 109 | + $this->assertIsArray(isNotNull('field')); |
110 | 110 | $this->assertArraySubset([2 => 'null'], isNotNull('field')); |
111 | 111 | } |
112 | 112 |
|
113 | 113 | public function testLike() |
114 | 114 | { |
115 | | - $this->assertInternalType('array', like('field', 'data')); |
| 115 | + $this->assertIsArray(like('field', 'data')); |
116 | 116 | $this->assertArraySubset([2 => 'data'], like('field', 'data')); |
117 | 117 | } |
118 | 118 |
|
119 | 119 | public function testNotLike() |
120 | 120 | { |
121 | | - $this->assertInternalType('array', notLike('field', 'data')); |
| 121 | + $this->assertIsArray(notLike('field', 'data')); |
122 | 122 | $this->assertArraySubset([2 => 'data'], notLike('field', 'data')); |
123 | 123 | } |
124 | 124 |
|
125 | 125 | public function testIn() |
126 | 126 | { |
127 | | - $this->assertInternalType('array', in('field', 'data')); |
| 127 | + $this->assertIsArray(in('field', 'data')); |
128 | 128 | $this->assertArraySubset([8 => 'data6'], in('field', 'data', 'data1', 'data2', 'data3', 'data4', 'data5', 'data6')); |
129 | 129 | } |
130 | 130 |
|
131 | 131 | public function testNotIn() |
132 | 132 | { |
133 | | - $this->assertInternalType('array', notIn('field', 'data')); |
| 133 | + $this->assertIsArray(notIn('field', 'data')); |
134 | 134 | $this->assertArraySubset([5 => 'data3'], notIn('field', 'data', 'data1', 'data2', 'data3', 'data4', 'data5', 'data6')); |
135 | 135 | } |
136 | 136 |
|
137 | 137 | public function testBetween() |
138 | 138 | { |
139 | | - $this->assertInternalType('array', between('field', 'data', 'data2')); |
| 139 | + $this->assertIsArray(between('field', 'data', 'data2')); |
140 | 140 | $this->assertArraySubset([1 => _BETWEEN], between('field', 'data', 'data2')); |
141 | 141 | } |
142 | 142 |
|
143 | 143 | public function testNotBetween() |
144 | 144 | { |
145 | | - $this->assertInternalType('array', notBetween('field', 'data', 'data2')); |
| 145 | + $this->assertIsArray(notBetween('field', 'data', 'data2')); |
146 | 146 | $this->assertArraySubset([3 => 'data2'], notBetween('field', 'data', 'data2')); |
147 | 147 | } |
148 | 148 |
|
149 | | - public function testSetInstance() { |
| 149 | + public function testSetInstance() |
| 150 | + { |
150 | 151 | $this->assertFalse(\setInstance()); |
151 | 152 | $this->assertFalse(\setInstance($this)); |
152 | 153 | } |
153 | 154 |
|
154 | | - public function testSelect() { |
| 155 | + public function testSelect() |
| 156 | + { |
155 | 157 | $this->assertFalse(select('')); |
156 | 158 | } |
157 | 159 |
|
158 | | - public function testSelect_into() { |
| 160 | + public function testSelect_into() |
| 161 | + { |
159 | 162 | $this->assertFalse(select_into('field', 'data', 'data2')); |
160 | 163 | } |
161 | 164 |
|
162 | | - public function testInsert_select() { |
| 165 | + public function testInsert_select() |
| 166 | + { |
163 | 167 | $this->assertFalse(insert_select('field', 'data', 'data2')); |
164 | 168 | } |
165 | 169 |
|
166 | | - public function testCreate_select() { |
| 170 | + public function testCreate_select() |
| 171 | + { |
167 | 172 | $this->assertFalse(create_select('field', 'data', 'data2')); |
168 | 173 | } |
169 | 174 |
|
170 | | - public function testWhere() { |
| 175 | + public function testWhere() |
| 176 | + { |
171 | 177 | $this->assertFalse(where('field', 'data', 'data2')); |
172 | 178 | } |
173 | 179 |
|
174 | | - public function testGroupBy() { |
| 180 | + public function testGroupBy() |
| 181 | + { |
175 | 182 | $this->assertFalse(groupBy('')); |
176 | 183 | $this->assertNotNull(groupBy('field')); |
177 | 184 | } |
178 | 185 |
|
179 | | - public function testHaving() { |
| 186 | + public function testHaving() |
| 187 | + { |
180 | 188 | $this->assertFalse(having('field', 'data', 'data2')); |
181 | 189 | } |
182 | 190 |
|
183 | | - public function testOrderBy() { |
| 191 | + public function testOrderBy() |
| 192 | + { |
184 | 193 | $this->assertFalse(orderBy('', 'data')); |
185 | 194 | $this->assertNotNull(orderBy('field', 'data')); |
186 | 195 | } |
187 | 196 |
|
188 | | - public function testInsert() { |
| 197 | + public function testInsert() |
| 198 | + { |
189 | 199 | $this->assertFalse(insert('field', ['data' => 'data2'])); |
190 | 200 | } |
191 | 201 |
|
192 | | - public function testUpdate() { |
| 202 | + public function testUpdate() |
| 203 | + { |
193 | 204 | $this->assertFalse(update('field', 'data', 'data2')); |
194 | 205 | } |
195 | 206 |
|
196 | | - public function testDeleting() { |
| 207 | + public function testDeleting() |
| 208 | + { |
197 | 209 | $this->assertFalse(deleting('field', 'data', 'data2')); |
198 | 210 | } |
199 | 211 |
|
200 | | - public function testReplace() { |
| 212 | + public function testReplace() |
| 213 | + { |
201 | 214 | $this->assertFalse(replace('field', ['data' => 'data2'])); |
202 | 215 | } |
203 | 216 | } |
0 commit comments