|
12 | 12 |
|
13 | 13 | class SeparateAppsTest extends \PHPUnit\Framework\TestCase
|
14 | 14 | {
|
15 |
| - /** |
16 |
| - * @var ObjectManager |
17 |
| - */ |
18 |
| - private $objectManager; |
19 |
| - |
20 |
| - protected function setUp() |
21 |
| - { |
22 |
| - $this->objectManager = Bootstrap::getObjectManager(); |
23 |
| - } |
24 |
| - |
25 |
| - /** |
26 |
| - * @magentoConfigFixture default/newrelicreporting/general/enable 1 |
27 |
| - * @magentoConfigFixture default/newrelicreporting/general/app_name beverly_hills |
28 |
| - * @magentoConfigFixture default/newrelicreporting/general/separate_apps 1 |
29 |
| - */ |
30 |
| - public function testAppNameIsSetWhenConfiguredCorrectly() |
31 |
| - { |
32 |
| - $newRelicWrapper = $this->getMockBuilder(NewRelicWrapper::class) |
33 |
| - ->setMethods(['setAppName']) |
34 |
| - ->getMock(); |
35 |
| - |
36 |
| - $this->objectManager->configure([NewRelicWrapper::class => ['shared' => true]]); |
37 |
| - $this->objectManager->addSharedInstance($newRelicWrapper, NewRelicWrapper::class); |
38 |
| - |
39 |
| - $newRelicWrapper->expects($this->once()) |
40 |
| - ->method('setAppName') |
41 |
| - ->with($this->equalTo('beverly_hills;beverly_hills_90210')); |
42 |
| - |
43 |
| - $state = $this->objectManager->get(State::class); |
44 |
| - |
45 |
| - $state->setAreaCode('90210'); |
46 |
| - } |
| 15 | + /** |
| 16 | + * @var ObjectManager |
| 17 | + */ |
| 18 | + private $objectManager; |
| 19 | + |
| 20 | + protected function setUp() |
| 21 | + { |
| 22 | + $this->objectManager = Bootstrap::getObjectManager(); |
| 23 | + } |
| 24 | + |
| 25 | + /** |
| 26 | + * @magentoConfigFixture default/newrelicreporting/general/enable 1 |
| 27 | + * @magentoConfigFixture default/newrelicreporting/general/app_name beverly_hills |
| 28 | + * @magentoConfigFixture default/newrelicreporting/general/separate_apps 1 |
| 29 | + */ |
| 30 | + public function testAppNameIsSetWhenConfiguredCorrectly() |
| 31 | + { |
| 32 | + $newRelicWrapper = $this->getMockBuilder(NewRelicWrapper::class) |
| 33 | + ->setMethods(['setAppName']) |
| 34 | + ->getMock(); |
| 35 | + |
| 36 | + $this->objectManager->configure([NewRelicWrapper::class => ['shared' => true]]); |
| 37 | + $this->objectManager->addSharedInstance($newRelicWrapper, NewRelicWrapper::class); |
| 38 | + |
| 39 | + $newRelicWrapper->expects($this->once()) |
| 40 | + ->method('setAppName') |
| 41 | + ->with($this->equalTo('beverly_hills;beverly_hills_90210')); |
| 42 | + |
| 43 | + $state = $this->objectManager->get(State::class); |
| 44 | + |
| 45 | + $state->setAreaCode('90210'); |
| 46 | + } |
47 | 47 | }
|
0 commit comments