snapshot of https://github.com/espocrm/espocrm.git (master, 2026-09-18; blobs > 131072B omitted)
Some checks failed
Test / Test on PHP 8.3 (push) Failing after 5s
Test / Test on PHP 8.4 (push) Failing after 4s
Test / Test on PHP 8.5 (push) Failing after 3s
TypeScript static analysis / TypeScript check (push) Failing after 14s
Test Integration on MySQL / Test on PHP 8.3 (push) Failing after 2s
Test Integration on MySQL / Test on PHP 8.5 (push) Failing after 0s
Test Integration on PostgreSQL / Test on PHP 8.4 fix (push) Failing after 1s
Test Integration on PostgreSQL / Test on PHP 8.4 master (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-18 04:19:15 +05:00
commit 7cc7e6b4f3
10077 changed files with 900756 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 EspoCRM, Inc.
* Website: https://www.espocrm.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace tests\unit\Espo\Core\Select\Text;
use Espo\Core\Select\Text\FilterParams;
class FilterParamsTest extends \PHPUnit\Framework\TestCase
{
public function testCreate1(): void
{
$item = FilterParams::create();
$this->assertNotNull($item);
}
}

View File

@@ -0,0 +1,98 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 EspoCRM, Inc.
* Website: https://www.espocrm.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace tests\unit\Espo\Core\Select\Text;
use Espo\Core\InjectableFactory;
use Espo\Core\Select\Text\FullTextSearch\DataComposerFactory as FullTextSearchDataComposerFactory;
use Espo\Core\Select\Text\FullTextSearch\DefaultDataComposer as FullTextSearchDataComposer;
use Espo\Core\Utils\Metadata;
use PHPUnit\Framework\TestCase;
class FullTextSearchDataComposerFactoryTest extends TestCase
{
private $injectableFactory;
private $metadata;
private $factory;
protected function setUp() : void
{
$this->injectableFactory = $this->createMock(InjectableFactory::class);
$this->metadata = $this->createMock(Metadata::class);
$this->factory = new FullTextSearchDataComposerFactory(
$this->injectableFactory,
$this->metadata
);
}
public function testCreate1()
{
$this->prepareFactoryTest(null);
}
public function testCreate2()
{
$this->prepareFactoryTest('SomeClass');
}
protected function prepareFactoryTest(?string $className)
{
$entityType = 'Test';
$defaultClassName = FullTextSearchDataComposer::class;
$this->metadata
->expects($this->once())
->method('get')
->with([
'selectDefs', $entityType, 'fullTextSearchDataComposerClassName'
])
->willReturn($className);
$className = $className ?? $defaultClassName;
$object = $this->createMock($defaultClassName);
$this->injectableFactory
->expects($this->once())
->method('createWith')
->with(
$className,
[
'entityType' => $entityType,
]
)
->willReturn($object);
$resultObject = $this->factory->create($entityType);
$this->assertEquals($object, $resultObject);
}
}

View File

@@ -0,0 +1,42 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 EspoCRM, Inc.
* Website: https://www.espocrm.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace tests\unit\Espo\Core\Select\Text;
use Espo\Core\Select\Text\FullTextSearch\DataComposer\Params;
class FullTextSearchDataComposerParamsTest extends \PHPUnit\Framework\TestCase
{
public function testCreate()
{
$item = Params::create();
$this->assertNotNull($item);
}
}

View File

@@ -0,0 +1,178 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 EspoCRM, Inc.
* Website: https://www.espocrm.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace tests\unit\Espo\Core\Select\Text;
use Espo\Core\Select\Text\FullTextSearch\DataComposer\Params as FullTextSearchDataComposerParams;
use Espo\Core\Select\Text\FullTextSearch\DefaultDataComposer as FullTextSearchDataComposer;
use Espo\Core\Select\Text\MetadataProvider;
use Espo\Core\Utils\Config;
use PHPUnit\Framework\TestCase;
class FullTextSearchDataComposerTest extends TestCase
{
private $config;
private $metadataProvider;
private $entityType;
private $fullTextSearchDataComposer;
protected function setUp(): void
{
$this->config = $this->createMock(Config::class);
$this->metadataProvider = $this->createMock(MetadataProvider::class);
$this->entityType = 'Test';
$this->fullTextSearchDataComposer = new FullTextSearchDataComposer(
$this->entityType,
$this->config,
$this->metadataProvider
);
}
public function testCompose1()
{
$filter = 'test filter';
$this->config
->expects($this->any())
->method('get')
->willReturnMap(
[
['fullTextSearchDisabled', false],
['fullTextSearchMinLength', 4],
]
);
$this->metadataProvider
->expects($this->any())
->method('isFieldNotStorable')
->willReturnMap(
[
[$this->entityType, 'field1', false],
[$this->entityType, 'field2', false],
[$this->entityType, 'field3', false],
]
);
$this->metadataProvider
->expects($this->any())
->method('isFullTextSearchSupportedForField')
->willReturnMap(
[
[$this->entityType, 'field1', true],
[$this->entityType, 'field2', true],
[$this->entityType, 'field3', false],
]
);
$this->metadataProvider
->expects($this->any())
->method('hasFullTextSearch')
->with($this->entityType)
->willReturn(true);
$this->metadataProvider
->expects($this->any())
->method('getFullTextSearchColumnList')
->with($this->entityType)
->willReturn(
['field1A', 'field1B', 'field2']
);
$this->metadataProvider
->expects($this->any())
->method('getTextFilterAttributeList')
->with($this->entityType)
->willReturn(
['field1', 'field2', 'field3']
);
$params = FullTextSearchDataComposerParams::create();
$data = $this->fullTextSearchDataComposer->compose($filter, $params);
$this->assertNotEquals(null, $data);
$this->assertEquals(['field1A', 'field1B', 'field2'], $data->getColumnList());
$this->assertEquals(['field1', 'field2'], $data->getFieldList());
$this->assertEquals(
'MATCH_BOOLEAN:(field1A, field1B, field2, \'test filter\')',
$data->getExpression()->getValue()
);
}
public function testCompose2()
{
$filter = 'bad';
$this->config
->expects($this->any())
->method('get')
->willReturnMap(
[
['fullTextSearchDisabled', false],
['fullTextSearchMinLength', 4],
]
);
$params = FullTextSearchDataComposerParams::create();
$data = $this->fullTextSearchDataComposer->compose($filter, $params);
$this->assertEquals(null, $data);
}
public function testCompose3()
{
$filter = 'test filter';
$this->config
->expects($this->any())
->method('get')
->willReturnMap(
[
['fullTextSearchDisabled', true],
['fullTextSearchMinLength', 4],
]
);
$params = FullTextSearchDataComposerParams::create();
$data = $this->fullTextSearchDataComposer->compose($filter, $params);
$this->assertEquals(null, $data);
}
}

View File

@@ -0,0 +1,47 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM – Open Source CRM application.
* Copyright (C) 2014-2026 EspoCRM, Inc.
* Website: https://www.espocrm.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace tests\unit\Espo\Core\Select\Text;
use Espo\ORM\Query\Part\Expression as Expr;
use Espo\Core\Select\Text\FullTextSearch\Data;
use Espo\Core\Select\Text\FullTextSearch\Mode;
class FullTextSearchDataTest extends \PHPUnit\Framework\TestCase
{
public function testGet1(): void
{
$item = new Data(Expr::create('TEST:()'), ['test'], ['column'], Mode::BOOLEAN);
$this->assertEquals('TEST:()', $item->getExpression()->getValue());
$this->assertEquals(['test'], $item->getFieldList());
$this->assertEquals(['column'], $item->getColumnList());
$this->assertEquals(Mode::BOOLEAN, $item->getMode());
}
}