Skip to content

Commit

Permalink
OXDEV-8316 Make TrackerRepository readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
tkcreateit committed Oct 16, 2024
1 parent c4a50eb commit 1d0153c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$aModule = [
'id' => 'oe_moduletemplate',
'title' => 'OxidEsales Module Template (OEMT)',
'description' => '',
'description' => 'Reusable module template with examples for the most common use cases',
'thumbnail' => 'pictures/logo.png',
'version' => '3.0.0',
'author' => 'OXID eSales AG',
Expand Down
6 changes: 3 additions & 3 deletions src/Tracker/Repository/TrackerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
/**
* @extendable-class
*/
class TrackerRepository implements TrackerRepositoryInterface
readonly class TrackerRepository implements TrackerRepositoryInterface
{
public function __construct(
private readonly QueryBuilderFactoryInterface $queryBuilderFactory,
private readonly ContextInterface $context,
private QueryBuilderFactoryInterface $queryBuilderFactory,
private ContextInterface $context,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/Tracker/Service/TrackerServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use OxidEsales\ModuleTemplate\Greeting\Model\PersonalGreetingUserInterface;
use OxidEsales\ModuleTemplate\Greeting\Repository\GreetingRepositoryInterface;
use OxidEsales\ModuleTemplate\Tracker\Model\TrackerModel;
use OxidEsales\ModuleTemplate\Tracker\Repository\TrackerRepository;
use OxidEsales\ModuleTemplate\Tracker\Repository\TrackerRepositoryInterface;
use OxidEsales\ModuleTemplate\Tracker\Service\TrackerService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
Expand All @@ -34,7 +34,7 @@ public function testUpdateTrackerNoGreetingChange(): void
'getSavedUserGreeting' => self::TEST_GREETING
]);

$repo = $this->createPartialMock(TrackerRepository::class, ['getTrackerByUserId']);
$repo = $this->createPartialMock(TrackerRepositoryInterface::class, ['getTrackerByUserId']);
$repo->expects($this->never())->method('getTrackerByUserId');

$tracker = new TrackerService(
Expand All @@ -51,7 +51,7 @@ public function testUpdateTrackerGreetingChange(): void
'getSavedUserGreeting' => self::TEST_GREETING . ' with a change'
]);

$repo = $this->createConfiguredStub(TrackerRepository::class, [
$repo = $this->createConfiguredStub(TrackerRepositoryInterface::class, [
'getTrackerByUserId' => $trackerSpy = $this->createMock(TrackerModel::class)
]);
$trackerSpy->expects($this->once())->method('countUp');
Expand Down

0 comments on commit 1d0153c

Please sign in to comment.