Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.118.140.120
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
1 /
vendor /
mockery /
mockery /
docs /
cookbook /
Delete
Unzip
Name
Size
Permission
Date
Action
big_parent_class.rst
1.63
KB
-rw-r--r--
2020-11-17 16:24
class_constants.rst
4.57
KB
-rw-r--r--
2020-11-17 16:24
default_expectations.rst
757
B
-rw-r--r--
2020-11-17 16:24
detecting_mock_objects.rst
394
B
-rw-r--r--
2020-11-17 16:24
index.rst
273
B
-rw-r--r--
2020-11-17 16:24
map.rst.inc
275
B
-rw-r--r--
2020-11-17 16:24
mockery_on.rst
2.98
KB
-rw-r--r--
2020-11-17 16:24
mocking_class_within_class.rst
4.31
KB
-rw-r--r--
2020-11-17 16:24
mocking_hard_dependencies.rst
4.37
KB
-rw-r--r--
2020-11-17 16:24
not_calling_the_constructor.rst
2.1
KB
-rw-r--r--
2020-11-17 16:24
Save
Rename
.. index:: single: Cookbook; Default Mock Expectations Default Mock Expectations ========================= Often in unit testing, we end up with sets of tests which use the same object dependency over and over again. Rather than mocking this class/object within every single unit test (requiring a mountain of duplicate code), we can instead define reusable default mocks within the test case's ``setup()`` method. This even works where unit tests use varying expectations on the same or similar mock object. How this works, is that you can define mocks with default expectations. Then, in a later unit test, you can add or fine-tune expectations for that specific test. Any expectation can be set as a default using the ``byDefault()`` declaration.