[TASK] Change $fixture to $subject in unit-tests
[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 /**
18 * Testcase for TYPO3\CMS\Frontend\MediaWizard\MediaWizardProvider
19 *
20 * @author Sebastian Fischer <typo3@marketing-factory.de>
21 */
22 class MediaWizardProviderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
23
24 /**
25 * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Frontend\MediaWizard\MediaWizardProvider
26 */
27 protected $subject;
28
29 /**
30 * Setup
31 */
32 protected function setUp() {
33 $this->subject = $this->getAccessibleMock(\TYPO3\CMS\Frontend\MediaWizard\MediaWizardProvider::class, array('dummy'), array(), '', FALSE);
34 }
35
36 /**
37 * @return array
38 */
39 public function process_youtubeDataProvider() {
40 return array(
41 'http://youtu.be/2PMeCSQ--08' => array(
42 'http://youtu.be/2PMeCSQ--08',
43 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
44 ),
45 'http://www.youtube.com/embed/2PMeCSQ--08' => array(
46 'http://www.youtube.com/embed/2PMeCSQ--08',
47 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
48 ),
49 'http://www.youtube.com/watch?v=2PMeCSQ--08' => array(
50 'http://www.youtube.com/watch?v=2PMeCSQ--08',
51 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
52 ),
53 'http://www.youtube.com/?v=2PMeCSQ--08' => array(
54 'http://www.youtube.com/?v=2PMeCSQ--08',
55 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
56 ),
57 'http://www.youtube.com/v/2PMeCSQ--08' => array(
58 'http://www.youtube.com/v/2PMeCSQ--08',
59 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
60 ),
61 'http://www.youtube.com/e/2PMeCSQ--08' => array(
62 'http://www.youtube.com/e/2PMeCSQ--08',
63 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
64 ),
65 'http://www.youtube.com/watch?feature=player_embedded&v=2PMeCSQ--08' => array(
66 'http://www.youtube.com/watch?feature=player_embedded&v=2PMeCSQ--08',
67 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
68 ),
69 'http://www.youtube.com/watch?v=2PMeCSQ--08&list=PLGWGc5dfbzn_pvtJg7XskLva9XZpNTI88' => array(
70 'http://www.youtube.com/watch?v=2PMeCSQ--08&list=PLGWGc5dfbzn_pvtJg7XskLva9XZpNTI88',
71 'http://www.youtube.com/v/2PMeCSQ--08?fs=1'
72 ),
73 );
74 }
75
76 /**
77 * Test for process youtube
78 *
79 * @param string $url
80 * @param string $expected
81 * @return void
82 * @dataProvider process_youtubeDataProvider
83 * @test
84 */
85 public function process_youtube($url, $expected) {
86 $result = $this->subject->_call('process_youtube', $url);
87 $this->assertEquals($expected, $result);
88 }
89
90 }