Skip to content

Commit

Permalink
OXDEV-7733 Cleanup test names and move to correct directories
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Fedurtsya <[email protected]>
  • Loading branch information
Sieg committed Apr 12, 2024
1 parent 94e2b3c commit 927342f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use OxidEsales\ModuleTemplate\Greeting\Repository\GreetingRepositoryInterface;
use OxidEsales\ModuleTemplate\Tests\Integration\IntegrationTestCase;

class RepositoryTest extends IntegrationTestCase
class GreetingRepositoryTest extends IntegrationTestCase
{
public const TEST_USER_ID = '_testuser';
public const TEST_GREETING = 'Hi there';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

declare(strict_types=1);

namespace OxidEsales\ModuleTemplate\Tests\Integration\Tracker;
namespace OxidEsales\ModuleTemplate\Tests\Integration\Tracker\Repository;

use OxidEsales\ModuleTemplate\Model\GreetingTracker;
use OxidEsales\ModuleTemplate\Tests\Integration\IntegrationTestCase;
use OxidEsales\ModuleTemplate\Tracker\Repository\TrackerRepositoryInterface;

final class RepositoryTest extends IntegrationTestCase
final class TrackerRepositoryTest extends IntegrationTestCase
{
public const TEST_TRACKER_ID = '_testoxid';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ final class TrackerServiceTest extends IntegrationTestCase

public function testUpdateTrackerNoGreetingChange(): void
{
$greetingRepository = $this->createStub(GreetingRepositoryInterface::class);
$greetingRepository->method('getSavedUserGreeting')->willReturn(self::TEST_GREETING);
$greetingRepository = $this->createConfiguredStub(GreetingRepositoryInterface::class, [
'getSavedUserGreeting' => self::TEST_GREETING
]);

$repo = $this->createPartialMock(TrackerRepository::class, ['getTrackerByUserId']);
$repo->expects($this->never())->method('getTrackerByUserId');
Expand All @@ -43,8 +44,9 @@ public function testUpdateTrackerNoGreetingChange(): void

public function testUpdateTrackerGreetingChange(): void
{
$greetingRepository = $this->createStub(GreetingRepositoryInterface::class);
$greetingRepository->method('getSavedUserGreeting')->willReturn(self::TEST_GREETING . ' with a change');
$greetingRepository = $this->createConfiguredStub(GreetingRepositoryInterface::class, [
'getSavedUserGreeting' => self::TEST_GREETING . ' with a change'
]);

$repo = $this->createPartialMock(TrackerRepository::class, ['getTrackerByUserId']);
$repo->expects($this->once())->method('getTrackerByUserId')->willReturn($this->getGreetingTrackerMock());
Expand All @@ -66,7 +68,7 @@ private function getUserModel(): EshopModelUser
$user = oxNew(EshopModelUser::class);
$user->assign(
[
'oxid' => self::TEST_USER_ID,
'oxid' => self::TEST_USER_ID,
'oemtgreeting' => self::TEST_GREETING,
]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

declare(strict_types=1);

namespace OxidEsales\ModuleTemplate\Tests\Unit\Service;
namespace OxidEsales\ModuleTemplate\Tests\Unit\Greeting\Service;

use OxidEsales\Eshop\Core\Request as CoreRequest;
use OxidEsales\ModuleTemplate\Core\Module as ModuleCore;
Expand Down

0 comments on commit 927342f

Please sign in to comment.