소스 검색

Fix test REST

Espinoza Guillermo 7 년 전
부모
커밋
a13300bbea
2개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 3
      src/IPv4Bundle/Form/HostType.php
  2. 8 1
      src/IPv4Bundle/tests/Controller/REST/HostRESTControllerTest.php

+ 1 - 3
src/IPv4Bundle/Form/HostType.php

@@ -16,9 +16,7 @@ class HostType extends AbstractType
     {
         $builder
             ->add('mac')
-            ->add('hostType', null, [
-                'required' => false
-            ])
+            ->add('hostType')
             ->add('state')
             ;
         foreach (DHCPOptions::getConstants() as $opt) {

+ 8 - 1
src/IPv4Bundle/tests/Controller/REST/HostRESTControllerTest.php

@@ -74,9 +74,16 @@ class HostRESTControllerTest extends BaseRESTControllerTest
      */
     protected function obtainData($key = null)
     {
+        $datos = [
+            'name' => 'HostType',
+            'shortname' => 'hosttype',
+            'opcode' => 1,
+        ];
+        $this->getClient()->request('POST', '/api/hosttypes.json', $datos);
+
         $datos = [
             'mac' => 'cafecafecafe',
-            'hostType' => null,
+            'hostType' => 1,
             'state' => HostStatus::STATE_ACTIVE,
             'filename' => 'cafecafecafe.bin',
         ];