6 declare(strict_types=1);
23 private $objectManager;
40 $newRelicWrapper = $this->getMockBuilder(NewRelicWrapper::class)
41 ->setMethods([
'setAppName'])
44 $this->objectManager->configure([NewRelicWrapper::class => [
'shared' =>
true]]);
45 $this->objectManager->addSharedInstance($newRelicWrapper, NewRelicWrapper::class);
47 $newRelicWrapper->expects($this->once())
48 ->method(
'setAppName')
49 ->with($this->equalTo(
'beverly_hills;beverly_hills_90210'));
51 $state = $this->objectManager->get(State::class);
53 $state->setAreaCode(
'90210');
63 $newRelicWrapper = $this->getMockBuilder(NewRelicWrapper::class)
64 ->setMethods([
'setAppName'])
67 $this->objectManager->configure([NewRelicWrapper::class => [
'shared' =>
true]]);
68 $this->objectManager->addSharedInstance($newRelicWrapper, NewRelicWrapper::class);
70 $newRelicWrapper->expects($this->never())->method(
'setAppName');
72 $state = $this->objectManager->get(State::class);
74 $state->setAreaCode(
'90210');
testAppNameIsSetWhenConfiguredCorrectly()
testAppNameIsNotSetWhenDisabled()