Completed
Push — master ( 0aee86...2f233b )
by
unknown
06:42
created

TwitterEmbedTweetBSTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 7
rs 10
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\SeoBundle\Tests\Block\Social;
13
14
use Sonata\BlockBundle\Test\AbstractBlockServiceTestCase;
15
use Sonata\SeoBundle\Block\Social\TwitterEmbedTweetBlockService;
16
use Sonata\SeoBundle\Tests\Fixtures\Block\TwitterEmbedTweetBSTest;
17
18
/**
19
 * Class TwitterEmbedTweetBlockServiceTest.
20
 *
21
 * @author Hugo Briand <[email protected]>
22
 */
23
class TwitterEmbedTweetBlockServiceTest extends AbstractBlockServiceTestCase
24
{
25
    public function testBuildUri()
26
    {
27
        $settings = array(
28
            'tweet' => 'tweeeeeeeet',
29
            'foo' => 'bar',
30
            'align' => 'bar',
31
        );
32
33
        $expected = sprintf('%s?%s', TwitterEmbedTweetBlockService::TWITTER_OEMBED_URI, 'align=bar&url=tweeeeeeeet');
34
35
        $blockService = new TwitterEmbedTweetBSTest('', $this->getMock('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface'));
36
        $this->assertEquals($expected, $blockService->publicBuildUri(true, $settings));
37
38
        $expected = sprintf('%s?%s', TwitterEmbedTweetBlockService::TWITTER_OEMBED_URI, 'align=bar&id=tweeeeeeeet');
39
        $this->assertEquals($expected, $blockService->publicBuildUri(false, $settings));
40
    }
41
}
42