Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Cleanup tests #1514

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions Tests/Functional/Parser/ScssParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Parser;

use BK2K\BootstrapPackage\Service\CompileService;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\ExpectationFailedException;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\EventDispatcher\NoopEventDispatcher;
Expand Down Expand Up @@ -55,10 +57,8 @@ protected static function assertFileContains(string $filename, string $needle):
}
}

/**
* @test
* @dataProvider scssParserCanCompileTestDataProvider
*/
#[DataProvider('scssParserCanCompileTestDataProvider')]
#[Test]
public function scssParserCanCompileTest(string $inputFile): void
{
$request = $this->buildRequest();
Expand All @@ -83,9 +83,7 @@ public static function scssParserCanCompileTestDataProvider(): array
];
}

/**
* @test
*/
#[Test]
public function urlsAreRelativeToTempTest(): void
{
$request = $this->buildRequest();
Expand All @@ -98,15 +96,13 @@ public function urlsAreRelativeToTempTest(): void
);
}

/**
* @test
* @dataProvider scssParserCanCompileTestDataProvider
*/
public function sourceMapsAreIncluded(string $file): void
#[DataProvider('scssParserCanCompileTestDataProvider')]
#[Test]
public function sourceMapsAreIncluded(string $inputFile): void
{
$request = $this->buildRequest('plugin.tx_bootstrappackage.settings.cssSourceMapping = 1');
$compileService = GeneralUtility::makeInstance(CompileService::class);
$compiledFile = $compileService->getCompiledFile($request, $file);
$compiledFile = $compileService->getCompiledFile($request, $inputFile);
$mapFile = $compiledFile . '.map';

self::assertFileExists(Environment::getPublicPath() . '/' . $mapFile);
Expand All @@ -118,7 +114,8 @@ protected function buildRequest(string $typoScriptString = ''): ServerRequest
$request = new ServerRequest();
$lineStream = (new LossyTokenizer())->tokenize($typoScriptString);
$typoScriptAst = (new AstBuilder(new NoopEventDispatcher()))->build($lineStream, new RootNode());
$typoScriptAttribute = new FrontendTypoScript(new RootNode(), []);
/** @phpstan-ignore-next-line */
$typoScriptAttribute = new FrontendTypoScript(new RootNode(), [], [], []);
$typoScriptAttribute->setSetupTree($typoScriptAst);
$typoScriptAttribute->setSetupArray($typoScriptAst->toArray());
$request = $request->withAttribute('frontend.typoscript', $typoScriptAttribute);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\AccordionContentElementUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class AccordionContentElementUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new AccordionContentElementUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new AccordionContentElementUpdate();
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Updates/AccordionMediaOrientUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\AccordionMediaOrientUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class AccordionMediaOrientUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new AccordionMediaOrientUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new AccordionMediaOrientUpdate();
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Updates/BackendLayoutUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\BackendLayoutUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class BackendLayoutUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new BackendLayoutUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new BackendLayoutUpdate();
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Updates/BulletContentElementUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\BulletContentElementUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class BulletContentElementUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new BulletContentElementUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new BulletContentElementUpdate();
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Updates/CarouselContentElementUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\CarouselContentElementUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class CarouselContentElementUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new CarouselContentElementUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new CarouselContentElementUpdate();
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Updates/CarouselItemLayoutUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\CarouselItemLayoutUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class CarouselItemLayoutUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new CarouselItemLayoutUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new CarouselItemLayoutUpdate();
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Updates/CarouselItemTypeUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\CarouselItemTypeUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class CarouselItemTypeUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new CarouselItemTypeUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new CarouselItemTypeUpdate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\ExternalMediaContentElementUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class ExternalMediaContentElementUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new ExternalMediaContentElementUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new ExternalMediaContentElementUpdate();
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Updates/FrameClassToBackgroundUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\FrameClassToBackgroundUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class FrameClassToBackgroundUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new FrameClassToBackgroundUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new FrameClassToBackgroundUpdate();
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Updates/FrameClassToOptionsUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\FrameClassToOptionsUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -28,18 +29,14 @@ final class FrameClassToOptionsUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new FrameClassToOptionsUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$subject = new FrameClassToOptionsUpdate();
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Updates/FrameClassUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace BK2K\BootstrapPackage\Tests\Functional\Updates;

use BK2K\BootstrapPackage\Updates\FrameClassUpdate;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
Expand All @@ -30,18 +31,14 @@ final class FrameClassUpdateTest extends FunctionalTestCase
'typo3conf/ext/bootstrap_package'
];

/**
* @test
*/
#[Test]
public function noUpdateNecessaryTest(): void
{
$subject = new FrameClassUpdate();
self::assertFalse($subject->updateNecessary());
}

/**
* @test
*/
#[Test]
public function updateTest(): void
{
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
Expand Down
Loading
Loading