1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AOE\Languagevisibility\Tests\Functional\Services; |
4
|
|
|
|
5
|
|
|
/*************************************************************** |
6
|
|
|
* Copyright notice |
7
|
|
|
* |
8
|
|
|
* Copyright (c) 2009, AOE media GmbH <[email protected]> |
9
|
|
|
* All rights reserved |
10
|
|
|
* |
11
|
|
|
* This script is part of the TYPO3 project. The TYPO3 project is |
12
|
|
|
* free software; you can redistribute it and/or modify |
13
|
|
|
* it under the terms of the GNU General Public License as published by |
14
|
|
|
* the Free Software Foundation; either version 2 of the License, or |
15
|
|
|
* (at your option) any later version. |
16
|
|
|
* |
17
|
|
|
* The GNU General Public License can be found at |
18
|
|
|
* http://www.gnu.org/copyleft/gpl.html. |
19
|
|
|
* |
20
|
|
|
* This script is distributed in the hope that it will be useful, |
21
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
22
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23
|
|
|
* GNU General Public License for more details. |
24
|
|
|
* |
25
|
|
|
* This copyright notice MUST APPEAR in all copies of the script! |
26
|
|
|
***************************************************************/ |
27
|
|
|
|
28
|
|
|
use AOE\Languagevisibility\Services\BeServices; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* This testcase is used to test the functionallity of the beservice |
32
|
|
|
* |
33
|
|
|
* {@inheritdoc} |
34
|
|
|
* |
35
|
|
|
* class.tx_visibilityBEService_testcase.php |
36
|
|
|
* |
37
|
|
|
* @author Timo Schmidt <[email protected]> |
38
|
|
|
* @copyright Copyright (c) 2009, AOE media GmbH <[email protected]> |
39
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License |
40
|
|
|
* @version $Id: class.tx_visibilityBEService_testcase.php $ |
41
|
|
|
* @date 23.06.2009 14:39:00 |
42
|
|
|
* @seetx_phpunit_database_testcase |
43
|
|
|
* @category testcase |
44
|
|
|
* @package TYPO3 |
45
|
|
|
* @subpackage languagevisibility |
46
|
|
|
* @access public |
47
|
|
|
*/ |
48
|
|
|
class VisibilityBeServiceTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase { |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var array |
52
|
|
|
*/ |
53
|
|
|
protected $coreExtensionsToLoad = array('version', 'workspaces'); |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var array |
57
|
|
|
*/ |
58
|
|
|
protected $testExtensionsToLoad = array('typo3conf/ext/languagevisibility'); |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* Simple test with a tt_content element and a translation. |
62
|
|
|
* The beService should return true, because an translation for |
63
|
|
|
* the element exists. |
64
|
|
|
* |
65
|
|
|
* @param void |
66
|
|
|
* @return void |
67
|
|
|
* @test |
68
|
|
|
*/ |
69
|
|
|
public function canDetectTranslationsInAnyLanguage() { |
70
|
|
|
$this->importDataSet(__DIR__ . '/../Fixtures/canDetectTranslationsInAnyLanguage.xml'); |
71
|
|
|
$hasTranslation = BeServices::hasTranslationInAnyLanguage(1, 'tt_content'); |
72
|
|
|
|
73
|
|
|
$this->assertTrue($hasTranslation, 'Determined no translations for a translated element'); |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|