Skip to content

Commit 545837d

Browse files
authored
Merge pull request #5666 from kenjis/fix-docs-mocking.rst
docs: fix sample code in mocking.rst
2 parents f801829 + cd5052d commit 545837d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

user_guide_src/source/testing/mocking.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Cache
1717
You can mock the cache with the ``mock()`` method, using the ``CacheFactory`` as its only parameter.
1818
::
1919

20-
$mock = mock(CodeIgniter\Cache\CacheFactory::class);
20+
$mock = mock(\CodeIgniter\Cache\CacheFactory::class);
2121

2222
While this returns an instance of ``CodeIgniter\Test\Mock\MockCache`` that you can use directly, it also inserts the
2323
mock into the Service class, so any calls within your code to ``service('cache')`` or ``Config\Services::cache()`` will
@@ -33,7 +33,7 @@ You can instruct the mocked cache handler to never do any caching with the ``byp
3333
using the dummy handler and ensures that your test does not rely on cached data for your tests.
3434
::
3535

36-
$mock = mock(CodeIgniter\Cache\CacheFactory::class);
36+
$mock = mock(\CodeIgniter\Cache\CacheFactory::class);
3737
// Never cache any items during this test.
3838
$mock->bypass();
3939

@@ -43,7 +43,7 @@ Available Assertions
4343
The following new assertions are available on the mocked class for using during testing:
4444
::
4545

46-
$mock = mock(CodeIgniter\Cache\CacheFactory::class);
46+
$mock = mock(\CodeIgniter\Cache\CacheFactory::class);
4747

4848
// Assert that a cached item named $key exists
4949
$mock->assertHas($key);

0 commit comments

Comments
 (0)