|
1 | 1 | <?php |
2 | 2 |
|
3 | | -class DynamoDbCompositeModelTest extends ModelTest |
| 3 | +class DynamoDbCompositeModelTest extends DynamoDbModelTest |
4 | 4 | { |
5 | 5 | protected function getTestModel() |
6 | 6 | { |
@@ -45,16 +45,6 @@ public function testFindRecord() |
45 | 45 | $this->assertEquals($seedName, $item->name); |
46 | 46 | } |
47 | 47 |
|
48 | | - public function testGetAllRecords() |
49 | | - { |
50 | | - $this->seed(); |
51 | | - $this->seed(); |
52 | | - |
53 | | - $items = $this->testModel->all()->toArray(); |
54 | | - |
55 | | - $this->assertEquals(2, count($items)); |
56 | | - } |
57 | | - |
58 | 48 | public function testUpdateRecord() |
59 | 49 | { |
60 | 50 | $seed = $this->seed(); |
@@ -126,81 +116,6 @@ public function testDeleteRecord() |
126 | 116 | $this->assertArrayNotHasKey('Item', $record); |
127 | 117 | } |
128 | 118 |
|
129 | | - public function testGetAllRecordsWithEqualCondition() |
130 | | - { |
131 | | - $this->seed(['count' => ['N' => 10]]); |
132 | | - $this->seed(['count' => ['N' => 10]]); |
133 | | - $this->seed(['count' => ['N' => 10]]); |
134 | | - |
135 | | - $items = $this->testModel->where('count', 10)->get()->toArray(); |
136 | | - |
137 | | - $this->assertEquals(3, count($items)); |
138 | | - } |
139 | | - |
140 | | - public function testGetAllRecordsWithNonEqualCondition() |
141 | | - { |
142 | | - $this->seed(['count' => ['N' => 10]]); |
143 | | - $this->seed(['count' => ['N' => 11]]); |
144 | | - $this->seed(['count' => ['N' => 11]]); |
145 | | - |
146 | | - $items = $this->testModel->where('count', '!=', 10)->get()->toArray(); |
147 | | - |
148 | | - $this->assertEquals(2, count($items)); |
149 | | - } |
150 | | - |
151 | | - public function testGetAllRecordsWithGTCondition() |
152 | | - { |
153 | | - $this->seed(['count' => ['N' => 10]]); |
154 | | - $this->seed(['count' => ['N' => 11]]); |
155 | | - $this->seed(['count' => ['N' => 11]]); |
156 | | - |
157 | | - $items = $this->testModel->where('count', '>', 10)->get()->toArray(); |
158 | | - |
159 | | - $this->assertEquals(2, count($items)); |
160 | | - } |
161 | | - |
162 | | - public function testGetAllRecordsWithLTCondition() |
163 | | - { |
164 | | - $this->seed(['count' => ['N' => 10]]); |
165 | | - $this->seed(['count' => ['N' => 9]]); |
166 | | - $this->seed(['count' => ['N' => 11]]); |
167 | | - |
168 | | - $items = $this->testModel->where('count', '<', 10)->get()->toArray(); |
169 | | - |
170 | | - $this->assertEquals(1, count($items)); |
171 | | - } |
172 | | - |
173 | | - public function testGetAllRecordsWithGECondition() |
174 | | - { |
175 | | - $this->seed(['count' => ['N' => 10]]); |
176 | | - $this->seed(['count' => ['N' => 9]]); |
177 | | - $this->seed(['count' => ['N' => 11]]); |
178 | | - |
179 | | - $items = $this->testModel->where('count', '>=', 10)->get()->toArray(); |
180 | | - |
181 | | - $this->assertEquals(2, count($items)); |
182 | | - } |
183 | | - |
184 | | - public function testGetAllRecordsWithLECondition() |
185 | | - { |
186 | | - $this->seed(['count' => ['N' => 10]]); |
187 | | - $this->seed(['count' => ['N' => 9]]); |
188 | | - $this->seed(['count' => ['N' => 11]]); |
189 | | - |
190 | | - $items = $this->testModel->where('count', '<=', 10)->get()->toArray(); |
191 | | - |
192 | | - $this->assertEquals(2, count($items)); |
193 | | - } |
194 | | - |
195 | | - public function testGetFirstRecord() |
196 | | - { |
197 | | - $firstItem = $this->seed(); |
198 | | - |
199 | | - $items = $this->testModel->first(); |
200 | | - |
201 | | - $this->assertEquals(array_get($firstItem, 'id.S'), $items->id); |
202 | | - } |
203 | | - |
204 | 119 | protected function seed($attributes = []) |
205 | 120 | { |
206 | 121 | $item = [ |
|
0 commit comments