title: Phpunit integration testing symfony app - how to inject services into test?
body: <p>I want to test a class by checking the real database data after function is executed.</p>
  
  <p>I do not understand, how can I inject services which I need, for example some repository class.</p>
  
  <p>So far I have written this:</p>
  
  <pre><code>namespace Tests\integration\Service\JourneyRunner\EmailConditionCheck;
  
  use PHPUnit_Framework_TestCase;
  use NG\Model\Journey\EmailConditionCheckRepositoryInterface;
  
  class EmailConditionCheckServiceTest extends PHPUnit_Framework_TestCase
  {
  
      private $emailConditionCheckQueueRepository;
  
      public function __construct(
          EmailConditionCheckQueueRepositoryInterface $emailConditionCheckQueueRepository
      ) {
          $this-&gt;emailConditionCheckQueueRepository;
          parent::__construct();
      }
  
      public function testPrepareEmailContentForSending()
      {
          echo 'aaa';
  
          $this-&gt;assertEquals(1, 1);
  
  
      }
  }
  </code></pre>
  
  <p>I added the test service to services.xml</p>
  
  <pre><code>&lt;parameter key="tests.integration.service.journey_runner.email_condition_check.email_condition_check_service_test.class"&gt;tests\integration\Service\JourneyRunner\EmailConditionCheck\EmailConditionCheckServiceTest&lt;/parameter&gt;
  
  &lt;service id="tests.integration.service.journey_runner.email_condition_check.email_condition_check_service_test" class="%tests.integration.service.journey_runner.email_condition_check.email_condition_check_service_test%"&gt;
              &lt;argument type="service" id="ng.infrastructure.persistence.time_trigger_queue_repository" /&gt;
          &lt;/service&gt;
  </code></pre>
  
  <p>I know that argument is wrong currently, but from the error I see that it does not get even the wrong argument - it gets nothing.</p>
  
  <pre><code>PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Tests\integration\Service\JourneyRunner\EmailConditionCheck\EmailConditionCheckServiceTest::__construct() must be an instance of Tests\integration\Service\JourneyRunner\EmailConditionCheck\EmailConditionCheckQueueRepositoryInterface, none given, called in /var/www/api.notification.guru/ng-api-service/vendor/phpunit/phpunit/src/Framework/TestSuite.php on line 475 and defined in /var/www/api.notification.guru/ng-api-service/tests/integration/Service/JourneyRunner/EmailConditionCheck/EmailConditionCheckServiceTest.php:12
  </code></pre>
  
  <p>I tried to search for info, but I cannot find.</p>