@@ 154-171 (lines=18) @@ | ||
151 | /** |
|
152 | * @depends testCreateAction |
|
153 | */ |
|
154 | public function testCreateAction_EmptyName() |
|
155 | { |
|
156 | $params = array( |
|
157 | 'record' => array( |
|
158 | 'id' => '', |
|
159 | 'name' => '', |
|
160 | 'refName' => '', |
|
161 | ), |
|
162 | ); |
|
163 | ||
164 | $result = static::$controller->createAction($params); |
|
165 | ||
166 | $this->assertArrayHasKey('success', $result); |
|
167 | $this->assertFalse($result['success']); |
|
168 | $this->assertArrayHasKey('field_errors', $result); |
|
169 | $this->assertCount(1, $result['field_errors']); |
|
170 | $this->assertArrayHasKey('name', $result['field_errors']); |
|
171 | } |
|
172 | ||
173 | /** |
|
174 | * @depends testCreateAction |
|
@@ 176-193 (lines=18) @@ | ||
173 | /** |
|
174 | * @depends testCreateAction |
|
175 | */ |
|
176 | public function testCreateAction_DuplicatedRefName() |
|
177 | { |
|
178 | $params = array( |
|
179 | 'record' => array( |
|
180 | 'id' => '', |
|
181 | 'name' => 'testName2', |
|
182 | 'refName' => 'testRefName', |
|
183 | ), |
|
184 | ); |
|
185 | ||
186 | $result = static::$controller->createAction($params); |
|
187 | ||
188 | $this->assertArrayHasKey('success', $result); |
|
189 | $this->assertFalse($result['success']); |
|
190 | $this->assertArrayHasKey('field_errors', $result); |
|
191 | $this->assertCount(1, $result['field_errors']); |
|
192 | $this->assertArrayHasKey('refName', $result['field_errors']); |
|
193 | } |
|
194 | ||
195 | /** |
|
196 | * @depends testCreateAction |