Completed
Push — 2.x-dev-kit ( 971030 )
by
unknown
07:52
created

TwitterEmbedTweetBlockServiceTest::testBuildUri()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 1
Metric Value
c 3
b 1
f 1
dl 0
loc 16
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
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\SeoBundle\Block\Social\TwitterEmbedTweetBlockService;
15
16
class TwitterEmbedTweetBSTest extends TwitterEmbedTweetBlockService
17
{
18
    public function publicBuildUri($uriMatched, array $settings)
19
    {
20
        return $this->buildUri($uriMatched, $settings);
21
    }
22
}
23
24
/**
25
 * Class TwitterEmbedTweetBlockServiceTest.
26
 *
27
 *
28
 * @author Hugo Briand <[email protected]>
29
 */
30
class TwitterEmbedTweetBlockServiceTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
31
{
32
    public function testBuildUri()
33
    {
34
        $settings = array(
35
            'tweet' => 'tweeeeeeeet',
36
            'foo' => 'bar',
37
            'align' => 'bar',
38
        );
39
40
        $expected = sprintf('%s?%s', TwitterEmbedTweetBlockService::TWITTER_OEMBED_URI, 'align=bar&url=tweeeeeeeet');
41
42
        $blockService = new TwitterEmbedTweetBSTest('', $this->getMock('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface'));
43
        $this->assertEquals($expected, $blockService->publicBuildUri(true, $settings));
44
45
        $expected = sprintf('%s?%s', TwitterEmbedTweetBlockService::TWITTER_OEMBED_URI, 'align=bar&id=tweeeeeeeet');
46
        $this->assertEquals($expected, $blockService->publicBuildUri(false, $settings));
47
    }
48
}
49