File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
user_guide_src/source/testing Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1717You 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
2222While this returns an instance of ``CodeIgniter\Test\Mock\MockCache `` that you can use directly, it also inserts the
2323mock 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
3333using 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
4343The 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);
You can’t perform that action at this time.
0 commit comments