Passed
Push — master ( 9280cd...76fe10 )
by Simon
02:08
created

QueryBase::testSetNumberDataSets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of
5
 * 
6
 * (c) symball <http://simonball.me>
7
 * 
8
 * For the full copyright and license information, please view the LICENSE file 
9
 * that was distributed with this source code.
10
 */
11
12
namespace Symball\ReportBundle\Service;
13
14
/**
15
 * Description of QueryBase
16
 *
17
 * @author Simon Ball <simonball at simonball dot me>
18
 */
19
class QueryBase {
20
    public function testSetNumberDataSets()
21
    {
22
        $query = new Query();
23
        $query->setNumberDataSets(2);
24
25
        $this->assertEquals(2, $query->getNumberDataSetCount());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<Symball\ReportBundle\Service\QueryBase>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
26
    }
27
    public function testSetInvalidNumberDataSets()
28
    {
29
        $query = new Query();
30
        $this->expectException(\InvalidArgumentException::class);
0 ignored issues
show
Bug introduced by
The method expectException() does not seem to exist on object<Symball\ReportBundle\Service\QueryBase>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
31
        $query->setNumberDataSets(0);
32
    }
33
    public function testSetErroneousNumberDataSets()
34
    {
35
        $query = new Query();
36
        $this->expectException(\InvalidArgumentException::class);
0 ignored issues
show
Bug introduced by
The method expectException() does not seem to exist on object<Symball\ReportBundle\Service\QueryBase>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
        $query->setNumberDataSets('this is not a number!');
38
    }
39
40
    public function testSetRepository()
41
    {
42
        $query = new Query();
43
44
        $mockRepository = $this->createMock(ObjectRepository::class);
0 ignored issues
show
Bug introduced by
The method createMock() does not seem to exist on object<Symball\ReportBundle\Service\QueryBase>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
45
        $query->setRepository($mockRepository);
46
47
        $this->assertEquals($mockRepository, $query->getRepository());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<Symball\ReportBundle\Service\QueryBase>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
48
    }
49
    public function testAddModifier()
50
    {
51
        $query = new Query();
52
53
        $options = ['value' => 'test_value', 'type' => 'equals'];
54
        $query->addModifier('test_field', $options);
55
56
        $this->assertEquals(['test_field' => $options], $query->getModifiers());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<Symball\ReportBundle\Service\QueryBase>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
57
    }
58
    public function testAddInvalidModifier()
59
    {
60
        $query = new Query();
61
        $this->expectException(\InvalidArgumentException::class);
0 ignored issues
show
Bug introduced by
The method expectException() does not seem to exist on object<Symball\ReportBundle\Service\QueryBase>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
62
        $query->addModifier('test_field');
63
    }
64
}
65