Completed
Push — master ( 30bfa2...7adf0d )
by Bukashk0zzz
02:13
created

FilterTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the FilterBundle
5
 *
6
 * (c) Denis Golubovskiy <[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 Bukashk0zzz\FilterBundle\Tests\Service;
13
14
use Bukashk0zzz\FilterBundle\Service\Filter;
15
use Doctrine\Common\Annotations\AnnotationReader;
16
use Doctrine\Common\Annotations\CachedReader;
17
use Doctrine\Common\Cache\ArrayCache;
18
19
/**
20
 * Test the FilterTest
21
 *
22
 * @author Denis Golubovskiy <[email protected]>
23
 *
24
 */
25
class FilterTest extends \PHPUnit_Framework_TestCase
26
{
27
    /**
28
     * @var Filter
29
     */
30
    protected $filter;
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    protected function setUp()
36
    {
37
        $this->filter = new Filter(new CachedReader(new AnnotationReader(), new ArrayCache()));
38
    }
39
40
    /**
41
     * Service init test
42
     */
43
    public function testWrapper()
44
    {
45
        //check if instance
46
        static::assertInstanceOf('Bukashk0zzz\FilterBundle\Service\Filter', $this->filter);
47
    }
48
49
    /**
50
     * Test Filter With Object that null
51
     * @throws \Zend\Filter\Exception\RuntimeException If filtering $value is impossible
52
     * @throws \Zend\Filter\Exception\InvalidArgumentException
53
     * @throws \InvalidArgumentException
54
     */
55
    public function testFilterWithNullObject()
56
    {
57
        $this->filter->filterEntity(null);
58
    }
59
}
60