Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unit test case error on container #6722

Open
Thejaswini-Rao-U opened this issue Dec 1, 2023 · 2 comments
Open

unit test case error on container #6722

Thejaswini-Rao-U opened this issue Dec 1, 2023 · 2 comments

Comments

@Thejaswini-Rao-U
Copy link

i m trying to write unit test cases for the current project service methods, getting error as attached below

edit

i have called current method as below

use ExportBundle\Service\ExportService;

class ExportServiceTest extends \Codeception\Test\Unit
{

// tests
public function testGenerateProductCsv()
{
$this->exportService = new ExportService();
$this->exportService->generateProductCsv();
}
}

using codeception version is 2.4
and php v is 7.3

can anyone please help me to solve this issue

Thanks in advance

@Naktibalda
Copy link
Member

Error happens in Pimcore.php , right?
This is not a Codeception issue.

@Thejaswini-Rao-U
Copy link
Author

Thejaswini-Rao-U commented Dec 11, 2023

@Naktibalda , thanks for the response

but when we run the function, its executing on website or backend

but when we call using test cases, gets error, i have included all the namespaces needed, im not coming to know why this error arrises?

can please tell me how to correct it if im doing anything wrong in the writing test cases?

method below

// tests
// tests
public function testGenerateProductCsv()

{
    $this->exportService = new ExportService();
    $this->exportService->generateProductCsv();
}

**generateProductCsv** => method name im calling here in test file. (actual file name where method exists is **ExportService.php**

my file name is **ExportServiceTest.php** 

thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants