|
11 | 11 |
|
12 | 12 | namespace Symfony\Cmf\Component\Testing\Tests\Functional;
|
13 | 13 |
|
| 14 | +use Doctrine\Bundle\PHPCRBundle\Test\RepositoryManager; |
| 15 | +use Symfony\Bundle\FrameworkBundle\Client; |
| 16 | +use Symfony\Cmf\Component\Testing\Functional\DbManager\PHPCR; |
14 | 17 | use Symfony\Cmf\Component\Testing\Tests\Fixtures\TestTestCase;
|
| 18 | +use Symfony\Component\DependencyInjection\ContainerInterface; |
| 19 | +use Symfony\Component\HttpKernel\KernelInterface; |
15 | 20 |
|
16 | 21 | class BaseTestCaseTest extends \PHPUnit_Framework_TestCase
|
17 | 22 | {
|
18 | 23 | private $container;
|
19 | 24 |
|
20 | 25 | private $kernel;
|
21 | 26 |
|
| 27 | + /** |
| 28 | + * @var TestTestCase |
| 29 | + */ |
22 | 30 | private $testCase;
|
23 | 31 |
|
24 | 32 | private $client;
|
25 | 33 |
|
26 | 34 | protected function setUp()
|
27 | 35 | {
|
28 |
| - $this->container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); |
| 36 | + $this->container = $this->createMock(ContainerInterface::class); |
29 | 37 | $this->container->expects($this->any())
|
30 | 38 | ->method('get')
|
31 | 39 | ->will($this->returnCallback(function ($name) {
|
32 |
| - $dic = [ |
33 |
| - 'test.client' => $this->client, |
34 |
| - ]; |
| 40 | + $dic = ['test.client' => $this->client]; |
35 | 41 |
|
36 | 42 | return $dic[$name];
|
37 | 43 | }));
|
38 | 44 |
|
39 |
| - $this->kernel = $this->createMock('Symfony\Component\HttpKernel\KernelInterface'); |
| 45 | + $this->kernel = $this->createMock(KernelInterface::class); |
40 | 46 | $this->kernel->expects($this->any())
|
41 | 47 | ->method('getContainer')
|
42 | 48 | ->willReturn($this->container);
|
43 | 49 |
|
44 | 50 | $this->testCase = new TestTestCase();
|
45 | 51 | $this->testCase->setKernel($this->kernel);
|
46 | 52 |
|
47 |
| - $this->client = $this->createMock('Symfony\Bundle\FrameworkBundle\Client'); |
| 53 | + $this->client = $this->createMock(Client::class); |
48 | 54 | $this->client->expects($this->any())
|
49 | 55 | ->method('getContainer')
|
50 | 56 | ->willReturn($this->container);
|
@@ -81,6 +87,9 @@ public function testDb($dbName, $expected)
|
81 | 87 | 'Symfony\Cmf\Component\Testing\Functional\DbManager\%s',
|
82 | 88 | $expected
|
83 | 89 | );
|
| 90 | + if (PHPCR::class === $className && class_exists(RepositoryManager::class)) { |
| 91 | + $className = RepositoryManager::class; |
| 92 | + } |
84 | 93 |
|
85 | 94 | $this->assertInstanceOf($className, $res);
|
86 | 95 | }
|
|
0 commit comments