Skip to content

Commit 759ad10

Browse files
committed
Remove horizontal scrollbar
| Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets |
1 parent d47f5f7 commit 759ad10

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cookbook/testing/database.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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())

0 commit comments

Comments
 (0)