Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi Team,
pimcore v 6.6
I’m trying to unit test by codeception, I have installed codception and tests/ folder created under my project directory. But when im calling the service function getting below error
Error attached:
**[PHPUnit\Framework\Exception] Use of undefined constant PIMCORE_PROJECT_ROOT - assumed 'PIMCORE_PROJECT_ROOT' (this will throw an Error in a future version of PHP)
src/GenericBundle/Service/PdfImportService.php:31**
File name for test is **PdfImportServiceTest.php**
public function testGetFilesArray()
{
$pdfService = new PdfImportService();
$this->assertFalse($pdfService->getFilesArray());
}
I have added bootstrap.php file inside tests/ path. Code is here:
<?php
// tests/bootstrap.php
include "./vendor/autoload.php";
\Pimcore\Bootstrap::setProjectRoot();
\Pimcore\Bootstrap::bootstrap();
Added another file named codeception.dist.yml:
namespace: Tests
support_namespace: Support
actor_suffix: Tester
paths:
tests: .
output: ./_output
data: ./Support/Data
support: ./Support
envs: ./_envs
settings:
bootstrap: _bootstrap.php
colors: true
params:
- env
extensions:
enabled:
- Codeception\Extension\RunFailed
When I’m executing this test case, it is calling constructor of actual service file and there we have defined constant path for the file, but this test case is not working. Actual function from the backend is working
In some services im getting get container null error… Please check the link for error.
I followed pimcore unit testing document + symfony documnet + codception document. But it didn’t work for me. I’m stuck with this from 3 days.
Please let me know how to resolve it.
Thanks in advance
Stefan
patrickniessenmakezens
donmez.dogan
41809fc37fa549b98a34934d238850
Código de referido Binance
yolanda smith
b1cfd497da4348d08019b0315db7a0
Deeraj EA
1ddffddc31ea402a842dcb134f6134
bec1cd09097d477da725b161a4066f
Anjanesh Lekshminarayanan
Anjanesh Lekshminarayanan