1 | <?php |
||
5 | use Page; |
||
6 | use SilverStripe\CMS\Model\SiteTree; |
||
7 | use SilverStripe\Dev\SapphireTest; |
||
8 | use SilverStripe\Security\Member; |
||
9 | use SilverStripe\SiteConfig\SiteConfig; |
||
10 | use SilverStripe\Translatable\Model\Translatable; |
||
11 | |||
12 | /** |
||
13 | * @package translatable |
||
14 | */ |
||
15 | class TranslatableSiteConfigTest extends SapphireTest |
||
16 | { |
||
17 | protected static $fixture_file = 'TranslatableSiteConfigTest.yml'; |
||
18 | |||
19 | protected static $required_extensions = [ |
||
20 | SiteTree::class => [Translatable::class], |
||
21 | SiteConfig::class => [Translatable::class], |
||
22 | ]; |
||
23 | |||
24 | protected static $illegal_extensions = [ |
||
25 | // @todo: Update namespace to match subsites |
||
26 | SiteTree::class => array('SiteTreeSubsites') |
||
27 | ]; |
||
28 | |||
29 | private $origLocale; |
||
30 | |||
31 | protected function setUp() |
||
38 | |||
39 | protected function tearDown() |
||
46 | |||
47 | public function testCurrentCreatesDefaultForLocale() |
||
64 | |||
65 | public function testCanEditTranslatedRootPages() |
||
66 | { |
||
67 | $configEn = $this->objFromFixture(SiteConfig::class, 'en_US'); |
||
|
|||
68 | $configDe = $this->objFromFixture(SiteConfig::class, 'de_DE'); |
||
69 | |||
80 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.