Bläddra i källkod

Fix test REST

Espinoza Guillermo 7 år sedan
förälder
incheckning
a13300bbea

+ 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',
         ];