Completed
Push — 3.x ( 486a75...bbeb6a )
by Jordi Sala
9s
created

FilterWithQueryBuilderTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 0
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
use Sonata\DoctrineMongoDBAdminBundle\Tests\Helpers\PHPUnit_Framework_TestCase;
15
16
abstract class FilterWithQueryBuilderTest extends PHPUnit_Framework_TestCase
17
{
18
    private $queryBuilder = null;
19
    private $expr = null;
20
21
    public function setUp()
22
    {
23
        $this->queryBuilder = $this->createMock('Doctrine\ODM\MongoDB\Query\Builder');
24
        $this->queryBuilder
25
                ->expects($this->any())
26
                ->method('field')
27
                ->will($this->returnSelf())
28
        ;
29
        $this->expr = $this->createMock('Doctrine\ODM\MongoDB\Query\Expr');
30
        $this->expr
31
            ->expects($this->any())
32
            ->method('field')
33
            ->will($this->returnSelf())
34
        ;
35
        $this->queryBuilder
36
            ->expects($this->any())
37
            ->method('expr')
38
            ->will($this->returnValue($this->expr))
39
        ;
40
    }
41
42
    protected function getQueryBuilder()
43
    {
44
        return $this->queryBuilder;
45
    }
46
}
47