This repository was archived by the owner on Feb 20, 2023. It is now read-only.
This repository was archived by the owner on Feb 20, 2023. It is now read-only.
As of 3.2.4 some mocked objects now through an undefined index message failing the unit test #321
Closed
Description
As mentioned on twitter, still not sure if we are doing something odd that is now exposed as of 3.2.4 or if it's a bug in this repo
/**
* Tests if the Statsd::get returns the same object when it has been set
*
* @covers Emis\Monitor\Statsd::set
* @covers Emis\Monitor\Statsd::get
*/
public function testGetWhenSet()
{
$statsD = $this
->getMockBuilder('Statsd')
->setMethods(['send'])
->disableOriginalConstructor()
->getMock();
$statsD
->expects($this->once())
->method('send');
Statsd::set($statsD);
$this->assertEquals($statsD, Statsd::get());
}
Worked in 3.2.3 but now we get
1) Emis\Tests\StatsdTest::testGetWhenSet
Undefined index: send
/Users/Ben/git/apps/intranet/tests/libs/Emis/Monitor/StatsdTest.php:169