Completed
Push — 3.x ( 839353...0c5d0b )
by Grégoire
02:14
created

FilterWithQueryBuilderTest::setUp()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 19
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 24
rs 8.9713
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\DoctrineMongoDBAdminBundle\Tests\Filter;
13
14
abstract class FilterWithQueryBuilderTest extends \PHPUnit_Framework_TestCase
15
{
16
    private $queryBuilder = null;
17
    private $expr = null;
18
19
    public function setUp()
20
    {
21
        $this->queryBuilder = $this->getMockBuilder('Doctrine\ODM\MongoDB\Query\Builder')
22
                ->disableOriginalConstructor()
23
                ->getMock();
24
        $this->queryBuilder
25
                ->expects($this->any())
26
                ->method('field')
27
                ->will($this->returnSelf())
28
        ;
29
        $this->expr = $this->getMockBuilder('Doctrine\ODM\MongoDB\Query\Expr')
30
            ->disableOriginalConstructor()
31
            ->getMock();
32
        $this->expr
33
            ->expects($this->any())
34
            ->method('field')
35
            ->will($this->returnSelf())
36
        ;
37
        $this->queryBuilder
38
            ->expects($this->any())
39
            ->method('expr')
40
            ->will($this->returnValue($this->expr))
41
        ;
42
    }
43
44
    protected function getQueryBuilder()
45
    {
46
        return $this->queryBuilder;
47
    }
48
}
49