/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
setup/src/Magento/Setup/Test/Unit/Console/Command/GenerateFixturesCommandTest.php
59 строк
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 11:23
22 окт 2025, 11:23
6c2f6e6
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Setup\Test\Unit\Console\Command; use Magento\Setup\Console\Command\GenerateFixturesCommand; use Magento\Setup\Fixtures\FixtureModel; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Tester\CommandTester; class GenerateFixturesCommandTest extends TestCase { /** * @var FixtureModel|MockObject */ private $fixtureModel; /** * @var GenerateFixturesCommand|MockObject */ private $command; protected function setUp(): void { $this->fixtureModel = $this->createMock(FixtureModel::class); $this->command = new GenerateFixturesCommand($this->fixtureModel); } public function testExecute() { $this->fixtureModel->expects($this->once())->method('loadConfig')->with('path_to_profile.xml'); $this->fixtureModel->expects($this->once())->method('initObjectManager'); $this->fixtureModel->expects($this->once())->method('loadFixtures'); $commandTester = new CommandTester($this->command); $commandTester->execute(['profile' => 'path_to_profile.xml']); } public function testExecuteInvalidLanguageArgument() { $this->expectException('RuntimeException'); $this->expectExceptionMessage('Not enough arguments'); $commandTester = new CommandTester($this->command); $commandTester->execute([]); } public function testSkipReindexOption() { $this->fixtureModel->expects($this->never())->method('reindex'); $commandTester = new CommandTester($this->command); $commandTester->execute(['profile' => 'path_to_profile.xml', '--skip-reindex' => true]); } }