Skip to content

Commit e522fd5

Browse files
author
tkotosz
committed
Update local documentation build
1 parent 6714d4e commit e522fd5

File tree

3 files changed

+66
-65
lines changed

3 files changed

+66
-65
lines changed

docs/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# import os
1414
# import sys
1515
# sys.path.insert(0, os.path.abspath('.'))
16-
16+
import sphinx_rtd_theme
1717

1818
# -- Project information -----------------------------------------------------
1919

@@ -49,7 +49,8 @@
4949

5050
# The theme to use for HTML and HTML Help pages. See the documentation for
5151
# a list of builtin themes.
52-
html_theme = 'default'
52+
html_theme = 'sphinx_rtd_theme'
53+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
5354

5455
# Add any paths that contain custom static files (such as style sheets) here,
5556
# relative to this directory. They are copied after the builtin static files,

docs/guide/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Requirements
99
* Magento 2 2.2+
1010

1111
Using Composer
12-
----------------
12+
--------------
1313

1414
The recommended installation method is through `Composer <https://getcomposer.org>`_:
1515

16-
.. code-block:: bash
16+
.. code-block:: bash
1717
18-
$ composer require --dev bex/behat-magento2-extension
18+
$ composer require --dev bex/behat-magento2-extension

docs/guide/quickstart.rst

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Install Behat
66

77
If you didn't install Behat already, then you can install it with composer in the following way:
88

9-
.. code-block:: bash
9+
.. code-block:: bash
1010
11-
$ composer require --dev behat/behat
11+
$ composer require --dev behat/behat
1212
1313
For alternative installation options check the `Behat official documentation <https://docs.behat.org/en/latest/quick_start.html#installation>`_
1414

@@ -17,9 +17,9 @@ Install the Extension
1717

1818
Similarly you can install the extension via composer:
1919

20-
.. code-block:: bash
20+
.. code-block:: bash
2121
22-
$ composer require --dev bex/behat-magento2-extension
22+
$ composer require --dev bex/behat-magento2-extension
2323
2424
For more information see the the :doc:`installation section of this documentation </guide/installation>`.
2525

@@ -28,20 +28,20 @@ Setup the Behat configuration
2828

2929
You need to enable the extension in the Behat configuration and configure your Behat Suite to use the Magento 2 Service Container. Your ``behat.yml`` should look like this:
3030

31-
.. code-block:: yaml
31+
.. code-block:: yaml
3232
33-
default:
34-
extensions:
35-
Bex\Behat\Magento2Extension: ~
33+
default:
34+
extensions:
35+
Bex\Behat\Magento2Extension: ~
3636
37-
suites:
38-
application:
39-
autowire: true
37+
suites:
38+
application:
39+
autowire: true
4040
41-
contexts:
42-
- FeatureContext
41+
contexts:
42+
- FeatureContext
4343
44-
services: '@bex.magento2_extension.service_container'
44+
services: '@bex.magento2_extension.service_container'
4545
4646
With the above configuration:
4747
- The extension is enabled
@@ -55,69 +55,69 @@ Verify the configuration
5555

5656
In order to verify that the extension is configured correctly you will need a test feature. For example create a ``features/my_feature.feature`` file like this:
5757

58-
.. code-block:: gherkin
58+
.. code-block:: gherkin
5959
60-
Feature: Magento and Behat DI connected
61-
As a developer
62-
In order to write Behat tests easily
63-
I should be able to inject services from the Magento DI into Behat Contexts
60+
Feature: Magento and Behat DI connected
61+
As a developer
62+
In order to write Behat tests easily
63+
I should be able to inject services from the Magento DI into Behat Contexts
6464
65-
Scenario: Injecting service from Magento DI to Behat Context as argument for Behat Context constructor
66-
Given A service has been successfully injected through the Context constructor
67-
When I work with Behat
68-
Then I am happy
65+
Scenario: Injecting service from Magento DI to Behat Context as argument for Behat Context constructor
66+
Given A service has been successfully injected through the Context constructor
67+
When I work with Behat
68+
Then I am happy
6969
7070
Also to implement the above feature you need to add the following step definitions to your ``features/bootstrap/FeatureContext.php`` Behat Context:
7171

72-
.. code-block:: php
72+
.. code-block:: php
7373
74-
<?php
74+
<?php
7575
76-
use Behat\Behat\Context\Context;
77-
use Exception;
78-
use Magento\Sales\Api\OrderRepositoryInterface;
76+
use Behat\Behat\Context\Context;
77+
use Exception;
78+
use Magento\Sales\Api\OrderRepositoryInterface;
7979
80-
class FeatureContext implements Context
81-
{
82-
/** @var OrderRepositoryInterface */
83-
private $orderRepository;
80+
class FeatureContext implements Context
81+
{
82+
/** @var OrderRepositoryInterface */
83+
private $orderRepository;
8484
85-
public function __construct(OrderRepositoryInterface $orderRepository)
86-
{
87-
$this->orderRepository = $orderRepository;
88-
}
85+
public function __construct(OrderRepositoryInterface $orderRepository)
86+
{
87+
$this->orderRepository = $orderRepository;
88+
}
8989
90-
/**
91-
* @Given A service has been successfully injected through the Context constructor
92-
*/
93-
public function aServiceHasBeenSuccessfullyInjectedThroughTheContextConstructor()
94-
{
95-
if (!$this->orderRepository instanceof OrderRepositoryInterface) {
96-
throw new Exception('Something went wrong :(');
97-
}
90+
/**
91+
* @Given A service has been successfully injected through the Context constructor
92+
*/
93+
public function aServiceHasBeenSuccessfullyInjectedThroughTheContextConstructor()
94+
{
95+
if (!$this->orderRepository instanceof OrderRepositoryInterface) {
96+
throw new Exception('Something went wrong :(');
9897
}
98+
}
9999
100-
/**
101-
* @When I work with Behat
102-
*/
103-
public function iWorkWithBehat()
104-
{
105-
// no-op
106-
}
100+
/**
101+
* @When I work with Behat
102+
*/
103+
public function iWorkWithBehat()
104+
{
105+
// no-op
106+
}
107107
108-
/**
109-
* @Then I am happy
110-
*/
111-
public function iAmHappy()
112-
{
113-
// no-op :)
114-
}
108+
/**
109+
* @Then I am happy
110+
*/
111+
public function iAmHappy()
112+
{
113+
// no-op :)
115114
}
115+
}
116116
117117
Note that here we inject the Order Repository Magento service through the Context constructor, but it is also possible to inject it through the Behat Step definition as well. For more information see the :doc:`usage section of this documentation </guide/usage>`.
118118

119119
Run Behat and you should see the test passing.
120120

121-
.. code-block:: bash
121+
.. code-block:: bash
122122
123-
$ bin/behat features/my_feature.feature
123+
$ bin/behat features/my_feature.feature

0 commit comments

Comments
 (0)