Skip to content

Commit

Permalink
fixed page model unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ericges committed Feb 19, 2024
1 parent a7a32cd commit 474177a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/Helper/ConfigurationHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,12 @@ public function testGetPageModel()

$pageModelAdapter = $this->mockAdapter(['findByPk']);
$pageModelAdapter->method('findByPk')->willReturnCallback(function ($id) {
return match ($id) {
'3' => $this->mockClassWithProperties(PageModel::class, ['layoutId' => 3]),
default => null,
};
switch ($id) {
case '3':
return $this->mockClassWithProperties(PageModel::class, ['layoutId' => 3]);
default:
return null;
}
});

$contaoFramework = $this->mockContaoFramework([
Expand Down

0 comments on commit 474177a

Please sign in to comment.