Skip to content

Commit a885962

Browse files
ikhrysievatimofiyprisyazhnyukkisakova
authored
BAP-21665: Cover documentation examples with tests (#33817)
- Updated the namespaces in the documentation and fixed various bugs - Improved Entity, Entity Management, Security, Data Grid Workflows, and some other documentation sections and covered them with tests - Added a new application along with its associated entity and behat configuration. --------- Co-authored-by: timofiyprisyazhnyuk <[email protected]> Co-authored-by: Kateryna Isakova <[email protected]>
1 parent ab5fa72 commit a885962

File tree

336 files changed

+10669
-4806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

336 files changed

+10669
-4806
lines changed

backend/architecture/tech-stack/search-index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Here is example of the document from the website index type under oro_product_WE
202202
"visibility_anonymous":1,
203203
"visibility_new":1,
204204
"is_visible_by_default":1,
205-
"all_text_1":"Retail Supplies Credit Card Pin Pad Reader Choosing the right credit card processing terminal to fit your business needs can help you increase your profits and reduce your processing costs. This credit card reader helps you do just that. Its easy-to-use ATM style interface accepts PIN-based debit card transactions and swipes traditional payment cards. It also accepts chip cards and features a built-in receipt printer Product Information & Features: Catalog Page: 2976 Performs PIN based debit card transactions Accepts chip cards Prints transaction receipts Connectivity: USB (not included) Large, backlit display Supports all magnetic stripe cards Color: Purple Technical Specs: Width: 6\u201d Height: 3\u201d Weight: .6 lb. ACME defaultMetaDescription defaultMetaKeywords 1AB92",
205+
"all_text_1":"Retail Supplies Credit Card Pin Pad Reader Choosing the right credit card processing terminal to fit your business needs can help you increase your profits and reduce your processing costs. This credit card reader helps you do just that. Its easy-to-use ATM style interface accepts PIN-based debit card transactions and swipes traditional payment cards. It also accepts chip cards and features a built-in receipt printer Product Information & Features: Catalog Page: 2976 Performs PIN based debit card transactions Accepts chip cards Prints transaction receipts Connectivity: USB (not included) Large, backlit display Supports all magnetic stripe cards Color: Purple Technical Specs: Width: 6\u201d Height: 3\u201d Weight: .6 lb. Acme defaultMetaDescription defaultMetaKeywords 1AB92",
206206
"sku":"1AB92",
207207
"names_1":"Credit Card Pin Pad Reader",
208208
"shortDescriptions_1":"Choosing the right credit card processing terminal to fit your business needs can help you increase your profits and reduce your processing costs. This credit card reader helps you do just that. Its' easy-to-use ATM style interface accepts PIN-based debit card transactions and swipes traditional payment cards. It also accepts chip cards and features a built-in receipt printer",

backend/automated-tests/behat.rst

+15-15
Original file line numberDiff line numberDiff line change
@@ -198,42 +198,42 @@ To run ChromeDriver in the background, append the ampersand symbol (&) to the en
198198
Run Tests
199199
~~~~~~~~~
200200

201-
Before you begin, familiarize yourself with behat arguments and options. Run ``bin/behat --help`` for a detailed description.
201+
Before you begin, familiarize yourself with behat arguments and options. Run ``php bin/behat --help`` for a detailed description.
202202

203203
When the Oro application is installed without demo data and is running, and the ChromeDriver is running, you can start running the behat tests by feature from the root of the application. You can use one of the following commands.
204204

205205
Run the feature test scenario:
206206

207207
.. code-block:: none
208208
209-
bin/behat vendor/oro/platform/src/Oro/Bundle/UserBundle/Tests/Behat/Features/login.feature -vvv
209+
php bin/behat vendor/oro/platform/src/Oro/Bundle/UserBundle/Tests/Behat/Features/login.feature -vvv
210210
211211
Preview all available feature steps:
212212

213213
.. code-block:: none
214214
215-
bin/behat -dl -s OroUserBundle
215+
php bin/behat -dl -s OroUserBundle
216216
217217
View steps with full description and examples:
218218

219219
.. code-block:: none
220220
221-
bin/behat -di -s OroUserBundle
221+
php bin/behat -di -s OroUserBundle
222222
223223
Every bundle has its dedicated test suite that can be run separately:
224224

225225
.. code-block:: none
226226
227-
bin/behat -s OroUserBundle
227+
php bin/behat -s OroUserBundle
228228
229229
Running Сonsumers
230230
~~~~~~~~~~~~~~~~~
231231

232-
To run multiple consumers during behat tests, you can use the ``--consumers`` option in ``bin/behat``, which applies an integer argument, for example:
232+
To run multiple consumers during behat tests, you can use the ``--consumers`` option in ``php bin/behat``, which applies an integer argument, for example:
233233

234234
.. code-block:: none
235235
236-
bin/behat --consumers=4
236+
php bin/behat --consumers=4
237237
238238
By default, when the option is not specified, 2 consumers are run.
239239

@@ -358,7 +358,7 @@ You can disable feature isolation by adding the ``--skip-isolators`` option to t
358358
Disable Message Consumer Background Running
359359
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
360360

361-
To simulate production conditions more accurately during testing, you can disable the message consumer background running using the ``--do-not-run-consumer`` option in ``bin/behat``.
361+
To simulate production conditions more accurately during testing, you can disable the message consumer background running using the ``--do-not-run-consumer`` option in ``php bin/behat``.
362362

363363
Be aware that if you choose to use this option, the consumer will not be launched, and the application will not process any messages from the message queue. This could cause problems if you are testing functionality that relies on the timely processing of messages by the consumer.
364364

@@ -636,7 +636,7 @@ You can use references to the entities in both inline and |alice fixtures|.
636636
* It is prohibited to modify or add new entities within Initializer.
637637
* It should implement ``ReferenceRepositoryInitializerInterface``.
638638
* It should be registered as the Behat container service in the ``{BundlePath}/Tests/Behat/services.yml`` file with the ``oro_behat.reference_repository_initializer`` tag.
639-
* To show all references, use the ``bin/behat --available-references`` command.
639+
* To show all references, use the ``php bin/behat --available-references`` command.
640640

641641
The most commonly used references:
642642

@@ -654,7 +654,7 @@ You can try:
654654

655655
.. code-block:: none
656656
657-
bin/behat --dry-run
657+
php bin/behat --dry-run
658658
659659
This can be useful in case you are unsure that you have declared all the necessary context for your feature.
660660
OroBehatExtension enhances this feature and adds extra functionality.
@@ -884,7 +884,7 @@ A quick way to do so is to dry-run your feature tests. In the console, run the f
884884

885885
.. code-block:: none
886886
887-
bin/behat path/to/your.feature --dry-run --append-snippets --snippets-type=regex
887+
php bin/behat path/to/your.feature --dry-run --append-snippets --snippets-type=regex
888888
889889
The feature is executed in the *--dry-run* mode, and at the final stage of execution, you are prompted to add undefined steps mock implementation to one of the existing contexts.
890890

@@ -928,12 +928,12 @@ Type the following command in your console:
928928

929929
.. code-block:: none
930930
931-
bin/behat -dl -s AcmeDemoBundle | grep "flash message"
931+
php bin/behat -dl -s AcmeDemoBundle | grep "flash message"
932932
933933
934934
.. code-block:: bash
935935
936-
$ bin/behat -dl -s OroUserBundle | grep "flash message"
936+
$ php bin/behat -dl -s OroUserBundle | grep "flash message"
937937
OroUserBundle | Then /^(?:|I )follow "(?P<title>[^"]+)" link within flash message "(?P<message>([^"\\]|\\.)*)"$/
938938
OroUserBundle | Then /^(?:|I )should see "(?P<title>[^"]+)" flash message$/
939939
OroUserBundle | Then /^(?:|I )should see '(?P<title>[^']+)' flash message$/
@@ -950,12 +950,12 @@ Type the following command in your console:
950950
951951
.. code-block:: none
952952
953-
bin/behat -dl -s AcmeDemoBundle | grep "grid"
953+
php bin/behat -dl -s AcmeDemoBundle | grep "grid"
954954
955955
956956
.. code-block:: none
957957
958-
$ bin/behat -dl -s OroUserBundle | grep "grid"
958+
$ php bin/behat -dl -s OroUserBundle | grep "grid"
959959
OroUserBundle | Then /^I see that grid has scrollable header$/
960960
OroUserBundle | Then /^I see that grid header is sticky$/
961961
OroUserBundle | When /^I don't select any record from "(?P<gridName>[^"]+)"$/

backend/automated-tests/debug-behat-tests.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ How to Debug Behat Tests
1919
Enable Very Verbose Output
2020
^^^^^^^^^^^^^^^^^^^^^^^^^^
2121

22-
You can increase the output verbosity to see more details on what's going on by adding the ``-v``, ``-vv``, or ``-vvv`` option to ``bin/behat``.
22+
You can increase the output verbosity to see more details on what's going on by adding the ``-v``, ``-vv``, or ``-vvv`` option to ``php bin/behat``.
2323
This enables verbose, very verbose, or very very verbose output accordingly.
2424

2525
- ``-v, --verbose[=VERBOSE]`` -- Increase verbosity of exceptions.
2626

2727
.. code-block:: bash
2828
29-
bin/behat path/to/your.feature -vv
29+
php bin/behat path/to/your.feature -vv
3030
3131
Review Error Messages
3232
^^^^^^^^^^^^^^^^^^^^^

backend/entities-data-management/actions/action-groups.rst

+5-28
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,12 @@ Parameters are accessible in actions as the root node of contextual data (e.g.,
1212
Action Group Configuration
1313
--------------------------
1414

15-
File `<bundleResourceRoot>/config/oro/actions.yml`
16-
17-
.. code-block:: none
18-
19-
action_groups: # root node for action groups
20-
demo_flash_greetings_to: # name of action group
21-
replace: # (optional) the list of nodes that should be replaced during the overriding
22-
- actions # node name
23-
parameters: # parameters declaration node
24-
what: # name of the parameter
25-
type: AcmeDemoBundle/String/Phrase # (optional, default = any) type validation of parameter (available types: integer, string, boolean, array, double, object, PHP class)
26-
message: "Bad type" # (optional) message to be prompted if parameter validation failure met
27-
default: "Hello" # (optional) default value for optional parameter, if not set then parameter `what` is required
28-
who: ~ # set all defaults to parameter options (type: any)
29-
conditions: # Condition expression
30-
@not_empty: [$.who]
31-
actions: # list of actions that should be executed
32-
- '@call_service_method':
33-
service: type_guesser
34-
method: guess
35-
method_parameters: [$.who] # as you can see, parameters are accessible from root $.<parameterName>
36-
attribute: $.typeOfWho
37-
- '@flash_message':
38-
message: "%param1%, %param2%!"
39-
type: 'info'
40-
message_parameters:
41-
param1: $.what
42-
param2: $.typeOfWho
15+
.. oro_integrity_check:: c99c6e9f1a933e282f068ef1fcf559e3a7113ee0
4316

17+
.. literalinclude:: /code_examples/commerce/demo/Resources/config/oro/actions.yml
18+
:caption: src/Acme/Bundle/DemoBundle/Resources/config/oro/actions.yml
19+
:language: yaml
20+
:lines: 1-24
4421

4522
Next, run this action_group as follows:
4623

0 commit comments

Comments
 (0)