diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index af59ca1..7b795be 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -4,7 +4,7 @@ - SEQ-UBV | {% block title %} INICIO {% endblock %} + PRUEBA| {% block title %} INICIO {% endblock %} @@ -132,7 +132,7 @@ - + {% endblock %} diff --git a/app/Resources/views/candidato/edit.html.twig b/app/Resources/views/candidato/edit.html.twig new file mode 100644 index 0000000..48e5b21 --- /dev/null +++ b/app/Resources/views/candidato/edit.html.twig @@ -0,0 +1,21 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Candidato edit

+ + {{ form_start(edit_form) }} + {{ form_widget(edit_form) }} + + {{ form_end(edit_form) }} + + +{% endblock %} diff --git a/app/Resources/views/candidato/index.html.twig b/app/Resources/views/candidato/index.html.twig new file mode 100644 index 0000000..a00eddb --- /dev/null +++ b/app/Resources/views/candidato/index.html.twig @@ -0,0 +1,72 @@ +{% extends 'base.html.twig' %} + +{% block body %} + +{% for type, flashMessage in app.session.flashbag.all() %} +
+ +{% if flashMessage.title is defined %} +{{ flashMessage.title }} +{{ flashMessage.message }} +{% else %} +{{ type }} +{% endif %} +
+{% endfor %} + +

Lista de Candidatos

+ + Agregar + + + + + + + + + + + + + + + + + + + + + {% for candidato in candidatos %} + + + + + + + + + + + + + + + + {% endfor %} + +
CedulaNombreApellidoStatusInstruccionOcupacionPromedioInstitucionPaisEstadoMunicipioDireccionActions
{{ candidato.cedula }}{{ candidato.nombre }}{{ candidato.apellido }}{% if candidato.activo %}Yes{% else %}No{% endif %}{{ candidato.instruccion }}{{ candidato.ocupacion }}{{ candidato.promedio }}{{ candidato.institucion }}{{ candidato.pais }}{{ candidato.estado }}{{ candidato.municipio }}{{ candidato.direccion }} + + +
    + + + + + + +
+
+ + +{% endblock %} diff --git a/app/Resources/views/candidato/new.html.twig b/app/Resources/views/candidato/new.html.twig new file mode 100644 index 0000000..ef84385 --- /dev/null +++ b/app/Resources/views/candidato/new.html.twig @@ -0,0 +1,157 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Creacion de Candidato

+
+

Datos Personales

+
+
+ {{ form_label(form.nombre) }} + {{ form_widget(form.nombre) }} + {% if form.cedula.vars.errors[0].message is defined %} + + {{ form.nombre.vars.errors[0].message }} + + {% endif %} +
+
+ {{ form_label(form.apellido) }} + {{ form_widget(form.apellido) }} + {% if form.apellido.vars.errors[0].message is defined %} + + {{ form.apellido.vars.errors[0].message }} + + {% endif %} +
+
+
+
+
+ {{ form_label(form.cedula) }} + {{ form_widget(form.cedula) }} + {% if form.cedula.vars.errors[0].message is defined %} + + {{ form.cedula.vars.errors[0].message }} + + {% endif %} +
+
+
+
+ {{ form_label(form.activo) }} + {{ form_widget(form.activo) }} + {% if form.edad.vars.errors[0].message is defined %} + + {{ form.activo.vars.errors[0].message }} + + {% endif %} +
+
+
+

Datos Academicos

+
+
+ + {{ form_label(form.instruccion) }} + {{ form_widget(form.instruccion) }} + {% if form.instruccion.vars.errors[0].message is defined %} + + {{ form.instruccion.vars.errors[0].message }} + + {% endif %} +
+
+ + {{ form_label(form.ocupacion) }} + {{ form_widget(form.ocupacion) }} + {% if form.ocupacion.vars.errors[0].message is defined %} + + {{ form.ocupacion.vars.errors[0].message }} + + {% endif %} +
+
+
+
+
+ + {{ form_label(form.promedio) }} + {{ form_widget(form.promedio) }} + {% if form.promedio.vars.errors[0].message is defined %} + + {{ form.promedio.vars.errors[0].message }} + + {% endif %} +
+
+ + {{ form_label(form.institucion) }} + {{ form_widget(form.institucion) }} + {% if form.instruccion.vars.errors[0].message is defined %} + + {{ form.instruccion.vars.errors[0].message }} + + {% endif %} +
+
+
+
+

Ubicacion Geografica

+
+
+ {{ form_label(form.pais) }} + {{ form_widget(form.pais) }} + {% if form.pais.vars.errors[0].message is defined %} + + {{ form.pais.vars.errors[0].message }} + + {% endif %} +
+
+
+ + + {% if form.estado.vars.errors[0].message is defined %} + + {{ form.estado.vars.errors[0].message }} + + {% endif %} +
+
+
+
+
+ {{ form_label(form.municipio) }} + {{ form_widget(form.municipio) }} + {% if form.municipio.vars.errors[0].message is defined %} + + {{ form.municipio.vars.errors[0].message }} + + {% endif %} +
+
+ {{ form_label(form.direccion) }} + {{ form_widget(form.direccion) }} + {% if form.direccion.vars.errors[0].message is defined %} + + {{ form.direccion.vars.errors[0].message }} + + {% endif %} +
+
+ + + + + +{% endblock %} diff --git a/app/Resources/views/candidato/show.html.twig b/app/Resources/views/candidato/show.html.twig new file mode 100644 index 0000000..a773357 --- /dev/null +++ b/app/Resources/views/candidato/show.html.twig @@ -0,0 +1,76 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Candidato

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Id{{ candidato.id }}
Nombre{{ candidato.nombre }}
Apellido{{ candidato.apellido }}
Cedula{{ candidato.cedula }}
Activo{% if candidato.activo %}Yes{% else %}No{% endif %}
Instruccion{{ candidato.instruccion }}
Ocupacion{{ candidato.ocupacion }}
Promedio{{ candidato.promedio }}
Institucion{{ candidato.institucion }}
Pais{{ candidato.pais }}
Estado{{ candidato.estado }}
Municipio{{ candidato.municipio }}
Direccion{{ candidato.direccion }}
+ + +{% endblock %} diff --git a/app/Resources/views/estado/edit.html.twig b/app/Resources/views/estado/edit.html.twig new file mode 100644 index 0000000..26cb310 --- /dev/null +++ b/app/Resources/views/estado/edit.html.twig @@ -0,0 +1,21 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Estado edit

+ + {{ form_start(edit_form) }} + {{ form_widget(edit_form) }} + + {{ form_end(edit_form) }} + + +{% endblock %} diff --git a/app/Resources/views/estado/index.html.twig b/app/Resources/views/estado/index.html.twig new file mode 100644 index 0000000..48391f4 --- /dev/null +++ b/app/Resources/views/estado/index.html.twig @@ -0,0 +1,41 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Estados list

+ + + + + + + + + + + + {% for estado in estados %} + + + + + + + {% endfor %} + +
IdDescripcionCodigoActions
{{ estado.id }}{{ estado.descripcion }}{{ estado.codigo }} + +
+ + +{% endblock %} diff --git a/app/Resources/views/estado/new.html.twig b/app/Resources/views/estado/new.html.twig new file mode 100644 index 0000000..460721b --- /dev/null +++ b/app/Resources/views/estado/new.html.twig @@ -0,0 +1,16 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Estado creation

+ + {{ form_start(form) }} + {{ form_widget(form) }} + + {{ form_end(form) }} + + +{% endblock %} diff --git a/app/Resources/views/estado/show.html.twig b/app/Resources/views/estado/show.html.twig new file mode 100644 index 0000000..b6edad6 --- /dev/null +++ b/app/Resources/views/estado/show.html.twig @@ -0,0 +1,36 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Estado

+ + + + + + + + + + + + + + + + +
Id{{ estado.id }}
Descripcion{{ estado.descripcion }}
Codigo{{ estado.codigo }}
+ + +{% endblock %} diff --git a/app/Resources/views/municipio/edit.html.twig b/app/Resources/views/municipio/edit.html.twig new file mode 100644 index 0000000..c3b65d1 --- /dev/null +++ b/app/Resources/views/municipio/edit.html.twig @@ -0,0 +1,21 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Municipio edit

+ + {{ form_start(edit_form) }} + {{ form_widget(edit_form) }} + + {{ form_end(edit_form) }} + + +{% endblock %} diff --git a/app/Resources/views/municipio/index.html.twig b/app/Resources/views/municipio/index.html.twig new file mode 100644 index 0000000..1f12845 --- /dev/null +++ b/app/Resources/views/municipio/index.html.twig @@ -0,0 +1,43 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Municipios list

+ + + + + + + + + + + + + {% for municipio in municipios %} + + + + + + + + {% endfor %} + +
IdDescripcionCodigoEstadoActions
{{ municipio.id }}{{ municipio.descripcion }}{{ municipio.codigo }}{{ municipio.estado }} + +
+ + +{% endblock %} diff --git a/app/Resources/views/municipio/new.html.twig b/app/Resources/views/municipio/new.html.twig new file mode 100644 index 0000000..1f0cff5 --- /dev/null +++ b/app/Resources/views/municipio/new.html.twig @@ -0,0 +1,16 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Municipio creation

+ + {{ form_start(form) }} + {{ form_widget(form) }} + + {{ form_end(form) }} + + +{% endblock %} diff --git a/app/Resources/views/municipio/show.html.twig b/app/Resources/views/municipio/show.html.twig new file mode 100644 index 0000000..55470a4 --- /dev/null +++ b/app/Resources/views/municipio/show.html.twig @@ -0,0 +1,36 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Municipio

+ + + + + + + + + + + + + + + + +
Id{{ municipio.id }}
Descripcion{{ municipio.descripcion }}
Codigo{{ municipio.codigo }}
+ + +{% endblock %} diff --git a/app/Resources/views/pruebaed/edit.html.twig b/app/Resources/views/pruebaed/edit.html.twig new file mode 100644 index 0000000..6d837d6 --- /dev/null +++ b/app/Resources/views/pruebaed/edit.html.twig @@ -0,0 +1,89 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Editar Prueba

+ + +
+ + +
+
+
+ {{ form_label(edit_form.nombre) }} + {{ form_widget(edit_form.nombre) }} + + {% if form.nombre.vars.errors[0].message is defined %} + + {{ form.nombre.vars.errors[0].message }} + + {% endif %} +
+
+
+
+ {{ form_label(edit_form.apellido) }} + {{ form_widget(edit_form.apellido) }} + {% if form.apellido.vars.errors[0].message is defined %} + + {{ form.apellido.vars.errors[0].message }} + + {% endif %} +
+
+
+
+
+
+
+ {{ form_label(edit_form.cedula) }} + {{ form_widget(edit_form.cedula) }} + {% if form.cedula.vars.errors[0].message is defined %} + + {{ form.cedula.vars.errors[0].message }} + + {% endif %} +
+
+
+
+ {{ form_label(edit_form.edad) }} + {{ form_widget(edit_form.edad) }} + {% if form.edad.vars.errors[0].message is defined %} + + {{ form.edad.vars.errors[0].message }} + + {% endif %} +
+
+
+
+
+
+
+ {{ form_label(edit_form.direccion) }} + {{ form_widget(edit_form.direccion) }} + {% if form.direccion.vars.errors[0].message is defined %} + + {{ form.direccion.vars.errors[0].message }} + + {% endif %} +
+
+
+
+ +
+
+
    + + + {{form_widget(edit_form._token)}} + + +
+
+
+ + +{% endblock %} diff --git a/app/Resources/views/pruebaed/index.html.twig b/app/Resources/views/pruebaed/index.html.twig new file mode 100644 index 0000000..ad81229 --- /dev/null +++ b/app/Resources/views/pruebaed/index.html.twig @@ -0,0 +1,59 @@ +{% extends 'base.html.twig' %} + +{% block body %} + +{% for type, flashMessage in app.session.flashbag.all() %} +
+ +{% if flashMessage.title is defined %} +{{ flashMessage.title }} +{{ flashMessage.message }} +{% else %} +{{ type }} +{% endif %} +
+{% endfor %} + +

Lista de Pruebaeds

+ + Agregar + + + + + + + + + + + + + + + {% for pruebaed in pruebaeds %} + + + + + + + + + + {% endfor %} + +
IdNombreApellidoCedulaEdadDireccionActions
{{ pruebaed.id }}{{ pruebaed.nombre }}{{ pruebaed.apellido }}{{ pruebaed.cedula }}{{ pruebaed.edad }}{{ pruebaed.direccion }} +
    + + + + + +
+
+ + +{% endblock %} diff --git a/app/Resources/views/pruebaed/new.html.twig b/app/Resources/views/pruebaed/new.html.twig new file mode 100644 index 0000000..480a8e4 --- /dev/null +++ b/app/Resources/views/pruebaed/new.html.twig @@ -0,0 +1,80 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Registro Prueba

+ + {{ form_start(form, {'attr': {'novalidate': 'novalidate'}, 'action': path('pruebaed_new')}) }} + + + +
+
+ {{ form_label(form.nombre) }} + {{ form_widget(form.nombre) }} + {% if form.cedula.vars.errors[0].message is defined %} + + {{ form.nombre.vars.errors[0].message }} + + {% endif %} +
+
+ {{ form_label(form.apellido) }} + {{ form_widget(form.apellido) }} + {% if form.apellido.vars.errors[0].message is defined %} + + {{ form.apellido.vars.errors[0].message }} + + {% endif %} +
+
+
+
+
+ {{ form_label(form.cedula) }} + {{ form_widget(form.cedula) }} + {% if form.cedula.vars.errors[0].message is defined %} + + {{ form.cedula.vars.errors[0].message }} + + {% endif %} +
+
+ + {{ form_label(form.edad) }} + {{ form_widget(form.edad) }} + {% if form.edad.vars.errors[0].message is defined %} + + {{ form.edad.vars.errors[0].message }} + + {% endif %} +
+
+
+
+
+ {{ form_label(form.direccion) }} + {{ form_widget(form.direccion) }} + {% if form.direccion.vars.errors[0].message is defined %} + + {{ form.direccion.vars.errors[0].message }} + + {% endif %} +
+
+
+
+
+
    + + {{form_end(form)}} + + +
+
+
+ + + + + +{% endblock %} diff --git a/app/Resources/views/pruebaed/show.html.twig b/app/Resources/views/pruebaed/show.html.twig new file mode 100644 index 0000000..9658160 --- /dev/null +++ b/app/Resources/views/pruebaed/show.html.twig @@ -0,0 +1,46 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Pruebaed

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Id{{ pruebaed.id }}
Nombre{{ pruebaed.nombre }}
Apellido{{ pruebaed.apellido }}
Cedula{{ pruebaed.cedula }}
Edad{{ pruebaed.edad }}
Direccion{{ pruebaed.direccion }}
+ + +{% endblock %} diff --git a/src/UBV/PracticaBundle/Controller/candidatoController.php b/src/UBV/PracticaBundle/Controller/candidatoController.php new file mode 100644 index 0000000..e847d94 --- /dev/null +++ b/src/UBV/PracticaBundle/Controller/candidatoController.php @@ -0,0 +1,139 @@ +getDoctrine()->getManager(); + + $candidatos = $em->getRepository('UBVPracticaBundle:candidato')->findAll(); + + return $this->render('candidato/index.html.twig', array( + 'candidatos' => $candidatos, + )); + } + + /** + * Creates a new candidato entity. + * + * @Route("/new", name="candidato_new") + * @Method({"GET", "POST"}) + */ + public function newAction(Request $request) + { + $candidato = new Candidato(); + $form = $this->createForm('UBV\PracticaBundle\Form\candidatoType', $candidato); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->persist($candidato); + $em->flush(); + + return $this->redirectToRoute('candidato_index', array('id' => $candidato->getId())); + } + + return $this->render('candidato/new.html.twig', array( + 'candidato' => $candidato, + 'form' => $form->createView(), + )); + } + + /** + * Finds and displays a candidato entity. + * + * @Route("/{id}", name="candidato_show") + * @Method("GET") + */ + public function showAction(candidato $candidato) + { + $deleteForm = $this->createDeleteForm($candidato); + + return $this->render('candidato/show.html.twig', array( + 'candidato' => $candidato, + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Displays a form to edit an existing candidato entity. + * + * @Route("/{id}/edit", name="candidato_edit") + * @Method({"GET", "POST"}) + */ + public function editAction(Request $request, candidato $candidato) + { + $deleteForm = $this->createDeleteForm($candidato); + $editForm = $this->createForm('UBV\PracticaBundle\Form\candidatoType', $candidato); + $editForm->handleRequest($request); + + if ($editForm->isSubmitted() && $editForm->isValid()) { + $this->getDoctrine()->getManager()->flush(); + + $this->get('session')->getFlashBag()->set( 'success', array( 'title' => 'Editado Satisfactoriamente!', 'message' => 'Estado creado satisfactoriamente.' ) ); + + return $this->redirectToRoute('candidato_edit', array('id' => $candidato->getId())); + } + + return $this->render('candidato/edit.html.twig', array( + 'candidato' => $candidato, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Deletes a candidato entity. + * + * @Route("/{id}", name="candidato_delete") + * @Method("DELETE") + */ + public function deleteAction(Request $request, candidato $candidato) + { + $form = $this->createDeleteForm($candidato); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->remove($candidato); + $em->flush(); + } + + return $this->redirectToRoute('candidato_index'); + } + + /** + * Creates a form to delete a candidato entity. + * + * @param candidato $candidato The candidato entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createDeleteForm(candidato $candidato) + { + return $this->createFormBuilder() + ->setAction($this->generateUrl('candidato_delete', array('id' => $candidato->getId()))) + ->setMethod('DELETE') + ->getForm() + ; + } +} diff --git a/src/UBV/PracticaBundle/Controller/estadoController.php b/src/UBV/PracticaBundle/Controller/estadoController.php new file mode 100644 index 0000000..9777484 --- /dev/null +++ b/src/UBV/PracticaBundle/Controller/estadoController.php @@ -0,0 +1,136 @@ +getDoctrine()->getManager(); + + $estados = $em->getRepository('UBVPracticaBundle:estado')->findAll(); + + return $this->render('estado/index.html.twig', array( + 'estados' => $estados, + )); + } + + /** + * Creates a new estado entity. + * + * @Route("/new", name="estado_new") + * @Method({"GET", "POST"}) + */ + public function newAction(Request $request) + { + $estado = new Estado(); + $form = $this->createForm('UBV\PracticaBundle\Form\estadoType', $estado); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->persist($estado); + $em->flush(); + + return $this->redirectToRoute('estado_show', array('id' => $estado->getId())); + } + + return $this->render('estado/new.html.twig', array( + 'estado' => $estado, + 'form' => $form->createView(), + )); + } + + /** + * Finds and displays a estado entity. + * + * @Route("/{id}", name="estado_show") + * @Method("GET") + */ + public function showAction(estado $estado) + { + $deleteForm = $this->createDeleteForm($estado); + + return $this->render('estado/show.html.twig', array( + 'estado' => $estado, + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Displays a form to edit an existing estado entity. + * + * @Route("/{id}/edit", name="estado_edit") + * @Method({"GET", "POST"}) + */ + public function editAction(Request $request, estado $estado) + { + $deleteForm = $this->createDeleteForm($estado); + $editForm = $this->createForm('UBV\PracticaBundle\Form\estadoType', $estado); + $editForm->handleRequest($request); + + if ($editForm->isSubmitted() && $editForm->isValid()) { + $this->getDoctrine()->getManager()->flush(); + + return $this->redirectToRoute('estado_edit', array('id' => $estado->getId())); + } + + return $this->render('estado/edit.html.twig', array( + 'estado' => $estado, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Deletes a estado entity. + * + * @Route("/{id}", name="estado_delete") + * @Method("DELETE") + */ + public function deleteAction(Request $request, estado $estado) + { + $form = $this->createDeleteForm($estado); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->remove($estado); + $em->flush(); + } + + return $this->redirectToRoute('estado_index'); + } + + /** + * Creates a form to delete a estado entity. + * + * @param estado $estado The estado entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createDeleteForm(estado $estado) + { + return $this->createFormBuilder() + ->setAction($this->generateUrl('estado_delete', array('id' => $estado->getId()))) + ->setMethod('DELETE') + ->getForm() + ; + } +} diff --git a/src/UBV/PracticaBundle/Controller/municipioController.php b/src/UBV/PracticaBundle/Controller/municipioController.php new file mode 100644 index 0000000..cb324d3 --- /dev/null +++ b/src/UBV/PracticaBundle/Controller/municipioController.php @@ -0,0 +1,136 @@ +getDoctrine()->getManager(); + + $municipios = $em->getRepository('UBVPracticaBundle:municipio')->findAll(); + + return $this->render('municipio/index.html.twig', array( + 'municipios' => $municipios, + )); + } + + /** + * Creates a new municipio entity. + * + * @Route("/new", name="municipio_new") + * @Method({"GET", "POST"}) + */ + public function newAction(Request $request) + { + $municipio = new Municipio(); + $form = $this->createForm('UBV\PracticaBundle\Form\municipioType', $municipio); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->persist($municipio); + $em->flush(); + + return $this->redirectToRoute('municipio_show', array('id' => $municipio->getId())); + } + + return $this->render('municipio/new.html.twig', array( + 'municipio' => $municipio, + 'form' => $form->createView(), + )); + } + + /** + * Finds and displays a municipio entity. + * + * @Route("/{id}", name="municipio_show") + * @Method("GET") + */ + public function showAction(municipio $municipio) + { + $deleteForm = $this->createDeleteForm($municipio); + + return $this->render('municipio/show.html.twig', array( + 'municipio' => $municipio, + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Displays a form to edit an existing municipio entity. + * + * @Route("/{id}/edit", name="municipio_edit") + * @Method({"GET", "POST"}) + */ + public function editAction(Request $request, municipio $municipio) + { + $deleteForm = $this->createDeleteForm($municipio); + $editForm = $this->createForm('UBV\PracticaBundle\Form\municipioType', $municipio); + $editForm->handleRequest($request); + + if ($editForm->isSubmitted() && $editForm->isValid()) { + $this->getDoctrine()->getManager()->flush(); + + return $this->redirectToRoute('municipio_edit', array('id' => $municipio->getId())); + } + + return $this->render('municipio/edit.html.twig', array( + 'municipio' => $municipio, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Deletes a municipio entity. + * + * @Route("/{id}", name="municipio_delete") + * @Method("DELETE") + */ + public function deleteAction(Request $request, municipio $municipio) + { + $form = $this->createDeleteForm($municipio); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->remove($municipio); + $em->flush(); + } + + return $this->redirectToRoute('municipio_index'); + } + + /** + * Creates a form to delete a municipio entity. + * + * @param municipio $municipio The municipio entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createDeleteForm(municipio $municipio) + { + return $this->createFormBuilder() + ->setAction($this->generateUrl('municipio_delete', array('id' => $municipio->getId()))) + ->setMethod('DELETE') + ->getForm() + ; + } +} diff --git a/src/UBV/PracticaBundle/Controller/pruebaedController.php b/src/UBV/PracticaBundle/Controller/pruebaedController.php new file mode 100644 index 0000000..5947a53 --- /dev/null +++ b/src/UBV/PracticaBundle/Controller/pruebaedController.php @@ -0,0 +1,141 @@ +getDoctrine()->getManager(); + + $pruebaeds = $em->getRepository('UBVPracticaBundle:pruebaed')->findAll(); + + return $this->render('pruebaed/index.html.twig', array( + 'pruebaeds' => $pruebaeds, + )); + } + + /** + * Creates a new pruebaed entity. + * + * @Route("/new", name="pruebaed_new") + * @Method({"GET", "POST"}) + */ + public function newAction(Request $request) + { + $pruebaed = new Pruebaed(); + $form = $this->createForm('UBV\PracticaBundle\Form\pruebaedType', $pruebaed); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->persist($pruebaed); + $em->flush(); + + $this->get('session')->getFlashBag()->set( 'success', array( 'title' => 'Guardado!', 'message' => 'Estado creado satisfactoriamente.' ) ); + + return $this->redirectToRoute('pruebaed_index', array('id' => $pruebaed->getId())); + } + + return $this->render('pruebaed/new.html.twig', array( + 'pruebaed' => $pruebaed, + 'form' => $form->createView(), + )); + } + + /** + * Finds and displays a pruebaed entity. + * + * @Route("/{id}", name="pruebaed_show") + * @Method("GET") + */ + public function showAction(pruebaed $pruebaed) + { + $deleteForm = $this->createDeleteForm($pruebaed); + + return $this->render('pruebaed/show.html.twig', array( + 'pruebaed' => $pruebaed, + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Displays a form to edit an existing pruebaed entity. + * + * @Route("/{id}/edit", name="pruebaed_edit") + * @Method({"GET", "POST"}) + */ + public function editAction(Request $request, pruebaed $pruebaed) + { + $deleteForm = $this->createDeleteForm($pruebaed); + $editForm = $this->createForm('UBV\PracticaBundle\Form\pruebaedType', $pruebaed); + $editForm->handleRequest($request); + + if ($editForm->isSubmitted() && $editForm->isValid()) { + $this->getDoctrine()->getManager()->flush(); + + $this->get('session')->getFlashBag()->set( 'success', array( 'title' => 'Editado Satisfactoriamente!', 'message' => 'Estado creado satisfactoriamente.' ) ); + + return $this->redirectToRoute('pruebaed_index', array('id' => $pruebaed->getId())); + } + + return $this->render('pruebaed/edit.html.twig', array( + 'pruebaed' => $pruebaed, + 'edit_form' => $editForm->createView(), + 'delete_form' => $deleteForm->createView(), + )); + } + + /** + * Deletes a pruebaed entity. + * + * @Route("/{id}", name="pruebaed_delete") + * @Method("DELETE") + */ + public function deleteAction(Request $request, pruebaed $pruebaed) + { + $form = $this->createDeleteForm($pruebaed); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $em = $this->getDoctrine()->getManager(); + $em->remove($pruebaed); + $em->flush(); + } + + return $this->redirectToRoute('pruebaed_index'); + } + + /** + * Creates a form to delete a pruebaed entity. + * + * @param pruebaed $pruebaed The pruebaed entity + * + * @return \Symfony\Component\Form\Form The form + */ + private function createDeleteForm(pruebaed $pruebaed) + { + return $this->createFormBuilder() + ->setAction($this->generateUrl('pruebaed_delete', array('id' => $pruebaed->getId()))) + ->setMethod('DELETE') + ->getForm() + ; + } +} diff --git a/src/UBV/PracticaBundle/Entity/aldea.php b/src/UBV/PracticaBundle/Entity/aldea.php index a7b3a08..6e14bad 100644 --- a/src/UBV/PracticaBundle/Entity/aldea.php +++ b/src/UBV/PracticaBundle/Entity/aldea.php @@ -155,5 +155,11 @@ class aldea { return $this->estatus; } + + public function __toString(){ + + return $this->getDescripcion(); + + } } diff --git a/src/UBV/PracticaBundle/Entity/candidato.php b/src/UBV/PracticaBundle/Entity/candidato.php new file mode 100644 index 0000000..e3f9073 --- /dev/null +++ b/src/UBV/PracticaBundle/Entity/candidato.php @@ -0,0 +1,407 @@ +id; + } + + /** + * Set nombre + * + * @param string $nombre + * + * @return candidato + */ + public function setNombre($nombre) + { + $this->nombre = $nombre; + + return $this; + } + + /** + * Get nombre + * + * @return string + */ + public function getNombre() + { + return $this->nombre; + } + + /** + * Set apellido + * + * @param string $apellido + * + * @return candidato + */ + public function setApellido($apellido) + { + $this->apellido = $apellido; + + return $this; + } + + /** + * Get apellido + * + * @return string + */ + public function getApellido() + { + return $this->apellido; + } + + /** + * Set cedula + * + * @param integer $cedula + * + * @return candidato + */ + public function setCedula($cedula) + { + $this->cedula = $cedula; + + return $this; + } + + /** + * Get cedula + * + * @return int + */ + public function getCedula() + { + return $this->cedula; + } + + /** + * Set activo + * + * @param boolean $activo + * + * @return candidato + */ + public function setActivo($activo) + { + $this->activo = $activo; + + return $this; + } + + /** + * Get activo + * + * @return bool + */ + public function getActivo() + { + return $this->activo; + } + + /** + * Set instruccion + * + * @param string $instruccion + * + * @return candidato + */ + public function setInstruccion($instruccion) + { + $this->instruccion = $instruccion; + + return $this; + } + + /** + * Get instruccion + * + * @return string + */ + public function getInstruccion() + { + return $this->instruccion; + } + + /** + * Set ocupacion + * + * @param string $ocupacion + * + * @return candidato + */ + public function setOcupacion($ocupacion) + { + $this->ocupacion = $ocupacion; + + return $this; + } + + /** + * Get ocupacion + * + * @return string + */ + public function getOcupacion() + { + return $this->ocupacion; + } + + /** + * Set promedio + * + * @param float $promedio + * + * @return candidato + */ + public function setPromedio($promedio) + { + $this->promedio = $promedio; + + return $this; + } + + /** + * Get promedio + * + * @return float + */ + public function getPromedio() + { + return $this->promedio; + } + + /** + * Set institucion + * + * @param string $institucion + * + * @return candidato + */ + public function setInstitucion($institucion) + { + $this->institucion = $institucion; + + return $this; + } + + /** + * Get institucion + * + * @return string + */ + public function getInstitucion() + { + return $this->institucion; + } + + /** + * Set pais + * + * @param string $pais + * + * @return candidato + */ + public function setPais($pais) + { + $this->pais = $pais; + + return $this; + } + + /** + * Get pais + * + * @return string + */ + public function getPais() + { + return $this->pais; + } + + /** + * Set estado + * + * @param string $estado + * + * @return candidato + */ + public function setEstado($estado) + { + $this->estado = $estado; + + return $this; + } + + /** + * Get estado + * + * @return string + */ + public function getEstado() + { + return $this->estado; + } + + /** + * Set municipio + * + * @param string $municipio + * + * @return candidato + */ + public function setMunicipio($municipio) + { + $this->municipio = $municipio; + + return $this; + } + + /** + * Get municipio + * + * @return string + */ + public function getMunicipio() + { + return $this->municipio; + } + + /** + * Set direccion + * + * @param string $direccion + * + * @return candidato + */ + public function setDireccion($direccion) + { + $this->direccion = $direccion; + + return $this; + } + + /** + * Get direccion + * + * @return string + */ + public function getDireccion() + { + return $this->direccion; + } +} + diff --git a/src/UBV/PracticaBundle/Entity/estado.php b/src/UBV/PracticaBundle/Entity/estado.php index b31d702..163e70f 100644 --- a/src/UBV/PracticaBundle/Entity/estado.php +++ b/src/UBV/PracticaBundle/Entity/estado.php @@ -93,5 +93,11 @@ class estado { return $this->codigo; } + public function __toString(){ + + return $this->getDescripcion(); + + } + } diff --git a/src/UBV/PracticaBundle/Entity/estadoCivil.php b/src/UBV/PracticaBundle/Entity/estadoCivil.php index cf39e73..80e2cb2 100644 --- a/src/UBV/PracticaBundle/Entity/estadoCivil.php +++ b/src/UBV/PracticaBundle/Entity/estadoCivil.php @@ -93,5 +93,11 @@ class estadoCivil { return $this->codigo; } + + public function __toString(){ + + return $this->getDescripcion(); + + } } diff --git a/src/UBV/PracticaBundle/Entity/municipio.php b/src/UBV/PracticaBundle/Entity/municipio.php index a6d49a3..189942b 100644 --- a/src/UBV/PracticaBundle/Entity/municipio.php +++ b/src/UBV/PracticaBundle/Entity/municipio.php @@ -35,6 +35,16 @@ class municipio */ private $codigo; + /** + * @var \Estado + * + * @ORM\ManyToOne(targetEntity="estado", inversedBy="municipios", cascade={"persist", "remove"}) + * @ORM\JoinColumn(name="estado_id", referencedColumnName="id", nullable=false) + * + * + */ + private $estado; + /** * Get id @@ -93,5 +103,32 @@ class municipio { return $this->codigo; } + + /** + * Set estado + * + * @param \UBV\PracticaBundle\Entity\Estado $estado + * + * @return municipio + */ + public function setEstado(\UBV\PracticaBundle\Entity\Estado $estado=null) + { + $this->estado = $estado; + + return $this; + } + + /** + * Get estado + * + * @return \UBV\PracticaBundle\Entity\Estado + */ + public function getEstado() + { + return $this->estado; + } + + + } diff --git a/src/UBV/PracticaBundle/Entity/pruebaed.php b/src/UBV/PracticaBundle/Entity/pruebaed.php new file mode 100644 index 0000000..385c27c --- /dev/null +++ b/src/UBV/PracticaBundle/Entity/pruebaed.php @@ -0,0 +1,258 @@ +id; + } + + /** + * Set nombre + * + * @param string $nombre + * + * @return pruebaed + */ + public function setNombre($nombre) + { + $this->nombre = $nombre; + + return $this; + } + + /** + * Get nombre + * + * @return string + */ + public function getNombre() + { + return $this->nombre; + } + + /** + * Set apellido + * + * @param string $apellido + * + * @return pruebaed + */ + public function setApellido($apellido) + { + $this->apellido = $apellido; + + return $this; + } + + /** + * Get apellido + * + * @return string + */ + public function getApellido() + { + return $this->apellido; + } + + /** + * Set cedula + * + * @param integer $cedula + * + * @return pruebaed + */ + public function setCedula($cedula) + { + $this->cedula = $cedula; + + return $this; + } + + /** + * Get cedula + * + * @return int + */ + public function getCedula() + { + return $this->cedula; + } + + /** + * Set edad + * + * @param integer $edad + * + * @return pruebaed + */ + public function setEdad($edad) + { + $this->edad = $edad; + + return $this; + } + + /** + * Get edad + * + * @return int + */ + public function getEdad() + { + return $this->edad; + } + + /** + * Set direccion + * + * @param string $direccion + * + * @return pruebaed + */ + public function setDireccion($direccion) + { + $this->direccion = $direccion; + + return $this; + } + + /** + * Get direccion + * + * @return string + */ + public function getDireccion() + { + return $this->direccion; + } +} + diff --git a/src/UBV/PracticaBundle/Form/candidatoType.php b/src/UBV/PracticaBundle/Form/candidatoType.php new file mode 100644 index 0000000..05e547c --- /dev/null +++ b/src/UBV/PracticaBundle/Form/candidatoType.php @@ -0,0 +1,48 @@ +add('nombre','text', array( 'label'=> 'Nombre', 'attr' => array('class' => 'form-control','placeholder'=>'Introduzca Nombre'), 'label_attr' => array('class' => 'control-label'),)) + ->add('apellido','text', array( 'label'=> 'Apellido', 'attr' => array('class' => 'form-control','placeholder'=>'Introduzca Apellido'), 'label_attr' => array('class' => 'control-label'),)) + ->add('cedula','integer', array( 'label'=> 'Cedula', 'attr' => array('class' => 'form-control','placeholder'=>'Ej.12345678'), 'label_attr' => array('class' => 'control-label'),)) + ->add('activo') + ->add('instruccion','text', array( 'label'=> 'Instruccion Academica', 'attr' => array('class' => 'form-control','placeholder'=>'Nivel Academico'), 'label_attr' => array('class' => 'control-label'),)) + ->add('ocupacion','text', array( 'label'=> 'Ocupacion/Profesion', 'attr' => array('class' => 'form-control','placeholder'=>'Ej. Carpintero'), 'label_attr' => array('class' => 'control-label'),)) + ->add('promedio','number', array( 'label'=> 'Promedio', 'attr' => array('class' => 'form-control','step'=>'0.01','placeholder'=>'Introduzca Promedio'), 'label_attr' => array('class' => 'control-label'),)) + ->add('institucion','text', array( 'label'=> 'Institucion', 'attr' => array('class' => 'form-control','placeholder'=>'Institucion/Universidad/Empresa'), 'label_attr' => array('class' => 'control-label'),)) + ->add('pais','text', array( 'label'=> 'Pais', 'attr' => array('class' => 'form-control','placeholder'=>'Seleccione'), 'label_attr' => array('class' => 'control-label'),)) + ->add('estado','text', array( 'label'=> 'Estado', 'attr' => array('class' => 'form-control','placeholder'=>'Estado'), 'label_attr' => array('class' => 'control-label'),)) + ->add('municipio','text', array( 'label'=> 'Municipio', 'attr' => array('class' => 'form-control','placeholder'=>'Municipio'), 'label_attr' => array('class' => 'control-label'),)) + ->add('direccion','text', array( 'label'=> 'Direccion', 'attr' => array('class' => 'form-control','placeholder'=>'Direccion de Domicilio'), 'label_attr' => array('class' => 'control-label'),)); + }/** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'UBV\PracticaBundle\Entity\candidato' + )); + } + + /** + * {@inheritdoc} + */ + public function getBlockPrefix() + { + return 'ubv_practicabundle_candidato'; + } + + +} diff --git a/src/UBV/PracticaBundle/Form/estadoType.php b/src/UBV/PracticaBundle/Form/estadoType.php new file mode 100644 index 0000000..6d394c6 --- /dev/null +++ b/src/UBV/PracticaBundle/Form/estadoType.php @@ -0,0 +1,36 @@ +add('descripcion')->add('codigo'); + }/** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'UBV\PracticaBundle\Entity\estado' + )); + } + + /** + * {@inheritdoc} + */ + public function getBlockPrefix() + { + return 'ubv_practicabundle_estado'; + } + + +} diff --git a/src/UBV/PracticaBundle/Form/municipioType.php b/src/UBV/PracticaBundle/Form/municipioType.php new file mode 100644 index 0000000..2a7200e --- /dev/null +++ b/src/UBV/PracticaBundle/Form/municipioType.php @@ -0,0 +1,36 @@ +add('descripcion')->add('codigo')->add('estado'); + }/** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'UBV\PracticaBundle\Entity\municipio' + )); + } + + /** + * {@inheritdoc} + */ + public function getBlockPrefix() + { + return 'ubv_practicabundle_municipio'; + } + + +} diff --git a/src/UBV/PracticaBundle/Form/pruebaedType.php b/src/UBV/PracticaBundle/Form/pruebaedType.php new file mode 100644 index 0000000..fb30911 --- /dev/null +++ b/src/UBV/PracticaBundle/Form/pruebaedType.php @@ -0,0 +1,48 @@ +add('nombre','text', array( 'label'=> 'Nombre', 'attr' => array('class' => 'form-control','placeholder'=>'Nombre'), 'label_attr' => array('class' => 'control-label'),)) + ->add('apellido','text', array( 'label'=> 'Apellido', 'attr' => array('class' => 'form-control','placeholder'=>'Apellido'), 'label_attr' => array('class' => 'control-label'),)) + ->add('cedula','integer', array( 'label'=> 'Cedula', 'attr' => array('class' => 'form-control','placeholder'=>'Ej. 12345678'), 'label_attr' => array('class' => 'control-label'),)) + ->add('edad','integer', array( 'label'=> 'Edad', 'attr' => array('class' => 'form-control','placeholder'=>'Ej. 1 - 100'), 'label_attr' => array('class' => 'control-label'),)) + ->add('direccion','textarea', array( 'label'=> 'Direccion', 'attr' => array('class' => 'form-control','placeholder'=>'Direccion'), 'label_attr' => array('class' => 'control-label'),)); + + /** + * + * ->add('nombre','text', array( 'label'=> 'Nombre', 'attr' => array('class' => 'form-control','placeholder'=>'Nombre'), 'label_attr' => array('class' => 'control-label'),)) + * + */ + + }/** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'UBV\PracticaBundle\Entity\pruebaed' + )); + } + + /** + * {@inheritdoc} + */ + public function getBlockPrefix() + { + return 'ubv_practicabundle_pruebaed'; + } + + +} diff --git a/src/UBV/PracticaBundle/Repository/candidatoRepository.php b/src/UBV/PracticaBundle/Repository/candidatoRepository.php new file mode 100644 index 0000000..9a1c68e --- /dev/null +++ b/src/UBV/PracticaBundle/Repository/candidatoRepository.php @@ -0,0 +1,13 @@ +request('GET', '/candidato/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /candidato/"); + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); + + // Fill in the form and submit it + $form = $crawler->selectButton('Create')->form(array( + 'ubv_practicabundle_candidato[field_name]' => 'Test', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check data in the show view + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); + + // Edit the entity + $crawler = $client->click($crawler->selectLink('Edit')->link()); + + $form = $crawler->selectButton('Update')->form(array( + 'ubv_practicabundle_candidato[field_name]' => 'Foo', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check the element contains an attribute with value equals "Foo" + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); + + // Delete the entity + $client->submit($crawler->selectButton('Delete')->form()); + $crawler = $client->followRedirect(); + + // Check the entity has been delete on the list + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); + } + + */ +} diff --git a/src/UBV/PracticaBundle/Tests/Controller/estadoControllerTest.php b/src/UBV/PracticaBundle/Tests/Controller/estadoControllerTest.php new file mode 100644 index 0000000..2167a62 --- /dev/null +++ b/src/UBV/PracticaBundle/Tests/Controller/estadoControllerTest.php @@ -0,0 +1,55 @@ +request('GET', '/estado/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /estado/"); + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); + + // Fill in the form and submit it + $form = $crawler->selectButton('Create')->form(array( + 'ubv_practicabundle_estado[field_name]' => 'Test', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check data in the show view + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); + + // Edit the entity + $crawler = $client->click($crawler->selectLink('Edit')->link()); + + $form = $crawler->selectButton('Update')->form(array( + 'ubv_practicabundle_estado[field_name]' => 'Foo', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check the element contains an attribute with value equals "Foo" + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); + + // Delete the entity + $client->submit($crawler->selectButton('Delete')->form()); + $crawler = $client->followRedirect(); + + // Check the entity has been delete on the list + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); + } + + */ +} diff --git a/src/UBV/PracticaBundle/Tests/Controller/municipioControllerTest.php b/src/UBV/PracticaBundle/Tests/Controller/municipioControllerTest.php new file mode 100644 index 0000000..33aee19 --- /dev/null +++ b/src/UBV/PracticaBundle/Tests/Controller/municipioControllerTest.php @@ -0,0 +1,55 @@ +request('GET', '/municipio/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /municipio/"); + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); + + // Fill in the form and submit it + $form = $crawler->selectButton('Create')->form(array( + 'ubv_practicabundle_municipio[field_name]' => 'Test', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check data in the show view + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); + + // Edit the entity + $crawler = $client->click($crawler->selectLink('Edit')->link()); + + $form = $crawler->selectButton('Update')->form(array( + 'ubv_practicabundle_municipio[field_name]' => 'Foo', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check the element contains an attribute with value equals "Foo" + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); + + // Delete the entity + $client->submit($crawler->selectButton('Delete')->form()); + $crawler = $client->followRedirect(); + + // Check the entity has been delete on the list + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); + } + + */ +} diff --git a/src/UBV/PracticaBundle/Tests/Controller/pruebaedControllerTest.php b/src/UBV/PracticaBundle/Tests/Controller/pruebaedControllerTest.php new file mode 100644 index 0000000..e7cb2b0 --- /dev/null +++ b/src/UBV/PracticaBundle/Tests/Controller/pruebaedControllerTest.php @@ -0,0 +1,55 @@ +request('GET', '/pruebaed/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /pruebaed/"); + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); + + // Fill in the form and submit it + $form = $crawler->selectButton('Create')->form(array( + 'ubv_practicabundle_pruebaed[field_name]' => 'Test', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check data in the show view + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); + + // Edit the entity + $crawler = $client->click($crawler->selectLink('Edit')->link()); + + $form = $crawler->selectButton('Update')->form(array( + 'ubv_practicabundle_pruebaed[field_name]' => 'Foo', + // ... other fields to fill + )); + + $client->submit($form); + $crawler = $client->followRedirect(); + + // Check the element contains an attribute with value equals "Foo" + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); + + // Delete the entity + $client->submit($crawler->selectButton('Delete')->form()); + $crawler = $client->followRedirect(); + + // Check the entity has been delete on the list + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); + } + + */ +}