ElasticsearchAdminUpdateMappingCommand example


class ElasticsearchAdminUpdateMappingCommandTest extends TestCase
{
    public function testUpdate(): void
    {
        $registry = $this->createMock(AdminSearchRegistry::class);
        $registry
            ->expects(static::once())
            ->method('updateMappings');

        $command = new ElasticsearchAdminUpdateMappingCommand($registry);
        $commandTester = new CommandTester($command);

        $commandTester->execute([]);

        static::assertSame(Command::SUCCESS, $commandTester->getStatusCode());
        static::assertStringContainsString('Updated mapping for admin indices', $commandTester->getDisplay());
    }
}
Home | Imprint | This part of the site doesn't use cookies.