Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 692f74c

Browse files
authored
docs: minor docs fixes (#1082)
1 parent 36a2ee1 commit 692f74c

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

docs/index.rst

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ component will be used to call the ``setTitle()`` method or directly set the pub
262262

263263
.. note::
264264

265-
``defaults()`` is called everytime a factory is instantiated (even if you don't end up
265+
``defaults()`` is called every time a factory is instantiated (even if you don't end up
266266
creating it). `Lazy Values`_ allows you to ensure the value is only calculated when/if it's needed.
267267

268268
Using your Factory
@@ -1045,7 +1045,7 @@ all ``ManyToOne`` and ``OneToOne`` relationships using the class of this object:
10451045
Lazy Values
10461046
~~~~~~~~~~~
10471047

1048-
The ``defaults()`` method is called everytime a factory is instantiated (even if you don't end up
1048+
The ``defaults()`` method is called every time a factory is instantiated (even if you don't end up
10491049
creating it). Sometimes, you might not want your value calculated every time. For example, if you have a value for one
10501050
of your attributes that:
10511051

@@ -1747,7 +1747,7 @@ this for you.
17471747
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
17481748
use Zenstruck\Foundry\Attribute\ResetDatabase;
17491749

1750-
#{ResetDatabase]
1750+
#[ResetDatabase]
17511751
class MyTest extends WebTestCase
17521752
{
17531753
// ...
@@ -2010,7 +2010,7 @@ Auto-Refresh
20102010

20112011
Object proxies have the option to enable *auto refreshing* that removes the need to call ``->_refresh()`` before calling
20122012
methods on the underlying object. When auto-refresh is enabled, most calls to proxy objects first refresh the wrapped
2013-
object from the database. This is mainly useful with "integration" test which interacts with your database and Symfony's
2013+
object from the database. This is mainly useful with "integration" tests that interact with your database and Symfony's
20142014
kernel.
20152015

20162016
::
@@ -2032,9 +2032,7 @@ Without auto-refreshing enabled, the above call to ``$post->getTitle()`` would r
20322032

20332033
A situation you need to be aware of when using auto-refresh is that all methods refresh the object first. If
20342034
changing the object's state via multiple methods (or multiple force-sets), an "unsaved changes" exception will be
2035-
thrown:
2036-
2037-
::
2035+
thrown::
20382036

20392037
use App\Factory\PostFactory;
20402038

@@ -2078,7 +2076,7 @@ To overcome this, you need to first disable auto-refreshing, then re-enable afte
20782076
Proxy objects pitfalls
20792077
......................
20802078

2081-
Proxified objects may have some pitfalls when dealing with Doctrine's entity manager. You may encounter this error:
2079+
Proxied objects may have some pitfalls when dealing with Doctrine's entity manager. You may encounter this error:
20822080

20832081
.. code-block:: text
20842082
@@ -2100,7 +2098,7 @@ the "real" object, which won't be wrapped by ``Proxy`` class.
21002098

21012099
.. warning::
21022100

2103-
Be aware that your object won't refresh automatically if they are not wrapped with a proxy.
2101+
Be aware that your objects won't refresh automatically if they are not wrapped with a proxy.
21042102

21052103
Repository Decorator
21062104
~~~~~~~~~~~~~~~~~~~~
@@ -2211,7 +2209,7 @@ PHPUnit Data Providers
22112209

22122210
It is possible to use factories in
22132211
`PHPUnit data providers <https://docs.phpunit.de/en/11.5/writing-tests-for-phpunit.html#data-providers>`_.
2214-
Their usage depends on whether you're using Foundry's `PHPUnit Extension`_ or not.:
2212+
Their usage depends on whether you're using Foundry's `PHPUnit Extension`_ or not:
22152213

22162214
With PHPUnit Extension
22172215
......................
@@ -2247,7 +2245,7 @@ you're using them in tests. Thanks to it, you can:
22472245
{
22482246
yield [PostFactory::createOne()];
22492247
yield [PostWithServiceFactory::createOne()];
2250-
yield [PostFactory::createOne(['body' => faker()->sentence()];
2248+
yield [PostFactory::createOne(['body' => faker()->sentence()])];
22512249
}
22522250

22532251
.. warning::
@@ -2454,7 +2452,7 @@ Disable Debug Mode
24542452
..................
24552453

24562454
In your ``.env.test`` file, you can set ``APP_DEBUG=0`` to have your tests run without debug mode. This can speed up
2457-
your tests considerably. You will need to ensure you cache is cleared before running the test suite. The best place to
2455+
your tests considerably. You will need to ensure your cache is cleared before running the test suite. The best place to
24582456
do this is in your ``tests/bootstrap.php``:
24592457

24602458
::
@@ -2560,7 +2558,7 @@ In-memory Behavior
25602558
~~~~~~~~~~~~~~~~~~
25612559

25622560
Foundry allows to use "in-memory" repositories in your factories. This is mainly useful for `DDD <https://en.wikipedia.org/wiki/Domain-driven_design>`_
2563-
applications or with `hexagonal architecture <https://en.wikipedia.org/wiki/Hexagonal_architecture_(software)>_`, where
2561+
applications or with `hexagonal architecture <https://en.wikipedia.org/wiki/Hexagonal_architecture_(software)>`_, where
25642562
repositories in the domain are usually interfaces for which main implementations are Doctrine ones. You can tell Foundry to
25652563
use the "in-memory" version of these repositories.
25662564

@@ -2677,8 +2675,8 @@ Foundry is shipped with an extension for PHPUnit. You can install it by modifyin
26772675
26782676
This extension provides the following features:
26792677

2680-
* :ref:`globally boot Foundry <_enable-foundry-in-your-testcase>` (and remove the needs of `Factories` trait)
2681-
* possibility to :ref:`automate the reset database mechanism <_automatic-database-reset>`
2678+
* :ref:`globally boot Foundry <enable-foundry-in-your-testcase>` (and remove the needs of `Factories` trait)
2679+
* possibility to :ref:`automate the reset database mechanism <automatic-database-reset>`
26822680
* support for the `#[WithStory] Attribute`_
26832681
* ability to use ``Factory::create()`` in `PHPUnit Data Providers`_ (along with PHPUnit ^11.4)
26842682

0 commit comments

Comments
 (0)