/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/File/Test/Unit/CsvTest.php
62 строки
1 KB
Rajesh Kumar
AC-15620: Ensure PHP 8.5 Compatibility with adobe commerce
12 янв 2026, 14:28
12 янв 2026, 14:28
491c19a
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\File\Test\Unit; use Magento\Framework\File\Csv; use Magento\Framework\Filesystem\Driver\File; use PHPUnit\Framework\TestCase; /** * Test class for \Magento\Framework\File\Csv. */ class CsvTest extends TestCase { /** * Csv model * * @var \Magento\Framework\File\Csv */ protected $_model; protected function setUp(): void { $this->_model = new Csv(new File()); } protected function tearDown(): void { unset($this->_model); } public function testSetLineLength() { $expected = 4; $this->_model->setLineLength($expected); $lineLengthProperty = new \ReflectionProperty(Csv::class, '_lineLength'); $actual = $lineLengthProperty->getValue($this->_model); $this->assertEquals($expected, $actual); } public function testSetDelimiter() { $this->assertInstanceOf(Csv::class, $this->_model->setDelimiter(',')); } public function testSetEnclosure() { $this->assertInstanceOf(Csv::class, $this->_model->setEnclosure('"')); } public function testGetDataFileNonExistent() { $this->expectException('Exception'); $this->expectExceptionMessage('File "FileNameThatShouldNotExist" does not exist'); $file = 'FileNameThatShouldNotExist'; $this->_model->getData($file); } }