/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Framework/Exception/NoSuchEntityExceptionTest.php
47 строк
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Copyright 2014 Adobe * All Rights Reserved. */ namespace Magento\Framework\Exception; use Magento\Framework\Phrase; class NoSuchEntityExceptionTest extends \PHPUnit\Framework\TestCase { public function testConstructor() { $exception = new NoSuchEntityException(); $this->assertEquals('No such entity.', $exception->getRawMessage()); $this->assertEquals('No such entity.', $exception->getMessage()); $this->assertEquals('No such entity.', $exception->getLogMessage()); $exception = new NoSuchEntityException( new Phrase( 'No such entity with %fieldName = %fieldValue', ['fieldName' => 'field', 'fieldValue' => 'value'] ) ); $this->assertEquals('No such entity with field = value', $exception->getMessage()); $this->assertEquals('No such entity with %fieldName = %fieldValue', $exception->getRawMessage()); $this->assertEquals('No such entity with field = value', $exception->getLogMessage()); $exception = new NoSuchEntityException( new Phrase( 'No such entity with %fieldName = %fieldValue, %field2Name = %field2Value', [ 'fieldName' => 'field1', 'fieldValue' => 'value1', 'field2Name' => 'field2', 'field2Value' => 'value2' ] ) ); $this->assertEquals( 'No such entity with %fieldName = %fieldValue, %field2Name = %field2Value', $exception->getRawMessage() ); $this->assertEquals('No such entity with field1 = value1, field2 = value2', $exception->getMessage()); $this->assertEquals('No such entity with field1 = value1, field2 = value2', $exception->getLogMessage()); } }