marcelog / PAGI

PHP AGI ( Asterisk Gateway Interface ) facade, with CDR ( Call Detail Record ), Call spool and schedule auto dial, Send and Receive Fax, Channel Variables, and Caller ID management
http://marcelog.github.com/PAGI
Apache License 2.0
191 stars 76 forks source link

[BUG] Error when trying to instantiate MockedClientImpl #51

Open nospoon opened 3 years ago

nospoon commented 3 years ago

When trying to write a test using the MockedClientImpl, when I try to pass an instance of MockedClientImpl into my mocked class under test, I get an error: ErrorException : The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence The exception is being thrown on line 127 of PAGI/Client/Impl/MockedClientImpl.php, which would indicate it's trying to make a call assertion, but it is only being instantiated, no assertions were specified.

Here's my test code for reference

$agiClient = new MockedClientImpl();
$callLog = new Call();
$mockHandler = Mockery::mock(CallHandler::class, [$agiClient, $callLog])->makePartial();
$mockHandler->shouldAllowMockingProtectedMethods();