Skip to content

Symfony docs should explain how to 1. use and overwrite services in 6.x and 2. that all need to be public in test #17162

Closed
@torian257x

Description

@torian257x

https://symfony.com/doc/current/testing.html

lacks information of say

class UnderstandSymfonyTest extends KernelTestCase
{
...

self::getContainer()->set(IDevJobService::class, $mockDevJobService);
...

and that all services need to be set to public in test to use them e.g.

when@test:
    services:
        App\Service\Concerns\IDevJobService:
          class: App\Tests\Classes\TestDevJobService
          autowire: true
          public: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions