Skip to content

Commit 114c8c6

Browse files
committed
fix constact synchronization bug
1 parent 49bcede commit 114c8c6

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/Event/Dispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function dispatch(string $category, string $endpoint, Variables $variable
6060

6161
private function check(string $category, string $endpoint, Variables $variables): bool
6262
{
63-
$variables['contact_synchronize'] = $this->settings->load('main:synchronize') ?? 'all';
63+
$variables['contact_synchronize'] = $this->settings->load('main:synchronization') ?? 'all';
6464
$variables['contact_address_preference'] = $this->settings->load('main:address_preference') ?? 'delivery';
6565

6666
if ($variables['contact_synchronize'] === 'all')

tests/Event/DispatcherTest.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DispatcherTest extends TestCase
2525

2626
$dispatcher = new Dispatcher($settings = Mockery::mock(Settings::class), Mockery::mock(Hook::class), $loader = Mockery::mock(Loader::class));
2727
$loader->shouldReceive('load')->with($variables, [])->once();
28-
$settings->shouldReceive('load')->with('main:synchronize')->once()->andReturn('all');
28+
$settings->shouldReceive('load')->with('main:synchronization')->once()->andReturn('all');
2929
$settings->shouldReceive('load')->with('main:address_preference')->once()->andReturn('invoice');
3030
$settings->shouldReceive('load')->with('main:dispatcher')->once()->andReturn('cron');
3131
$settings->shouldReceive('set')->with(Mockery::on(function (string $key): bool
@@ -53,7 +53,7 @@ class DispatcherTest extends TestCase
5353

5454
$dispatcher = new Dispatcher($settings = Mockery::mock(Settings::class), Mockery::mock(Hook::class), $loader = Mockery::mock(Loader::class));
5555
$loader->shouldReceive('load')->with($variables, [])->once();
56-
$settings->shouldReceive('load')->with('main:synchronize')->once()->andReturn('all');
56+
$settings->shouldReceive('load')->with('main:synchronization')->once()->andReturn('all');
5757
$settings->shouldReceive('load')->with('main:address_preference')->once()->andReturn('delivery');
5858
$settings->shouldReceive('load')->with('main:dispatcher')->once()->andReturn('asset');
5959
$settings->shouldReceive('set')->with(Mockery::on(function (string $key): bool
@@ -75,7 +75,7 @@ class DispatcherTest extends TestCase
7575

7676
$dispatcher = new Dispatcher($settings = Mockery::mock(Settings::class), $hook = Mockery::mock(Hook::class), $loader = Mockery::mock(Loader::class));
7777
$loader->shouldReceive('load')->with($variables, [])->once();
78-
$settings->shouldReceive('load')->with('main:synchronize')->once()->andReturn('all');
78+
$settings->shouldReceive('load')->with('main:synchronization')->once()->andReturn('all');
7979
$settings->shouldReceive('load')->with('main:address_preference')->once()->andReturnNull();
8080
$settings->shouldReceive('load')->with('main:dispatcher')->once()->andReturn('direct');
8181
$hook->shouldReceive('dispatch')->with('order', 'new', ['contact_synchronize' => 'all', 'contact_address_preference' => 'delivery'])->once();
@@ -92,7 +92,7 @@ class DispatcherTest extends TestCase
9292

9393
$dispatcher = new Dispatcher($settings = Mockery::mock(Settings::class), $hook = Mockery::mock(Hook::class), $loader = Mockery::mock(Loader::class));
9494
$loader->shouldReceive('load')->with($variables, ['ok'])->once();
95-
$settings->shouldReceive('load')->with('main:synchronize')->once()->andReturn('message');
95+
$settings->shouldReceive('load')->with('main:synchronization')->once()->andReturn('message');
9696
$settings->shouldReceive('load')->with('main:address_preference')->once()->andReturn('invoice');
9797
$settings->shouldReceive('load')->with('main:dispatcher')->once()->andReturn('direct');
9898
$settings->shouldReceive('load')->with('main:language_mutation')->once()->andReturn('1');
@@ -113,7 +113,7 @@ class DispatcherTest extends TestCase
113113

114114
$dispatcher = new Dispatcher($settings = Mockery::mock(Settings::class), $hook = Mockery::mock(Hook::class), $loader = Mockery::mock(Loader::class));
115115
$loader->shouldReceive('load')->with($variables, [])->once();
116-
$settings->shouldReceive('load')->with('main:synchronize')->once()->andReturn('off');
116+
$settings->shouldReceive('load')->with('main:synchronization')->once()->andReturn('off');
117117
$settings->shouldReceive('load')->with('main:address_preference')->once()->andReturnNull();
118118
$settings->shouldReceive('load')->with('main:dispatcher')->once()->andReturn('direct');
119119
$settings->shouldReceive('load')->with('main:language_mutation')->once()->andReturn('1');
@@ -135,7 +135,7 @@ class DispatcherTest extends TestCase
135135

136136
$dispatcher = new Dispatcher($settings = Mockery::mock(Settings::class), $hook = Mockery::mock(Hook::class), $loader = Mockery::mock(Loader::class));
137137
$loader->shouldReceive('load')->with($variables, [])->once();
138-
$settings->shouldReceive('load')->with('main:synchronize')->once()->andReturn('message');
138+
$settings->shouldReceive('load')->with('main:synchronization')->once()->andReturn('message');
139139
$settings->shouldReceive('load')->with('main:address_preference')->once()->andReturnNull();
140140
$settings->shouldReceive('load')->with('main:dispatcher')->once()->andReturn('direct');
141141
$settings->shouldReceive('load')->with('main:language_mutation')->once()->andReturnNull();
@@ -156,7 +156,7 @@ class DispatcherTest extends TestCase
156156

157157
$dispatcher = new Dispatcher($settings = Mockery::mock(Settings::class), Mockery::mock(Hook::class), $loader = Mockery::mock(Loader::class));
158158
$loader->shouldReceive('load')->with($variables, [])->once();
159-
$settings->shouldReceive('load')->with('main:synchronize')->once()->andReturn('specific');
159+
$settings->shouldReceive('load')->with('main:synchronization')->once()->andReturn('specific');
160160
$settings->shouldReceive('load')->with('main:address_preference')->once()->andReturnNull();
161161
$settings->shouldReceive('load')->with('main:language_mutation')->once()->andReturnNull();
162162
$settings->shouldReceive('load')->with('admin_sms-default-0:return_new')->once()->andReturnNull();

tests/User/SignTest.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ use function json_encode;
1414

1515
require_once __DIR__ . '/../bootstrap.php';
1616

17+
/**
18+
* @testCase
19+
*/
1720
class SignTest extends TestCase
1821
{
1922
public function testAuthenticate(): void

0 commit comments

Comments
 (0)