[TASK] Use name-resolution instead of strings where possible: 17
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Tests / Unit / MediaWizard / MediaWizardProviderTest.php
1 <?php
2 namespace TYPO3\CMS\Frontend\Tests\Unit\MediaWizard;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * Testcase for TYPO3\CMS\Frontend\MediaWizard\MediaWizardProvider
18 *
19 * @author Sebastian Fischer <typo3@marketing-factory.de>
20 */
21 class MediaWizardProviderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
22
23 /**
24 * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Frontend\MediaWizard\MediaWizardProvider
25 */
26 protected $fixture;
27
28 /**
29 * Setup
30 */
31 public function setUp() {
32 $this->fixture = $this->getAccessibleMock(\TYPO3\CMS\Frontend\MediaWizard\MediaWizardProvider::class, array('dummy'), array(), '', FALSE);
33 }
34
35 /**
36 * @return array
37 */
38 public function process_youtubeDataProvider() {
39 return array(
40 'http://youtu.be/2PMeCSQ--08' => array(
41 'http://youtu.be/2PMeCSQ--08',
42 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
43 ),
44 'http://www.youtube.com/embed/2PMeCSQ--08' => array(
45 'http://www.youtube.com/embed/2PMeCSQ--08',
46 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
47 ),
48 'http://www.youtube.com/watch?v=2PMeCSQ--08' => array(
49 'http://www.youtube.com/watch?v=2PMeCSQ--08',
50 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
51 ),
52 'http://www.youtube.com/?v=2PMeCSQ--08' => array(
53 'http://www.youtube.com/?v=2PMeCSQ--08',
54 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
55 ),
56 'http://www.youtube.com/v/2PMeCSQ--08' => array(
57 'http://www.youtube.com/v/2PMeCSQ--08',
58 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
59 ),
60 'http://www.youtube.com/e/2PMeCSQ--08' => array(
61 'http://www.youtube.com/e/2PMeCSQ--08',
62 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
63 ),
64 'http://www.youtube.com/watch?feature=player_embedded&v=2PMeCSQ--08' => array(
65 'http://www.youtube.com/watch?feature=player_embedded&v=2PMeCSQ--08',
66 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
67 ),
68 'http://www.youtube.com/watch?v=2PMeCSQ--08&list=PLGWGc5dfbzn_pvtJg7XskLva9XZpNTI88' => array(
69 'http://www.youtube.com/watch?v=2PMeCSQ--08&list=PLGWGc5dfbzn_pvtJg7XskLva9XZpNTI88',
70 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
71 ),
72 );
73 }
74
75 /**
76 * Test for process youtube
77 *
78 * @param string $url
79 * @param string $expected
80 * @return void
81 * @dataProvider process_youtubeDataProvider
82 * @test
83 */
84 public function process_youtube($url, $expected) {
85 $result = $this->fixture->_call('process_youtube', $url);
86 $this->assertEquals($expected, $result);
87 }
88 }