TYPO3 CMS  TYPO3_7-6
TableFlexFormToTtContentFieldsUpdateTest.php
Go to the documentation of this file.
1 <?php
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 
23 
28 {
33 
37  protected $dbProphecy;
38 
42  protected $updateWizard;
43 
44  protected function setUp()
45  {
46  unset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']);
47  $this->packageManagerProphecy = $this->prophesize(\TYPO3\CMS\Core\Package\PackageManager::class);
48  $this->dbProphecy = $this->prophesize(\TYPO3\CMS\Core\Database\DatabaseConnection::class);
49  $GLOBALS['TYPO3_DB'] = $this->dbProphecy->reveal();
50  $this->updateWizard = new UpdateWizard();
51  ExtensionManagementUtility::setPackageManager($this->packageManagerProphecy->reveal());
52  }
53 
54  protected function tearDown()
55  {
57  }
58 
64  {
65  $this->packageManagerProphecy->isPackageActive('css_styled_content')->willReturn(true);
66  $this->dbProphecy->exec_SELECTcountRows(Argument::cetera())->willReturn(0);
67 
68  $description = '';
69  $this->assertFalse($this->updateWizard->checkForUpdate($description));
70  }
71 
77  {
78  $this->packageManagerProphecy->isPackageActive('css_styled_content')->willReturn(true);
79  $this->dbProphecy->exec_SELECTcountRows(Argument::cetera())->willReturn(1);
80 
81  $description = '';
82  $this->assertFalse($this->updateWizard->checkForUpdate($description));
83  }
84 
90  {
91  $this->packageManagerProphecy->isPackageActive('css_styled_content')->willReturn(false);
92  $this->dbProphecy->exec_SELECTcountRows(Argument::cetera())->willReturn(1);
93 
94  $description = '';
95  $this->assertTrue($this->updateWizard->checkForUpdate($description));
96  }
97 }
static setPackageManager(PackageManager $packageManager)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']