Skip to content

Commit

Permalink
Add more question
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu LOUVEL authored and Mathieu LOUVEL committed Sep 6, 2017
1 parent e13f603 commit 019c164
Show file tree
Hide file tree
Showing 17 changed files with 859 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/symfony-pack.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

502 changes: 502 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions data/architecture.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,36 @@ questions:
answers:
- {value: "True", correct: false}
- {value: "False", correct: true}
-
question: 'Symfony is released under which license ?'
answers:
- {value: "GNU General Public License (GPL)", correct: false}
- {value: "ISC License", correct: false}
- {value: "BSD license", correct: false}
- {value: "MIT license", correct: true}
-
question: 'Which kernel event exist ?'
answers:
- {value: "kernel.request", correct: true}
- {value: "kernel.controller", correct: true}
- {value: "kernel.template", correct: false}
- {value: "kernel.view", correct: true}
- {value: "kernel.response", correct: true}
- {value: "kernel.answer", correct: false}
- {value: "kernel.finish_request", correct: true}
- {value: "kernel.start_request", correct: false}
- {value: "kernel.terminate", correct: true}
- {value: "kernel.start", correct: false}
- {value: "kernel.exception", correct: true}
-
question: 'Arguments are resolve before to Call Controller ?'
answers:
- {value: "yes", correct: true}
- {value: "no", correct: false}
-
question: 'How to you detect if an Event was stopped during runtime?'
answers:
- {value: "$event->isPropagationStopped()", correct: true}
- {value: "$event->isStopped()", correct: false}
- {value: "$event->isPropagationStop()", correct: false}
- {value: "$event->isStop()", correct: false}
9 changes: 9 additions & 0 deletions data/bundles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,12 @@ questions:
answers:
- {value: "True", correct: true}
- {value: "False", correct: false}
-
question: 'According to Symfony best practices, which files files are mandatory in your bundle AcmeBlogBundle directory Structure ?'
answers:
- {value: "AcmeNameBundle.php", correct: true}
- {value: "README.md", correct: true}
- {value: "LICENSE", correct: true}
- {value: "Resources/doc/index.rst", correct: true}
- {value: "Resources/config/routing.yml", correct: false}
- {value: "Resources/config/services.yml", correct: false}
17 changes: 17 additions & 0 deletions data/cache-http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,20 @@ questions:
answers:
- {value: "True", correct: true}
- {value: "False", correct: false}
-
question: 'According to HTTP/1.1 what is the max value for Expires ?'
answers:
- {value: "one year", correct: true}
- {value: "one month", correct: false}
- {value: "one week", correct: false}
- {value: "There is not limit", correct: false}
-
question: 'True or False ? You can use both validation and expiration within the same Response.'
answers:
- {value: "True", correct: true}
- {value: "False", correct: false}
-
question: 'True or False ? Using ETag saves CPU cycles.'
answers:
- {value: "True", correct: false}
- {value: "False", correct: true}
22 changes: 22 additions & 0 deletions data/command-line.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,25 @@ questions:
- {value: 'ConsoleEvents::TERMINATE is dispatched even when an exception is thrown' , correct: true}
- {value: 'initialize has InputInterface, OutputInterface parameters', correct: true}
- {value: 'ConsoleEvents can be disabled', correct: true}
-
question: 'Which function are mandatory to your command class ?'
answers:
- {value: "configure()", correct: true}
- {value: "execute(InputInterface $input, OutputInterface $output)", correct: true}
- {value: "interact()", correct: false}
- {value: "initialize()", correct: false}
-
question: 'Which Question class are available ?'
answers:
- {value: "Symfony\\Component\\Console\\Question\\Question", correct: true}
- {value: "Symfony\\Component\\Console\\Question\\ChoiceQuestion", correct: true}
- {value: "Symfony\\Component\\Console\\Question\\ConfirmationQuestion", correct: true}
- {value: "Symfony\\Component\\Console\\Question\\SelectQuestion", correct: false}
- {value: "Symfony\\Component\\Console\\Question\\ValidQuestion", correct: false}
-
question: 'How to Call Other Commands in a command ?'
answers:
- {value: "$command->execute($input, $output);", correct: false}
- {value: "$command->run($input, $output);", correct: true}
- {value: "$command->call($input, $output);", correct: false}
- {value: "$command->forward($input, $output);", correct: false}
21 changes: 21 additions & 0 deletions data/controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,24 @@ questions:
- {value: $request, correct: true}
- {value: $_locale, correct: true}
- {value: $_format, correct: true}
-
question: |
According to this action :
/**
* @Route("/comment/{postSlug}/new", name = "comment_new")
*
*/
public function newAction(Request $request, Post $post)
{
// ...
}
How my ParamConverter should be configured to match "postSlug" params with "slug" in Post ?
answers:
- {value: '@ParamConverter("post", options={"mapping": {"postSlug": "slug"}})', correct: true}
- {value: '@ParamConverter("post", options={"mapping": {"slug": "postSlug"}})', correct: false}
- {value: '@ParamConverter("post", options={"mapping": {"field": "slug"}})', correct: false}
- {value: '@ParamConverter("post", options={"mapping": {"Post": "slug"}})', correct: false}
- {value: 'It is not possible, params and fields must match', correct: false}
29 changes: 29 additions & 0 deletions data/dependency-injection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,32 @@ questions:
- {value: "appDevProjectContainer.php", correct: false}
- {value: "appDevDebugProjectServiceContainer", correct: false}
- {value: "appDevDebugContainer", correct: false}
-
question: "True or false, parameters can also contain array values ?"
answers:
- {value: "true", correct: true}
- {value: "false", correct: false}
-
question: "What is the correct syntax to inject a service app.mailer ?"
answers:
- {value: "arguments: ['@app.mailer']", correct: true}
- {value: "arguments: ['%app.mailer%']", correct: false}
- {value: "arguments: ['app.mailer']", correct: false}
-
question: "What is the correct syntax to inject a parameter mailer.transport ?"
answers:
- {value: "arguments: ['@mailer.transport']", correct: false}
- {value: "arguments: ['%mailer.transport%']", correct: true}
- {value: "arguments: ['mailer.transport']", correct: false}
-
question: "How to define a service as private ?"
answers:
- {value: "type: private", correct: false}
- {value: "scope: private", correct: false}
- {value: "public: false", correct: true}
- {value: "private: true", correct: false}
-
question: "True or False, With defaut configuration each time you retrieve the service, you'll get the same instance ?"
answers:
- {value: "true", correct: true}
- {value: "false", correct: false}
67 changes: 67 additions & 0 deletions data/forms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,70 @@ questions:
- {value: "$builder->add('extra', null, ['mapped' => false])", correct: true}
- {value: "$builder->add('extra', 'hidden', ['mapped' => false])", correct: true}
- {value: "$builder->add('extra', null, ['validation' => false]", correct: false}
-
question: 'How do you render all the form fields in twig ?'
answers:
- {value: "form_widget(form)", correct: true}
- {value: "form_render(form)", correct: false}
- {value: "form_fields(form)", correct: false}
- {value: "render_form(form)", correct: false}
- {value: "form_row(form)", correct: false}
-
question: 'If you use form_widget() on a single fields, which parts are render ?'
answers:
- {value: "label", correct: false}
- {value: "input", correct: true}
- {value: "error", correct: false}
- {value: "label and input", correct: false}
- {value: "error, label and input", correct: false}
-
question: 'According to Symfony best practices, where you should add buttons ?'
answers:
- {value: "Template", correct: true}
- {value: "Form", correct: false}
- {value: "Controller", correct: false}
-
question: 'Which Field type exist?'
answers:
- {value: "HiddenType", correct: true}
- {value: "SearchType", correct: true}
- {value: "BirthdayType", correct: true}
- {value: "PasswordType", correct: true}
- {value: "SelectType", correct: false}
- {value: "FloatType", correct: false}
- {value: "BooleanType", correct: false}
-
question: 'How to Disable the Validation of Submitted Data'
answers:
- {value: "set the validation_groups option to false", correct: true}
- {value: "set the validation_enable option to false", correct: false}
- {value: "set the enable_validation option to false", correct: false}
- {value: "$this->createFormBuilder()->isValidated(false)", correct: false}
- {value: "By using false as third parameter for createFormBuilder", correct: false}
-
question: 'What data is inside FormEvent object at FormEvents::POST_SET_DATA?'
answers:
- {value: "Model data", correct: false}
- {value: "Normalized data", correct: true}
- {value: "Request data", correct: false}
- {value: "View data", correct: false}
-
question: 'Which form event dont exist?'
answers:
- {value: "FormEvents::PRE_SET_DATA", correct: false}
- {value: "FormEvents::SUBMIT", correct: false}
- {value: "FormEvents::POST_SUBMIT", correct: false}
- {value: "FormEvents::SET_DATA", correct: true}
-
question: 'How do you upload a UploadedFile ?'
answers:
- {value: "$file->move(string $directory, string $name = null)", correct: true}
- {value: "$file->upload(string $directory, string $name = null)", correct: false}
- {value: "$file->uploadFile(string $directory, string $name = null)", correct: false}
- {value: "$file->save(string $directory, string $name = null)", correct: false}
-
question: 'How to Use Data Transformers ?'
answers:
- {value: "$builder->get('tags')->addModelTransformer());", correct: true}
- {value: "$builder->add($builder->create('tags', TextType::class)->addModelTransformer(...));", correct: true}
- {value: "$builder->add('tags', TextType::class)->addModelTransformer(...);", correct: false}
22 changes: 22 additions & 0 deletions data/http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,25 @@ questions:
answers:
- {value: "True", correct: true}
- {value: "False", correct: false}
-
question: 'Which method exist in Symfony\Component\HttpFoundation\Request ?'
answers:
- {value: "getPathInfo", correct: true}
- {value: "getMethod", correct: true}
- {value: "getLanguages", correct: true}
- {value: "getHeaders", correct: false}
- {value: "getHttpHost", correct: true}
- {value: "getUrl", correct: false}
-
question: 'How can you set status code of Symfony\Component\HttpFoundation\Response'
answers:
- {value: "By you pass the vaklue as second parameter of new Response()", correct: true}
- {value: "By using setStatusCode()", correct: true}
- {value: "By using setCodeStatus()", correct: false}
- {value: "By using setHttpCode()", correct: false}
-
question: 'To override the 404 error template for HTML page, how should you name the template ?'
answers:
- {value: "error404.html.twig", correct: true}
- {value: "404.html.twig", correct: false}
- {value: "twig.404.html.twig", correct: false}
6 changes: 6 additions & 0 deletions data/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ questions:
- {value: Symfony\Component\BrowserKit\CssSelector, correct: false}
- {value: Symfony\Component\DomCrawler\CssSelector, correct: false}
- {value: Symfony\Bundle\FrameworkBundle\CssSelector, correct: false}
-
question: 'Event Listeners is use to Regrouping multiple listeners inside a single class ?'
answers:
- {value: false, correct: true}
- {value: true, correct: false}

6 changes: 6 additions & 0 deletions data/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ questions:
- {value: "_route, _controller, _action", correct: false}
- {value: "_controller, _locale, _format", correct: true}
- {value: "_locale, _format and another one.", correct: false}
-
question: 'How to generate absolute URL for a given route in controller ?'
answers:
- {value: "By using UrlGeneratorInterface::ABSOLUTE_URL as third parameter for generateUrl", correct: true}
- {value: "generateUrl generate absolute URL by default", correct: false}
- {value: "$this->generateAbsoluteUrl()", correct: false}
70 changes: 69 additions & 1 deletion data/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,72 @@ questions:
- {value: 'Access is granted if there are more voters granting access than denying', correct: false}
- {value: 'Access is granted if all voters grant acces', correct: false}
- {value: 'Access is granted if no voters throw an exception', correct: false}

-
question: 'What does the strategy `consensus` of the access decision manager mean?'
answers:
- {value: 'Access is granted as soon as there is one voter granting access', correct: false}
- {value: 'Access is granted if there are more voters granting access than denying', correct: true}
- {value: 'Access is granted if all voters grant acces', correct: false}
- {value: 'Access is granted if no voters throw an exception', correct: false}
-
question: 'What does the strategy `unanimous` of the access decision manager mean?'
answers:
- {value: 'Access is granted as soon as there is one voter granting access', correct: false}
- {value: 'Access is granted if there are more voters granting access than denying', correct: false}
- {value: 'Access is granted if all voters grant acces', correct: true}
- {value: 'Access is granted if no voters throw an exception', correct: false}
-
question: 'What decision strategy exist ?'
answers:
- {value: 'affirmative', correct: true}
- {value: 'consensus', correct: true}
- {value: 'unanimous', correct: true}
- {value: 'positive', correct: false}
- {value: 'negative', correct: false}
-
question: 'How to Restrict Firewalls to a Specific Request Pattern ?'
answers:
- {value: 'pattern: ^/(myurl)/', correct: true}
- {value: 'route: ^/(myurl)/', correct: false}
- {value: 'url: ^/(myurl)/', correct: false}
- {value: 'path: ^/(myurl)/', correct: false}
-
question: 'Which annotation is valid to check role ?'
answers:
- {value: '@Security("has_role("ROLE_ADMIN")")', correct: true}
- {value: '@Security("is_granted("ROLE_ADMIN")")', correct: false}
- {value: '@Security("restrict_for("ROLE_ADMIN")")', correct: false}
- {value: '@Security("role("ROLE_ADMIN")")', correct: false}
-
question: 'Which default role exist ?'
answers:
- {value: 'IS_AUTHENTICATED_REMEMBERED', correct: true}
- {value: 'IS_AUTHENTICATED_FULLY', correct: true}
- {value: 'IS_AUTHENTICATED_ANONYMOUSLY', correct: true}
- {value: 'IS_NOT_AUTHENTICATED', correct: false}
-
question: 'How can you deny acces to user in your controller ?'
answers:
- {value: "$this->denyAccessUnlessGranted('ROLE_ADMIN')", correct: true}
- {value: '@Security("has_role("ROLE_ADMIN")")', correct: true}
- {value: "if (!$this->get('security.authorization_checker')->isGranted('ROLE_ADMIN')) { throw $this->createAccessDeniedException(); }", correct: true}
- {value: "$this->user->denyAccessUnlessGranted('ROLE_ADMIN')", correct: false}
-
question: 'For implements Symfony\Component\Security\Core\User\UserInterface which method you have to define ?'
answers:
- {value: "getRoles()", correct: true}
- {value: "getPassword()", correct: true}
- {value: "getSalt()", correct: true}
- {value: "getUsername()", correct: true}
- {value: "eraseCredentials()", correct: true}
- {value: "getCredentials()", correct: false}
- {value: "getHash()", correct: false}
- {value: "getId()", correct: false}
-
question: 'For implements Symfony\Component\Security\Core\User\UserProviderInterface which method you have to define ?'
answers:
- {value: "loadUserByUsername($username)", correct: true}
- {value: "loadUser($username)", correct: false}
- {value: "refreshUser(UserInterface $user)", correct: true}
- {value: "getUser($username)", correct: false}
- {value: "supportsClass($class)", correct: true}
14 changes: 14 additions & 0 deletions data/templating.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,17 @@ questions:
answers:
- {value: 'True', correct: false}
- {value: 'False', correct: true}
-
question: 'Using Twig, what syntax used to print the content of a variable ?'
answers:
- {value: "{% %}", correct: false}
- {value: "{{ }}", correct: true}
- {value: "{# #}", correct: false}
- {value: "{ }", correct: false}
-
question: 'Using Twig, what syntax used to add comments ?'
answers:
- {value: "{% %}", correct: false}
- {value: "{{ }}", correct: false}
- {value: "{# #}", correct: true}
- {value: "{ }", correct: false}
Loading

0 comments on commit 019c164

Please sign in to comment.