Skip to content

Commit

Permalink
OXDEV-8207: Fix wrong static key and named arguments for data providers
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelOxid committed May 27, 2024
1 parent fab8d8b commit 1576a22
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions tests/Integration/Controller/GreetingControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ final class GreetingControllerTest extends IntegrationTestCase
/**
* @dataProvider providerOemtGreeting
*/
public function testUpdateGreeting(bool $hasUser, string $mode, string $expected, int $count): void
public function testUpdateGreeting(bool $hasUser, string $mode, string $expect, int $count): void
{
$moduleSettings = $this->getServiceFromContainer(ModuleSettings::class);
$moduleSettings->saveGreetingMode($mode);
$_POST[ModuleCore::OEMT_GREETING_TEMPLATE_VARNAME] = $expected;
$_POST[ModuleCore::OEMT_GREETING_TEMPLATE_VARNAME] = $expect;

$controller = oxNew(GreetingController::class);

Expand All @@ -53,7 +53,7 @@ public function testUpdateGreeting(bool $hasUser, string $mode, string $expected
/** @var ModuleUser $user */
$user = oxNew(EshopModelUser::class);
$user->load(self::TEST_USER_ID);
$this->assertSame($expected, $user->getPersonalGreeting());
$this->assertSame($expect, $user->getPersonalGreeting());

$tracker = $this->getServiceFromContainer(Repository::class)
->getTrackerByUserId(self::TEST_USER_ID);
Expand Down Expand Up @@ -83,19 +83,19 @@ public function testRender(bool $hasUser, string $mode, array $expected): void
$this->assertSame($expected['counter'], $viewData[ModuleCore::OEMT_COUNTER_TEMPLATE_VARNAME]);
}

public function providerOemtGreeting(): array
public static function providerOemtGreeting(): array
{
return [
'without_user_generic' => [
'hasUser' => false,
'mode' => ModuleSettings::GREETING_MODE_GENERIC,
'expected' => '',
'expect' => '',
'count' => 0,
],
'without_user_personal' => [
'hasUser' => false,
'mode' => ModuleSettings::GREETING_MODE_PERSONAL,
'expected' => '',
'expect' => '',
'count' => 0,
],
'with_user_generic' => [
Expand All @@ -113,7 +113,7 @@ public function providerOemtGreeting(): array
];
}

public function providerRender(): array
public static function providerRender(): array
{
return [
'without_user_generic' => [
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/Controller/StartControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testGetOemtGreeting(bool $hasUser, string $mode, $expect): void
);
}

public function providerCanUpdateOemtGreeting(): array
public static function providerCanUpdateOemtGreeting(): array
{
return [
'without_user_generic' => [
Expand All @@ -95,7 +95,7 @@ public function providerCanUpdateOemtGreeting(): array
];
}

public function providerGetOemtGreeting(): array
public static function providerGetOemtGreeting(): array
{
return [
'without_user_generic' => [
Expand Down

0 comments on commit 1576a22

Please sign in to comment.