Do you know that? 75% American freelancers who work from home make over $65k per year next

Contact Email: teammmrem@yahoo.com

<< All Upwork (oDesk) and Elance Tests << Elance test answers << IT & Programming category

Test answers for Symfony2 2020

(63) Last updated: February 28
Elance • IT & Programming
Questions and answers are regularly updated. Answered and not answered tests questions.

This helps getting job: Hundreds of (cover letter examples , interview questions , profile samples ) • Earn on Upwork (oDesk)
Job assistance: jobs popularityfreelance rates

Popular test answers: HTML, .Net, CSS, English, SEO, Photoshop, iOS, Java, Android, Ruby, Python, JavaScript

See all 6 tests answers updated

Find Upwork (oDesk) and Elance test answers on this website:



Collapse | Expand

63 Answered Test Questions:

1. In regard to validating the data that is entered in forms, which of the following constraints is NOT supported by Symfony2?

Answers:

• UniqueEntity

• All of these are supported

• EqualTo

• NotEqualTo

2. Which of the following is a common element of a bundle?

Answers:

• (all of these)

• Controller/

• Resources/config/

• Tests/

3. What are the three parts of the logical controller name?

Answers:

• controller:action:model

• bundle:controller:action

• action:bundle:route

• view:controller:model

4. Select the sequence that shows an example of a simple controller.

Answers:

• // src/Smarterer/HelloBundle/Controller/HelloController.php namespace Smarterer\HelloBundle\Controller; use Symfony\Component\HttpFoundation\Response; class HelloController { public function indexAction($name) { return new Response('<html><body&g

• // app/AppKernel.php public function registerBundles() { $bundles = array( ..., new Smarterer\HelloBundle\SmartererHelloBundle(), ); // ... return $bundles; }

• {# app/Resources/views/layout.html.twig #} <!DOCTYPE html> <html> <head> <title>{% block title %}Default title{% endblock %}</title> </head> <body> {% block body %}{% endblock %} </body> </html>

• None of these

5. Which of the following methods allows you to progress to another controller internally?

Answers:

• forward()

• sent()

• send()

• progress()

6. Where is the AppKernel class stored?

Answers:

• The kernal/ directory

• The app/ directory

• The application/ directory

• The class/ directory

7. Which of the following directories contains any publicly accessible files?

Answers:

• vendor/

• app/

• web/

• src/

8. The ________ class is a simple object-oriented representation of the HTTP request message.

Answers:

• Send

• Request

• Inbound

• Call

9. Which of the following lets you write templates more quickly as well as makes them easier to read?

Answers:

• Branch

• Tree

• Twig

• Bark

10. Which of the following field types are supported in Doctrine?

Answers:

• Dates and Times

• All of these

• Numbers

• Strings

11. The __________ allows you to begin using PHP classes without including the file containing the class.

Answers:

• autoloader

• autoupload

• instantloader

• instantupload

12. Choose the best description of the following configuration:   secure: path: /secure defaults: { _controller: SmartererDemoBundle:Main:secure } schemes: [https]

Answers:

• It forces the secure route to avoid using HTTPS

• It forces the route to never use path /secure

• It forces the route to always use path /secure

• It forces the secure route to always use HTTPS

13. Where is the routing configuration file located?

Answers:

• app/console

• app/Resources

• app/src

• app/config

14. How do you disable CSRF protection?

Answers:

• Set csrf_protection to true

• Set csrf_protection to false

15. Which of the following is a Doctrine field type for numbers?

Answers:

• integer

• boolean

• tinyint

• superint

16. A directory that contains a set of files that represents a particular feature is known as a/an:

Answers:

• Bundle

• Asset

• Application

• Action

17. What are the 3 environments a Symfony2 project BEGINS with?

Answers:

• test, dev, and prod

• app, test, and prod

• test, src, and prod

• app, test, and web

18. Which of the following Components contain the Request and Response classes?

Answers:

• ClassLoader

• HttpFoundation

• Routing

• Translation

19. Which of the following methods is used to generate a URL for a given route?

Answers:

• URLgenerator()

• createURL()

• URLcreate()

• generateURL()

20. What class is used by the front controller to bootstrap an application?

Answers:

• AppBundle

• AppKernel

• class AppSrc

• AppPhp

21. What Symfony2 environment is used to run unit tests?

Answers:

• test

• prod

• dev

• work

22. In order to use your controller from the service container you need to register it as a service. Where can this be done?

Answers:

• Locally in the bundle in the Sources/config/server.yml

• Locally in the bundle in the Sources/config/services.yml

• None of these

• Locally in the bundle in the Resources/config/services.yml

23. What is the purpose of the _controller parameter in routing?

Answers:

• It tells Symfony which container is used for key/value pairs

• It tells Symfony which controller should be executed when a URL matches a specific route

• It tells Symfony how to access another controller internally

• It tells Symfony which controller should be executed when a URL does not match a specific route

24. True or False? The HTTP response from a controller is limited to 404 errors, XML documents, and HTML pages.

Answers:

• TRUE

• False

25. What tag is used for template inheritance?

Answers:

• {% child %}

• {% parent %}

• {% inherit %}

• {% extends %}

26. is it possible to define a form like a service ?

Answers:

• FALSE

• TRUE

27. What is a PHP function that takes incoming requests and transforms them into a response?

Answers:

• model

• route

• controller

• view

28. Which of the following methods checks the 3 different values in PHP that can show whether or not the user is connecting via a secured connection?

Answers:

• isSafe()

• isSecure()

• indexAction()

• forward()

29. True or False? The directory that contains all of the pieces of code that run your application is called the src/ directory.

Answers:

• False

• True

30. Security is a two-step process, the first being Authentication?

Answers:

• True

• FALSE

31. Which of the following Components allows you to trace a specific URI to a description of how it should be handled?

Answers:

• ClassLoader

• Translation

• HttpFoundation

• Routing

32. Symfony2 is only supported on:

Answers:

• PHP 4.3.3 and up

• PHP 5.3.3 and up

• PHP 4.1.2 and up

• PHP 5.1.2 and up

33. What defines a URL to a page?

Answers:

• route

• controller

• model

• path

34. True or False? The Symfony2 Framework can be altered to one's preferences or replaced entirely.

Answers:

• True

• False

35. What are the 2 options you have to install a Symfony2 distribution?

Answers:

• Download an Archive or use Installer

• Use Composer or Installer

• None of these

• Use Composer or Download an Archive

36. In regard to routing, which of the following best describes a route?

Answers:

• A simple object-oriented representation of the HTTP request message

• A map from a URL path to a controller

• A map from a controller to a URL path

• A container for key/value pairs

37. True or False? To build a form in Symfony2 you must build a form object and then render it in a template.

Answers:

• True

• False

38. Which of the following methods is a shortcut to direct use of the templating service?

Answers:

• renderTemplate

• renderPage

• renderView

• renderControl

39. To delete an object in Doctrine you must use the _________ method of the entity manager.

Answers:

• delete()

• flush()

• trash()

• remove()

40. How would one use a service in a controller in Symfony?

Answers:

• $this->serviceContainer.get('name_service');

• $this->getInstance('name_service');

• $this->get('name_service');

• $serviceTest = getInstance('name_service');

• $serviceTest = get('name_service')

41. Which of the following allows you to manipulate assets however you like before serving them?

Answers:

• Assetic

• Doctrine

• Crawlers

• Assets

42. Is a "front controller" the same as the "controllers"?

Answers:

• False

• TRUE

43. _______ is a container for key/value pairs.

Answers:

• ParameterBag

• ParameterGroup

• ParameterBatch

• ParameterCase

44. Choose the best description of the following sequence (where //LINE BREAK// indicates a new line in the sequence):   # app/config/config_test.yml  //LINE BREAK// # ...  //LINE BREAK// swiftmailer: /linebrea  //LINE BREAK// disable_delivery: true

Answers:

• It shows the swiftmailer is configured to deliver emails in the test environment

• It shows the swiftmailer is NOT configured to deliver emails in the test environment

• It shows the swiftmailer is configured to deliver emails in the live environment

• It shows the swiftmailer is NOT configured to deliver emails in the live environment

45. what is repository in Symfony ?

Answers:

• a class which extends EngineRepository

• a class that work with entity for processing data

• a symfony file for saving test classes

• the main directory of entities

• a class that work with all the repositories in a bundle

46. The Dependency Injection component allows you to

Answers:

• Convert a Request to a Response

• Standardize and centralize the way objects are constructed in your application

• Defining the Controller as a Service

• Parse the URL and determine which controller should be executed

47. Choose the best reason why the following autoloading sequence will not run properly:   Class Name: Smarterer\HelloBundle\Controller\HelloController Path: src/Smarterer/Controller/HelloController.php

Answers:

• All of these

• The class name and the path to the file do not follow the same sequence

• Class Name is used in place of Class ID

• The class name and the path to the file follow the same sequence

48. A __________ is a short PHP script that lives in the web directory of your project.

Answers:

• Controller

• Back Controller

• Front Controller

• All of these

49. In regard to testing,  each time you make a request with the client a ______ instance is returned.

Answers:

• crawler

• category

• task

• form

50. Which of the following shows the correct representation of the Twig function?

Answers:

• function renderResources() ( return this->container->get('templating') ->render("RSmithNotificationBundle:Notification:resources.html.twig"); )

• None of these

• public function renderResources() { return $this->container->get('templating') ->render("RSmithNotificationBundle:Notification:resources.html.twig"); }

• renderResources() { return $this->container->get('templating') ->render("RSmithNotificationBundle:Notification:resources.html.twig"); }

51. If you wanted to add routes to an application without including them in the Yaml file, which of the following would you need to use?

Answers:

• Custom route controller

• Custom route indicator

• Custom route addition

• Custom route loader

52. What is the specific workflow of Functional Tests?

Answers:

• 1. Make a request 2. Test the response

• 1. Test the response 2. Make a request 3. Click on a link or submit a form 4. Make a request 5. Rinse and repeat

• 1. Make a request 2. Test the response 3. Click on a link or submit a form 4. Test the response 5. Rinse and repeat

• 1. Test the response 2. Click on a link or submit a form 3. Repeat

53. what is the first file that Symfony framework runs at startup for loading libraries ?

Answers:

• app/config/autoload.php

• vendor/autoloader/config.php

• app/autoload.php

• app/config/autoloader.php

• vendor/autoloader.php

54. Which of the following is the correct way to create a basic route configuration?

Answers:

• _begin: path: / defaults: { _controller: SmartererDemoBundle:Main:homepage }

• _welcome: path: / defaults: { _controller: SmartererDemoBundle:Main:homepage }

• _start: path: / defaults: ( _controller: SmartererDemoBundle:Main:homepage )

55. Which of following console commands checks for syntax errors in Twig templates?

Answers:

• twig:check

• twig:error

• twig:lint

56. Which parameter is not available in security.yml ?

Answers:

• providers

• access_denied_url

• encoders

• firewalls

• All of these are available

57. Which of the following is correct when creating a bundle using the command line generator?

Answers:

• php app/console create:batch --namespace=RSmith/Bundle/NotificationBatch --batch-name=RSmithNotificationBatch

• php app/console generate:bundle --namespace=RSmith/Bundle/NotificationBundle

• namespace=RSmith/Bundle/NotificationBundle --bundle-name=RSmithNotificationBundle

• php app/console generate:bundle --namespace=RSmith/Bundle/NotificationBundle --bundle-name=RSmithNotificationBundle

58. True of false: A controller is required when creating a static page.

Answers:

• False

• True

59. Which configuration format is powerful but less readable than standard configuration formats?

Answers:

• HAML

• YAML

• XML

• PHP

60. In which of the following can the configuration of services in symfony be found?

Answers:

• app/config.yml

• app/config/services.yml

• Resources/config/config.yml

• app/services.yml

• app/config/config.yml

61. What is the way around configuring the default charset and collation inside Doctrine?

Answers:

• You can configure these defaults inside of Doctrine

• Configure the path where your database file should be stored

• Configure server level defaults

62. Which of the following Twig codes is valid to check if a variable has the same value and the same type as another ?

Answers:

• {% if a sameas b %}

• {% if a === b %}

• {% if a == b %}

• {% if a is sameas(b)) %}

63. Which of the following is an authorization layer of the security component?

Answers:

• Voters

• Routing

• Firewalls

• HTTP Authentication