10000 BAP-12113: Add functional test for command and entity repository · oro-subtree/EntityExtendBundle@a499bf9 · GitHub
[go: up one dir, main page]

Skip to content

Commit a499bf9

Browse files
author
Mykhailo Sulyma
committed
BAP-12113: Add functional test for command and entity repository
- CR fixes
1 parent aee00ae commit a499bf9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Tests/Unit/Tools/EnumSynchronizerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Oro\Bundle\EntityExtendBundle\Tests\Unit\Fixtures\TestEnumValue;
1414
use Oro\Bundle\EntityExtendBundle\Tools\EnumSynchronizer;
1515
use Oro\Bundle\EntityExtendBundle\Tools\ExtendHelper;
16-
use Oro\Bundle\TranslationBundle\Entity\Translation;
16+
use Oro\Bundle\TranslationBundle\Translation\Translator;
1717

1818
class EnumSynchronizerTest extends \PHPUnit_Framework_TestCase
1919
{
@@ -385,7 +385,7 @@ public function testApplyEnumNameTransNoTransForDefaultLocale()
385385
{
386386
$enumCode = 'test_enum';
387387
$enumName = 'Test Enum New';
388-
$locale = Translation::DEFAULT_LOCALE;
388+
$locale = Translator::DEFAULT_LOCALE;
389389

390390
$this->translator->expects($this->once())
391391
->method('trans')

Tools/EnumSynchronizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Oro\Bundle\EntityConfigBundle\Translation\ConfigTranslationHelper;
1717
use Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue;
1818
use Oro\Bundle\EntityExtendBundle\Entity\Repository\EnumValueRepository;
19-
use Oro\Bundle\TranslationBundle\Entity\Translation;
19+
use Oro\Bundle\TranslationBundle\Translation\Translator;
2020

2121
/**
2222
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
@@ -90,7 +90,7 @@ public function sync()
9090
$enumOptions = $enumFieldConfig->get('enum_options');
9191

9292
if (empty($locale)) {
93-
$locale = Translation::DEFAULT_LOCALE;
93+
$locale = Translator::DEFAULT_LOCALE;
9494
}
9595

9696
if (!empty($enumName)) {
@@ -140,7 +140,7 @@ public function applyEnumNameTrans($enumCode, $enumName, $locale)
140140
// labels initialization
141141
$labelsToBeUpdated[$labelKey] = $enumName;
142142
$labelsToBeUpdated[$pluralLabelKey] = $enumName;
143-
if ($locale === Translation::DEFAULT_LOCALE) {
143+
if ($locale === Translator::DEFAULT_LOCALE) {
144144
// set empty description only for default locale
145145
$labelsToBeUpdated[$descriptionKey] = '';
146146
}
@@ -237,7 +237,7 @@ public function applyEnumOptions($enumValueClassName, array $options, $locale)
237237
}
238238

239239
if (!empty($changes)) {
240-
if ($locale !== Translation::DEFAULT_LOCALE) {
240+
if ($locale !== Translator::DEFAULT_LOCALE) {
241241
foreach ($changes as $value) {
242242
$value->setLocale($locale);
243243
}

0 commit comments

Comments
 (0)
0