![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/dev/tests/integration/testsuite/Magento/Framework/Validator/ |
<?php /** * Integration test for \Magento\Framework\Validator\Factory * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\Validator; class FactoryTest extends \PHPUnit\Framework\TestCase { /** * Test creation of validator config * * @magentoAppIsolation enabled */ public function testGetValidatorConfig() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); /** @var \Magento\Framework\Validator\Factory $factory */ $factory = $objectManager->get(\Magento\Framework\Validator\Factory::class); $this->assertInstanceOf(\Magento\Framework\Validator\Config::class, $factory->getValidatorConfig()); // Check that default translator was set $translator = \Magento\Framework\Validator\AbstractValidator::getDefaultTranslator(); $this->assertInstanceOf(\Magento\Framework\Translate\AdapterInterface::class, $translator); $this->assertEquals('Message', new \Magento\Framework\Phrase('Message')); $this->assertEquals('Message', $translator->translate('Message')); $this->assertEquals( 'Message with "placeholder one" and "placeholder two"', (string)new \Magento\Framework\Phrase('Message with "%1" and "%2"', ['placeholder one', 'placeholder two']) ); } }