-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Add tests for update scripts (#1388)
- Loading branch information
1 parent
d08447a
commit 2fbfd0c
Showing
60 changed files
with
1,287 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
Tests/Functional/Updates/AccordionContentElementUpdateTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; | ||
|
||
use BK2K\BootstrapPackage\Updates\AccordionContentElementUpdate; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
/** | ||
* @extensionScannerIgnoreFile | ||
*/ | ||
final class AccordionContentElementUpdateTest extends FunctionalTestCase | ||
{ | ||
protected array $testExtensionsToLoad = [ | ||
'typo3conf/ext/bootstrap_package' | ||
]; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function noUpdateNecessaryTest(): void | ||
{ | ||
$subject = new AccordionContentElementUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function updateTest(): void | ||
{ | ||
$subject = new AccordionContentElementUpdate(); | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/AccordionContentElementUpdate/Input.csv'); | ||
self::assertTrue($subject->updateNecessary()); | ||
$subject->executeUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/AccordionContentElementUpdate/Result.csv'); | ||
|
||
// Just ensure that running the upgrade again does not change anything | ||
$subject->executeUpdate(); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/AccordionContentElementUpdate/Result.csv'); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
Tests/Functional/Updates/AccordionMediaOrientUpdateTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; | ||
|
||
use BK2K\BootstrapPackage\Updates\AccordionMediaOrientUpdate; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
/** | ||
* @extensionScannerIgnoreFile | ||
*/ | ||
final class AccordionMediaOrientUpdateTest extends FunctionalTestCase | ||
{ | ||
protected array $testExtensionsToLoad = [ | ||
'typo3conf/ext/bootstrap_package' | ||
]; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function noUpdateNecessaryTest(): void | ||
{ | ||
$subject = new AccordionMediaOrientUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function updateTest(): void | ||
{ | ||
$subject = new AccordionMediaOrientUpdate(); | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/AccordionMediaOrientUpdate/Input.csv'); | ||
self::assertTrue($subject->updateNecessary()); | ||
$subject->executeUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/AccordionMediaOrientUpdate/Result.csv'); | ||
|
||
// Just ensure that running the upgrade again does not change anything | ||
$subject->executeUpdate(); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/AccordionMediaOrientUpdate/Result.csv'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; | ||
|
||
use BK2K\BootstrapPackage\Updates\BackendLayoutUpdate; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
/** | ||
* @extensionScannerIgnoreFile | ||
*/ | ||
final class BackendLayoutUpdateTest extends FunctionalTestCase | ||
{ | ||
protected array $testExtensionsToLoad = [ | ||
'typo3conf/ext/bootstrap_package' | ||
]; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function noUpdateNecessaryTest(): void | ||
{ | ||
$subject = new BackendLayoutUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function updateTest(): void | ||
{ | ||
$subject = new BackendLayoutUpdate(); | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/BackendLayoutUpdate/Input.csv'); | ||
self::assertTrue($subject->updateNecessary()); | ||
$subject->executeUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/BackendLayoutUpdate/Result.csv'); | ||
|
||
// Just ensure that running the upgrade again does not change anything | ||
$subject->executeUpdate(); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/BackendLayoutUpdate/Result.csv'); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
Tests/Functional/Updates/BulletContentElementUpdateTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; | ||
|
||
use BK2K\BootstrapPackage\Updates\BulletContentElementUpdate; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
/** | ||
* @extensionScannerIgnoreFile | ||
*/ | ||
final class BulletContentElementUpdateTest extends FunctionalTestCase | ||
{ | ||
protected array $testExtensionsToLoad = [ | ||
'typo3conf/ext/bootstrap_package' | ||
]; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function noUpdateNecessaryTest(): void | ||
{ | ||
$subject = new BulletContentElementUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function updateTest(): void | ||
{ | ||
$subject = new BulletContentElementUpdate(); | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/BulletContentElementUpdate/Input.csv'); | ||
self::assertTrue($subject->updateNecessary()); | ||
$subject->executeUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/BulletContentElementUpdate/Result.csv'); | ||
|
||
// Just ensure that running the upgrade again does not change anything | ||
$subject->executeUpdate(); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/BulletContentElementUpdate/Result.csv'); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
Tests/Functional/Updates/CarouselContentElementUpdateTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; | ||
|
||
use BK2K\BootstrapPackage\Updates\CarouselContentElementUpdate; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
/** | ||
* @extensionScannerIgnoreFile | ||
*/ | ||
final class CarouselContentElementUpdateTest extends FunctionalTestCase | ||
{ | ||
protected array $testExtensionsToLoad = [ | ||
'typo3conf/ext/bootstrap_package' | ||
]; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function noUpdateNecessaryTest(): void | ||
{ | ||
$subject = new CarouselContentElementUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function updateTest(): void | ||
{ | ||
$subject = new CarouselContentElementUpdate(); | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/CarouselContentElementUpdate/Input.csv'); | ||
self::assertTrue($subject->updateNecessary()); | ||
$subject->executeUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/CarouselContentElementUpdate/Result.csv'); | ||
|
||
// Just ensure that running the upgrade again does not change anything | ||
$subject->executeUpdate(); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/CarouselContentElementUpdate/Result.csv'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; | ||
|
||
use BK2K\BootstrapPackage\Updates\CarouselItemLayoutUpdate; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
/** | ||
* @extensionScannerIgnoreFile | ||
*/ | ||
final class CarouselItemLayoutUpdateTest extends FunctionalTestCase | ||
{ | ||
protected array $testExtensionsToLoad = [ | ||
'typo3conf/ext/bootstrap_package' | ||
]; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function noUpdateNecessaryTest(): void | ||
{ | ||
$subject = new CarouselItemLayoutUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function updateTest(): void | ||
{ | ||
$subject = new CarouselItemLayoutUpdate(); | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/CarouselItemLayoutUpdate/Input.csv'); | ||
self::assertTrue($subject->updateNecessary()); | ||
$subject->executeUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/CarouselItemLayoutUpdate/Result.csv'); | ||
|
||
// Just ensure that running the upgrade again does not change anything | ||
$subject->executeUpdate(); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/CarouselItemLayoutUpdate/Result.csv'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace T3G\AgencyPack\Blog\Tests\Functional\Updates; | ||
|
||
use BK2K\BootstrapPackage\Updates\CarouselItemTypeUpdate; | ||
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; | ||
|
||
/** | ||
* @extensionScannerIgnoreFile | ||
*/ | ||
final class CarouselItemTypeUpdateTest extends FunctionalTestCase | ||
{ | ||
protected array $testExtensionsToLoad = [ | ||
'typo3conf/ext/bootstrap_package' | ||
]; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function noUpdateNecessaryTest(): void | ||
{ | ||
$subject = new CarouselItemTypeUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function updateTest(): void | ||
{ | ||
$subject = new CarouselItemTypeUpdate(); | ||
$this->importCSVDataSet(__DIR__ . '/Fixtures/CarouselItemTypeUpdate/Input.csv'); | ||
self::assertTrue($subject->updateNecessary()); | ||
$subject->executeUpdate(); | ||
self::assertFalse($subject->updateNecessary()); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/CarouselItemTypeUpdate/Result.csv'); | ||
|
||
// Just ensure that running the upgrade again does not change anything | ||
$subject->executeUpdate(); | ||
$this->assertCSVDataSet(__DIR__ . '/Fixtures/CarouselItemTypeUpdate/Result.csv'); | ||
} | ||
} |
Oops, something went wrong.