| 148 |
lars |
1 |
.. index::
|
|
|
2 |
single: Installation
|
|
|
3 |
|
|
|
4 |
Installation
|
|
|
5 |
============
|
|
|
6 |
|
|
|
7 |
Mockery can be installed using Composer or by cloning it from its GitHub
|
|
|
8 |
repository. These two options are outlined below.
|
|
|
9 |
|
|
|
10 |
Composer
|
|
|
11 |
--------
|
|
|
12 |
|
|
|
13 |
You can read more about Composer on `getcomposer.org <https://getcomposer.org>`_.
|
|
|
14 |
To install Mockery using Composer, first install Composer for your project
|
|
|
15 |
using the instructions on the `Composer download page <https://getcomposer.org/download/>`_.
|
|
|
16 |
You can then define your development dependency on Mockery using the suggested
|
|
|
17 |
parameters below. While every effort is made to keep the master branch stable,
|
|
|
18 |
you may prefer to use the current stable version tag instead (use the
|
|
|
19 |
``@stable`` tag).
|
|
|
20 |
|
|
|
21 |
.. code-block:: json
|
|
|
22 |
|
|
|
23 |
{
|
|
|
24 |
"require-dev": {
|
|
|
25 |
"mockery/mockery": "dev-master"
|
|
|
26 |
}
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
To install, you then may call:
|
|
|
30 |
|
|
|
31 |
.. code-block:: bash
|
|
|
32 |
|
|
|
33 |
php composer.phar update
|
|
|
34 |
|
|
|
35 |
This will install Mockery as a development dependency, meaning it won't be
|
|
|
36 |
installed when using ``php composer.phar update --no-dev`` in production.
|
|
|
37 |
|
|
|
38 |
Other way to install is directly from composer command line, as below.
|
|
|
39 |
|
|
|
40 |
.. code-block:: bash
|
|
|
41 |
|
|
|
42 |
php composer.phar require --dev mockery/mockery
|
|
|
43 |
|
|
|
44 |
Git
|
|
|
45 |
---
|
|
|
46 |
|
|
|
47 |
The Git repository hosts the development version in its master branch. You can
|
|
|
48 |
install this using Composer by referencing ``dev-master`` as your preferred
|
|
|
49 |
version in your project's ``composer.json`` file as the earlier example shows.
|