File tree Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Expand file tree Collapse file tree 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.
3636 file in your directory. In that case, no worries! Just run
3737 ``php composer.phar require symfony/finder ``.
3838
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-
4539**3. ** Write your code!
4640
4741Once Composer has downloaded the component(s), all you need to do is include
@@ -51,7 +45,8 @@ immediately::
5145
5246 // File example: src/script.php
5347
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
5550 require_once __DIR__.'/../vendor/autoload.php';
5651
5752 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::
4848
4949 public function calculateTotalSalary($id)
5050 {
51- $employeeRepository = $this->entityManager->getRepository('AppBundle::Employee');
51+ $employeeRepository = $this->entityManager
52+ ->getRepository('AppBundle::Employee');
5253 $employee = $employeeRepository->find($id);
5354
5455 return $employee->getSalary() + $employee->getBonus();
@@ -74,15 +75,17 @@ it's easy to pass a mock object within a test::
7475 ->will($this->returnValue(1100));
7576
7677 // 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')
7880 ->disableOriginalConstructor()
7981 ->getMock();
8082 $employeeRepository->expects($this->once())
8183 ->method('find')
8284 ->will($this->returnValue($employee));
8385
8486 // 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')
8689 ->disableOriginalConstructor()
8790 ->getMock();
8891 $entityManager->expects($this->once())
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ the ``test`` environment)::
2121 {
2222 $client = static::createClient();
2323
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)
2526 $client->enableProfiler();
2627
2728 $crawler = $client->request('GET', '/hello/Fabien');
You can’t perform that action at this time.
0 commit comments