Skip to content

Commit

Permalink
Merge branch '5.4' into 6.0
Browse files Browse the repository at this point in the history
* 5.4:
  [FrameworkBundle][HttpKernel] Add the ability to enable the profiler using a parameter
  [FrameworkBundle] Trigger deprecations on stderr instead of using trigger_deprecation call
  Add PhpStanExtractor
  [Messenger] allow processing messages in batches
  [Console] Fix backslash escaping in bash completion
  Add missing validators translation
  add suggestions for debug:firewall, debug:form, debug:messenger, debug:router
  [SecurityBundle] Deprecate not configuring explicitly a provider for custom_authenticators when there is more than one registered provider
  [Inflector] Fix inflector for "zombies"
  [Config] Add some cache on SelfCheckingResourceChecker
  fix AJAX request unit spacing
  fix ErrorExcception in CacheWarmerAggregate
  Prevent FormLoginAuthenticator from responding to requests that should be handled by JsonLoginAuthenticator
  Fix wait duration for fixed window policy
  Add exact command used to trigger invocation to the completion debug log
  [Translation] correctly handle intl domains with TargetOperation
  Allow using param as connection atribute in `*.event_subscriber` and `*.event_listener` tags
  • Loading branch information
derrabus committed Oct 30, 2021
2 parents 104d77d + 1bbbed9 commit 31fcc0c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Catalogue/TargetOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function processDomain(string $domain)
foreach ($this->source->all($domain) as $id => $message) {
if ($this->target->has($id, $domain)) {
$this->messages[$domain]['all'][$id] = $message;
$d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain;
$d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain;
$this->result->add([$id => $message], $d);
if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) {
$this->result->setMetadata($id, $keyMetadata, $d);
Expand Down
34 changes: 33 additions & 1 deletion Tests/Catalogue/TargetOperationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,45 @@ public function testGetResultWithMixedDomains()
{
$this->assertEquals(
new MessageCatalogue('en', [
'messages+intl-icu' => ['a' => 'old_a'],
'messages' => ['a' => 'old_a'],
]),
$this->createOperation(
new MessageCatalogue('en', ['messages' => ['a' => 'old_a']]),
new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'new_a']])
)->getResult()
);

$this->assertEquals(
new MessageCatalogue('en', [
'messages+intl-icu' => ['a' => 'old_a'],
]),
$this->createOperation(
new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'old_a']]),
new MessageCatalogue('en', ['messages' => ['a' => 'new_a']])
)->getResult()
);

$this->assertEquals(
new MessageCatalogue('en', [
'messages+intl-icu' => ['a' => 'old_a'],
'messages' => ['b' => 'new_b'],
]),
$this->createOperation(
new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'old_a']]),
new MessageCatalogue('en', ['messages' => ['a' => 'new_a', 'b' => 'new_b']])
)->getResult()
);

$this->assertEquals(
new MessageCatalogue('en', [
'messages' => ['a' => 'old_a'],
'messages+intl-icu' => ['b' => 'new_b'],
]),
$this->createOperation(
new MessageCatalogue('en', ['messages' => ['a' => 'old_a']]),
new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'new_a', 'b' => 'new_b']])
)->getResult()
);
}

public function testGetResultWithMetadata()
Expand Down

0 comments on commit 31fcc0c

Please sign in to comment.