Skip to content

Commit

Permalink
add quote & update questions
Browse files Browse the repository at this point in the history
  • Loading branch information
lacpandore committed Oct 2, 2024
1 parent c6357f9 commit 3f37f77
Show file tree
Hide file tree
Showing 50 changed files with 311 additions and 169 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,5 @@ Ready to get certified? [Buy a voucher and register here](https://certification.

For more information, read this [comprehensive article](https://www.itefficience.com/article/la-certification-twig-une-1ere-pour-le-chemin-de-la-certif-symfony).

Interested in training with our team? [Contact us](https://www.itefficience.com/contact)!
Interested in training with our team? [Contact us](https://www.itefficience.com/contact)!

2 changes: 1 addition & 1 deletion data/Console/built_in_commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ questions:
help: 'https://symfony.com/doc/current/service_container.html#linting-service-definitions'
-
uuid: 1eebf878-8ba7-6466-8627-99d84c92580c
question: 'Which Tester class should you use to test a console event?'
question: 'Which "Tester" class should you use to test a console event?'
answers:
- { value: Symfony\Component\Console\Tester\CommandTester, correct: false }
- { value: Symfony\Component\Console\Tester\CommandCompletionTester, correct: false }
Expand Down
30 changes: 15 additions & 15 deletions data/Console/built_in_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ questions:
answers:
- { value: $cursor->moveRight(3);, correct: true }
- { value: $cursor->moveRight()->moveRight()->moveRight();, correct: true }
- { value: '$cursor->moveToPosition( $cursor->getCurrentPosition()[0], $cursor->getCurrentPosition()[1] + 3 );', correct: true }
- { value: "$cursor->moveToPosition($cursor->getCurrentPosition()[0], $cursor->getCurrentPosition()[1] + 3);", correct: true }
help: 'https://symfony.com/doc/current/components/console/helpers/cursor.html#moving-the-cursor'
-
uuid: 1eebf878-8ba5-6be8-a74b-99d84c92580c
Expand All @@ -51,7 +51,7 @@ questions:
help: 'https://symfony.com/doc/current/components/console/helpers/formatterhelper.html'
-
uuid: 1eebf878-8ba5-6c74-a208-99d84c92580c
question: 'What is the correct way to truncate a message in a console with the formater helper ? $message = This is a very long message, which should be truncated ; to $message = This is a very long message, which should be!! ;'
question: 'What is the correct way to truncate a message in a console with the formater helper ? $message = "This is a very long message, which should be truncated";to $message = "This is a very long message, which should be!!";'
answers:
- { value: "$formatter->truncate($message, 44, '!!');", correct: true }
- { value: "$formatter->truncateMessage($message, -10, '!!');", correct: false }
Expand All @@ -63,7 +63,7 @@ questions:
question: "In a console, how to disable the custom suffix '...' in the function truncate of the formater helper ?"
answers:
- { value: '$formatter->truncate($message, 7)->disableSuffix();', correct: false }
- { value: '$formatter->truncate($message, 7, );', correct: true }
- { value: '$formatter->truncate($message, 7, "");', correct: true }
help: 'https://symfony.com/doc/current/components/console/helpers/formatterhelper.html#custom-suffix'
-
uuid: 1eebf878-8ba5-6d00-8fa6-99d84c92580c
Expand All @@ -80,8 +80,8 @@ questions:
uuid: 1eebf878-8ba5-6d46-ad98-99d84c92580c
question: "What's the correct way to modify a rendered tables in a console ?"
answers:
- { value: 'use $table->addRow([ Symfony ]);', correct: false }
- { value: 'use $table->appendRow([ Symfony ]);', correct: true }
- { value: 'use $table->addRow(["Symfony"]);', correct: false }
- { value: 'use $table->appendRow(["Symfony"]);', correct: true }
help: 'https://symfony.com/doc/current/components/console/helpers/table.html#modifying-rendered-tables'
-
uuid: 1eebf878-8ba5-6e2c-93d3-99d84c92580c
Expand Down Expand Up @@ -121,13 +121,13 @@ questions:
uuid: 1eebf878-8ba5-6f62-b189-99d84c92580c
question: 'What is the method to set the given value in the QuestionHelper for a test in the given tester: $commandTester = new CommandTester($command);'
answers:
- { value: '$commandTester->setAnswer([ Test ]);', correct: false }
- { value: '$commandTester->setGivenValue([ Test ]);', correct: false }
- { value: '$commandTester->setInputs([ Test ]);', correct: true }
- { value: '$commandTester->setAnswer(["Test"]);', correct: false }
- { value: '$commandTester->setGivenValue(["Test"]);', correct: false }
- { value: '$commandTester->setInputs(["Test"]);', correct: true }
help: 'https://symfony.com/doc/current/components/console/helpers/questionhelper.html#testing-a-command-that-expects-input'
-
uuid: 1eebf878-8ba5-6ff8-80bd-99d84c92580c
question: "In a question in your command, what is the way to set a list of valid values autocompletable that the user can answer to this question ? $question = new Question('Please enter the name of a bundle', 'FooBundle'); $bundles = ['AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle'];"
question: "In a question in your command, what is the way to set a list of valid values autocompletable that the user can answer to this question ? $question = new Question('Please enter the name of a bundle', 'FooBundle'); $bundles = ['AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle'];"
answers:
- { value: $question->setPossibleAnswers($bundles);, correct: false }
- { value: $question->setAutocomplete($bundles);, correct: false }
Expand All @@ -147,14 +147,14 @@ questions:
uuid: 1eebf878-8ba6-608e-b8bd-99d84c92580c
question: 'What are correct ways to give VERY VERBOSE detail on a ProgressBar in the console ?'
answers:
- { value: '$progressBar->setFormat( very_verbose );', correct: true }
- { value: '$progressBar->setFormat("very_verbose");', correct: true }
- { value: '$progressBar->setFormat(OutputInterface::VERBOSITY_VERY_VERBOSE);', correct: false }
- { value: 'add a -vv the end of the command launched', correct: true }
- { value: 'add a "-vv" the end of the command launched', correct: true }
- { value: $progressBar->setVeryVerbose();, correct: false }
help: 'https://symfony.com/doc/current/components/console/helpers/progressbar.html#customizing-the-progress-bar'
-
uuid: 1eebf878-8ba6-60de-91d5-99d84c92580c
question: 'For performance reasons, symfony redraws the screen once every XXXXms. If this is too fast or too slow for your application, use the methods minSecondsBetweenRedraws() and maxSecondsBetweenRedraws(): How much is XXX ?'
question: "For performance reasons, symfony redraws the screen once every XXXXms. If this is too fast or too slow for your application, use the methods minSecondsBetweenRedraws() and maxSecondsBetweenRedraws():\r\n\r\nHow much is XXX ?"
answers:
- { value: '50 ms', correct: false }
- { value: '80 ms', correct: false }
Expand All @@ -169,13 +169,13 @@ questions:
answers:
- { value: "$helper->run($output, 'figlet Symfony');", correct: true }
- { value: "$helper->run($output, ['figlet', 'Symfony']);", correct: true }
- { value: "$process = new Process(['figlet', 'Symfony']); $helper->run($output, $process);", correct: true }
- { value: "$process = new Process(['figlet', 'Symfony']); $helper->run($output, $process);", correct: true }
help: 'https://symfony.com/doc/current/components/console/helpers/processhelper.html'
-
uuid: 1eebf878-8ba6-6174-a67f-99d84c92580c
question: "How can you customize the error message when using the Process Helper's run() method, such as in $helper->run($output, 'ls')?"
answers:
- { value: "by adding ->setInvalidMesage($errorMessage) on run method like $helper->run($output, $process')->setInvalidMessage('Failed);", correct: false }
- { value: 'by adding a third argument $helper->run($output, $process, Failed );', correct: true }
- { value: "by adding ->setInvalidMesage($errorMessage) on run method like $helper->run($output, $process')->setInvalidMessage('Failed);", correct: false }
- { value: 'by adding a third argument $helper->run($output, $process, "Failed");', correct: true }
- { value: 'By overring the message of the ProcessHelperException', correct: false }
help: 'https://symfony.com/doc/current/components/console/helpers/processhelper.html#customized-display'
2 changes: 1 addition & 1 deletion data/Console/verbosity_levels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ questions:
help: 'https://symfony.com/doc/current/console/verbosity.html'
-
uuid: 1eebf878-8ba5-690e-84ef-99d84c92580c
question: "Is this a correct way to print information in a console for a verbose level or higher ? $output->writeln(OutputInterface::VERBOSITY_VERBOSE, 'Printed in verbose mode or higher');"
question: "Is this a correct way to print information in a console for a verbose level or higher ? $output->writeln(OutputInterface::VERBOSITY_VERBOSE, 'Printed in verbose mode or higher');"
answers:
- { value: 'Yes', correct: false }
- { value: 'No', correct: true }
Expand Down
36 changes: 36 additions & 0 deletions data/automated_tests/crawler_object.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,39 @@ questions:
- { value: Symfony\Component\DomCrawler\CssSelector, correct: false }
- { value: Symfony\Bundle\FrameworkBundle\CssSelector, correct: false }
help: 'https://symfony.com/doc/current/components/css_selector.html#id1'
-
uuid: 1ef80030-6e1b-6534-8970-7d5c3695d3e1
question: 'Which of the following methods is used to select nodes that match a CSS selector in Symfony DomCrawler?'
answers:
- { value: filterXpath(), correct: false }
- { value: filter(), correct: true }
- { value: eq(), correct: false }
- { value: first(), correct: false }
help: 'https://symfony.com/doc/7.0/testing/dom_crawler.html'
-
uuid: 1ef80033-e021-68a6-bdfe-d91142d7210b
question: 'What does the reduce() method in DomCrawler do?'
answers:
- { value: 'It reduces the number of nodes by selecting only the first node', correct: false }
- { value: 'It applies a callable to filter nodes, returning nodes for which the callable does not return false', correct: true }
- { value: 'It counts the number of nodes in the Crawler instance', correct: false }
- { value: 'It removes sibling nodes', correct: false }
help: 'https://symfony.com/doc/7.0/testing/dom_crawler.html'
-
uuid: 1ef80036-5b78-6dcc-80fa-f77948a3eeee
question: 'Which method should be used to get the parent nodes of a selected node in Symfony DomCrawler?'
answers:
- { value: 'children()', correct: false }
- { value: 'parents()', correct: true }
- { value: 'siblings()', correct: false }
- { value: 'nextAll()', correct: false }
help: 'https://symfony.com/doc/7.0/testing/dom_crawler.html'
-
uuid: 1ef80038-a364-6652-9e7e-85533c357fff
question: "What does the extract() method return when passed an array like ['_text', 'href']?"
answers:
- { value: 'It returns a string of all node values concatenated.', correct: false }
- { value: 'It extracts an array of attributes (text and href) for each node in the Crawler', correct: true }
- { value: "It returns the first node's text value only.", correct: false }
- { value: "It removes all nodes that don't have an href attribute.", correct: false }
help: 'https://symfony.com/doc/7.0/testing/dom_crawler.html'
2 changes: 1 addition & 1 deletion data/automated_tests/framework_objects_access.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ questions:
help: 'https://github.com/symfony/symfony/blob/7.0/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php'
-
uuid: 1eed57ff-6525-62ba-9d10-15125f5105d0
question: 'Is this mapping correct ?/** @Column(name= number , type= integer ) */ private $number;'
question: 'Is this mapping correct ? /** @Column(name="number", type="integer") */ private $number;'
answers:
- { value: 'Yes', correct: false }
- { value: 'No', correct: true }
Expand Down
8 changes: 4 additions & 4 deletions data/automated_tests/unit_tests_with_php_unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ questions:
uuid: 1eebf878-8b9e-61c2-bcfc-99d84c92580c
question: 'How to disable constructor when mocking an object?'
answers:
- { value: '$this->getMock( My\Class )->disableOriginalConstructor()->getMock()', correct: false }
- { value: '$this->disableOriginalConstructor( My\Class'')', correct: false }
- { value: '$this->getMockBuilder( My\Class )->disableOriginalConstructor()->getMock()', correct: true }
- { value: '$this->getMockBuilder( My\Class )->getMock()->disableConstructor()', correct: false }
- { value: '$this->getMock("My\Class")->disableOriginalConstructor()->getMock()', correct: false }
- { value: '$this->disableOriginalConstructor("My\Class")', correct: false }
- { value: '$this->getMockBuilder("My\Class")->disableOriginalConstructor()->getMock()', correct: true }
- { value: '$this->getMockBuilder("My\Class")->getMock()->disableConstructor()', correct: false }
help: 'https://phpunit.de/manual/6.5/en/test-doubles.html#test-doubles.stubs.examples.StubTest2.php'
-
uuid: 1eebf878-8b9e-6320-adc3-99d84c92580c
Expand Down
8 changes: 4 additions & 4 deletions data/controllers/http_redirects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ questions:
uuid: 1eebf878-8b9e-6ffa-a320-99d84c92580c
question: 'How to perform a redirection on example.org in a controller?'
answers:
- { value: 'return $this->redirect($this->generateUrl( https://www.example.org ))', correct: false }
- { value: 'return $this->redirectUrl( https://www.example.org )', correct: false }
- { value: 'return $this->redirect( https://www.example.org )', correct: true }
- { value: 'return $this->generateUrl( https://www.example.org )', correct: false }
- { value: 'return $this->redirect($this->generateUrl("https://www.example.org"))', correct: false }
- { value: 'return $this->redirectUrl("https://www.example.org")', correct: false }
- { value: 'return $this->redirect("https://www.example.org")', correct: true }
- { value: 'return $this->generateUrl("https://www.example.org")', correct: false }
help: 'https://symfony.com/doc/current/controller.html#redirecting'
-
uuid: 1eebf878-8ba8-692e-8bef-99d84c92580c
Expand Down
4 changes: 2 additions & 2 deletions data/data_validation/built_in_validation_constraints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ questions:
uuid: 1eebf878-8b9f-6d24-94f5-99d84c92580c
question: 'How do you bind a constraint to a form field?'
answers:
- { value: 'Using option constraints in $formBuilder->add()', correct: true }
- { value: 'Using option "constraints" in $formBuilder->add()', correct: true }
- { value: 'Passing constraint instance in $this->createFormBuilder()', correct: false }
- { value: 'Invoke $formBuilder->setConstraints() method', correct: false }
- { value: 'Add an annotation in model', correct: true }
Expand Down Expand Up @@ -71,7 +71,7 @@ questions:
- { value: 'null', correct: true }
- { value: '2020-01-15', correct: true }
- { value: 15/01/2020, correct: false }
- { value: 'new \DateTime( 2020-01-15 )', correct: false }
- { value: 'new \DateTime("2020-01-15")', correct: false }
- { value: '2020-13-15', correct: false }
- { value: 15/13/2020, correct: false }
help: 'https://symfony.com/doc/current/reference/constraints/Date.html'
Expand Down
6 changes: 3 additions & 3 deletions data/data_validation/group_sequence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ questions:
uuid: 1eec03b4-9e6d-6856-9534-cd3903165108
question: "In which function, if there's a violation in any group, the rest of the groups are not validated. E.g. if 'User' fails, 'Premium' and 'Api' are not validated."
answers:
- { value: "public function getGroupSequence(): array|GroupSequence { return ['User', 'Premium', 'Api']; }", correct: true }
- { value: "public function getGroupSequence(): array|GroupSequence { return [[['User'], 'Premium'], 'Api']; }", correct: false }
- { value: "public function getGroupSequence(): array|GroupSequence { return [['User'], ['Premium'], ['Api']]; }", correct: false }
- { value: "public function getGroupSequence(): array|GroupSequence { return ['User', 'Premium', 'Api']; }", correct: true }
- { value: "public function getGroupSequence(): array|GroupSequence { return [[['User'], 'Premium'], 'Api']; }", correct: false }
- { value: "public function getGroupSequence(): array|GroupSequence { return [['User'], ['Premium'], ['Api']]; }", correct: false }
help: 'https://symfony.com/doc/current/validation/sequence_provider.html#group-sequence-providers'
10 changes: 5 additions & 5 deletions data/dependency_injection/compiler_passes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,39 @@ questions:
help: 'https://symfony.com/doc/current/components/dependency_injection/compilation.html#controlling-the-pass-ordering'
-
uuid: 1ef4935f-f7df-6ebe-bb60-7bba21e8d9fb
question: 'What is a compiler pass in Symfony?'
question: 'What is a "compiler pass" in Symfony?'
answers:
- { value: 'A tool to manage database migrations', correct: false }
- { value: 'A mechanism to modify the service container before it is compiled', correct: true }
- { value: 'A component for forms management', correct: false }
help: 'https://symfony.com/doc/current/service_container/compiler_passes.html'
-
uuid: 1ef49363-d37f-69d0-9063-c36a242f9461
question: 'In which file is the build method often implemented to add a compiler pass ?'
question: 'In which file is the build method often implemented to add a "compiler pass"?'
answers:
- { value: config.yml, correct: false }
- { value: Kernel.php, correct: true }
- { value: services.yaml, correct: false }
help: 'https://symfony.com/doc/current/service_container/compiler_passes.html'
-
uuid: 1ef49369-5acb-6f42-8894-eb7574faa390
question: 'Where are compiler passes typically saved?'
question: 'Where are "compiler passes" typically saved?'
answers:
- { value: 'In config/packages', correct: false }
- { value: 'In src/DependencyInjection/Compiler', correct: true }
- { value: 'In src/EventListener', correct: false }
help: 'https://symfony.com/doc/current/service_container/compiler_passes.html'
-
uuid: 1ef4936c-ce1d-65c4-b100-e7c0f56ef5bd
question: 'Which service should be used to add a compiler pass in the build method?'
question: 'Which service should be used to add a "compiler pass" in the build method?'
answers:
- { value: $container, correct: false }
- { value: $this->containerBuilder, correct: false }
- { value: $this->addCompilerPass(), correct: true }
help: 'https://symfony.com/doc/current/service_container/compiler_passes.html'
-
uuid: 1ef4936f-6ee6-651c-abec-9db2348bdd73
question: 'What is the main object used in a compiler pass to access the services?'
question: 'What is the main object used in a "compiler pass" to access the services?'
answers:
- { value: ContainerBuilder, correct: true }
- { value: ServiceContainer, correct: false }
Expand Down
Loading

0 comments on commit 3f37f77

Please sign in to comment.