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

FilterWithQueryBuilderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 20 1
A getQueryBuilder() 0 4 1
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