-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathBaseKernelTestCase.php
More file actions
43 lines (37 loc) · 1.35 KB
/
BaseKernelTestCase.php
File metadata and controls
43 lines (37 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Smartbox\Integration\FrameworkBundle\Tests;
use Smartbox\CoreBundle\Type\SerializableInterface;
use Smartbox\Integration\FrameworkBundle\Tools\Helper\SmartesbHelper;
use Smartbox\Integration\FrameworkBundle\Core\Messages\Context;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Class BaseKernelTestCase.
*/
class BaseKernelTestCase extends KernelTestCase
{
/** @var SmartesbHelper */
protected $helper;
protected function setUp(): void
{
$this->bootKernel();
$this->getContainer()->set('doctrine', $this->createMock(RegistryInterface::class));
$this->helper = $this->getContainer()->get('smartesb.helper');
}
public function getContainer(): ContainerInterface
{
return self::$kernel->getContainer();
}
/**
* @param SerializableInterface $body
* @param array $headers
* @param Context $context
*
* @return \Smartbox\Integration\FrameworkBundle\Core\Messages\Message
*/
protected function createMessage(SerializableInterface $body = null, $headers = [], Context $context = null)
{
return $this->getContainer()->get('smartesb.message_factory')->createMessage($body, $headers, $context);
}
}