diff --git a/.gitignore b/.gitignore index ce9b802e..22d174ee 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ composer.lock # Build stuff .build/ +Build/.phpunit.result.cache node_modules/ var/ config/ diff --git a/Tests/Unit/Service/CommentServiceTest.php b/Tests/Unit/Service/CommentServiceTest.php index 4667accf..f3fa51f0 100644 --- a/Tests/Unit/Service/CommentServiceTest.php +++ b/Tests/Unit/Service/CommentServiceTest.php @@ -32,7 +32,7 @@ class CommentServiceTest extends UnitTestCase */ protected $commentService; - public function setUp() + public function initialize() { $GLOBALS['TSFE'] = $this->prophesize(TypoScriptFrontendController::class)->reveal(); $this->postRepositoryProphecy = $this->prophesize(PostRepository::class); @@ -46,6 +46,8 @@ public function setUp() */ public function inactiveCommentsReturnErrorOnAdd(): void { + $this->initialize(); + $post = new Post(); $post->_setProperty('uid', 1); $comment = new Comment(); @@ -59,6 +61,8 @@ public function inactiveCommentsReturnErrorOnAdd(): void */ public function activeCommentsWithoutModerationReturnSuccessOnAdd(): void { + $this->initialize(); + $post = new Post(); $post->_setProperty('uid', 1); $comment = new Comment(); @@ -76,6 +80,8 @@ public function activeCommentsWithoutModerationReturnSuccessOnAdd(): void */ public function activeCommentsWithModerationReturnModerationOnAdd(): void { + $this->initialize(); + $post = new Post(); $post->_setProperty('uid', 1); $comment = new Comment(); @@ -93,6 +99,8 @@ public function activeCommentsWithModerationReturnModerationOnAdd(): void */ public function commentGetsAddedToPost(): void { + $this->initialize(); + $post = new Post(); $post->_setProperty('uid', 1); $comment = new Comment(); @@ -110,6 +118,8 @@ public function commentGetsAddedToPost(): void */ public function postGetsUpdatedInDatabase(): void { + $this->initialize(); + $post = new Post(); $post->_setProperty('uid', 1); $comment = new Comment(); diff --git a/Tests/Unit/Service/MetaServiceTest.php b/Tests/Unit/Service/MetaServiceTest.php index 263d177b..d9769eaf 100644 --- a/Tests/Unit/Service/MetaServiceTest.php +++ b/Tests/Unit/Service/MetaServiceTest.php @@ -20,10 +20,7 @@ class MetaServiceTest extends UnitTestCase */ protected $metaService; - /** - * - */ - public function setUp() + public function initialize() { $this->metaService = MetaService::getInstance(); } @@ -52,6 +49,8 @@ public function metaDataDataProvider() : array */ public function ensureDataCanStoredInMetaService(string $key) { + $this->initialize(); + MetaService::set($key, $key); self::assertSame($key, MetaService::get($key)); }