File tree 3 files changed +10
-11
lines changed
3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,6 @@ whatever component you want.
36
36
file in your directory. In that case, no worries! Just run
37
37
``php composer.phar require symfony/finder ``.
38
38
39
- If you know you need a specific version of the library, add that to the command:
40
-
41
- .. code-block :: bash
42
-
43
- $ composer require symfony/finder
44
-
45
39
**3. ** Write your code!
46
40
47
41
Once Composer has downloaded the component(s), all you need to do is include
@@ -51,7 +45,8 @@ immediately::
51
45
52
46
// File example: src/script.php
53
47
54
- // update this to the path to the "vendor/" directory, relative to this file
48
+ // update this to the path to the "vendor/"
49
+ // directory, relative to this file
55
50
require_once __DIR__.'/../vendor/autoload.php';
56
51
57
52
use Symfony\Component\Finder\Finder;
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ Suppose the class you want to test looks like this::
48
48
49
49
public function calculateTotalSalary($id)
50
50
{
51
- $employeeRepository = $this->entityManager->getRepository('AppBundle::Employee');
51
+ $employeeRepository = $this->entityManager
52
+ ->getRepository('AppBundle::Employee');
52
53
$employee = $employeeRepository->find($id);
53
54
54
55
return $employee->getSalary() + $employee->getBonus();
@@ -74,15 +75,17 @@ it's easy to pass a mock object within a test::
74
75
->will($this->returnValue(1100));
75
76
76
77
// Now, mock the repository so it returns the mock of the employee
77
- $employeeRepository = $this->getMockBuilder('\Doctrine\ORM\EntityRepository')
78
+ $employeeRepository = $this
79
+ ->getMockBuilder('\Doctrine\ORM\EntityRepository')
78
80
->disableOriginalConstructor()
79
81
->getMock();
80
82
$employeeRepository->expects($this->once())
81
83
->method('find')
82
84
->will($this->returnValue($employee));
83
85
84
86
// Last, mock the EntityManager to return the mock of the repository
85
- $entityManager = $this->getMockBuilder('\Doctrine\Common\Persistence\ObjectManager')
87
+ $entityManager = $this
88
+ ->getMockBuilder('\Doctrine\Common\Persistence\ObjectManager')
86
89
->disableOriginalConstructor()
87
90
->getMock();
88
91
$entityManager->expects($this->once())
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ the ``test`` environment)::
21
21
{
22
22
$client = static::createClient();
23
23
24
- // Enable the profiler for the next request (it does nothing if the profiler is not available)
24
+ // Enable the profiler for the next request
25
+ // (it does nothing if the profiler is not available)
25
26
$client->enableProfiler();
26
27
27
28
$crawler = $client->request('GET', '/hello/Fabien');
You can’t perform that action at this time.
0 commit comments