Completed
Push — master ( 8c0a67...1fafee )
by Grégoire
9s
created

FeatureMediaBlockServiceTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 14 1
A testDefaultSettings() 0 19 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\MediaBundle\Tests\Block;
13
14
use Sonata\BlockBundle\Test\AbstractBlockServiceTestCase;
15
use Sonata\MediaBundle\Block\FeatureMediaBlockService;
16
17
class FeatureMediaBlockServiceTest extends AbstractBlockServiceTestCase
18
{
19
    protected $container;
20
    private $galleryManager;
21
    private $blockService;
22
23
    protected function setUp()
24
    {
25
        parent::setUp();
26
27
        $this->container = $this->prophesize('Symfony\Component\DependencyInjection\ContainerInterface');
28
        $this->galleryManager = $this->prophesize('Sonata\MediaBundle\Model\GalleryManagerInterface');
29
30
        $this->blockService = new FeatureMediaBlockService(
31
            'block.service',
32
            $this->templating,
33
            $this->container->reveal(),
34
            $this->galleryManager->reveal()
35
        );
36
    }
37
38
    public function testDefaultSettings()
39
    {
40
        $blockContext = $this->getBlockContext($this->blockService);
41
42
        $this->assertSettings(array(
43
            'attr' => array(),
44
            'content' => false,
45
            'context' => false,
46
            'extra_cache_keys' => array(),
47
            'format' => false,
48
            'media' => false,
49
            'mediaId' => null,
50
            'orientation' => 'left',
51
            'template' => 'SonataMediaBundle:Block:block_feature_media.html.twig',
52
            'title' => false,
53
            'ttl' => 0,
54
            'use_cache' => true,
55
        ), $blockContext);
56
    }
57
}
58