php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74079 Stomp is unmockable in PHPUnit as of 2.0
Submitted: 2017-02-10 17:56 UTC Modified: -
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: dave dot k dot gupta at gmail dot com Assigned:
Status: Open Package: stomp (PECL)
PHP Version: 7.1.1 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-02-10 17:56 UTC] dave dot k dot gupta at gmail dot com
Description:
------------
It appears Stomp is unmockable with PHPUnit in PHP7. It looks like it may be an implementation problem with Stomp 2.0.

Test script:
---------------
        $this->stomp = $this->getMockBuilder('\Stomp')
            ->disableOriginalConstructor()
            ->getMock();

Actual result:
--------------
PHP Notice:  Undefined property: Mock_Stomp_b056d082::$__phpunit_invocationMocker in phar:///path/tests/build/php/tools/phpunit.phar/phpunit-mock-objects/Generator.php(263) : eval()'d code on line 361
PHP Stack trace:

PHP   1. {main}() /path/tests/build/php/tools/phpunit.phar:0

PHP   2. PHPUnit\TextUI\Command::main() /path/tests/build/php/tools/phpunit.phar:465

PHP   3. PHPUnit\TextUI\Command->run() phar:///path/tests/build/php/tools/phpunit.phar/phpunit/TextUI/Command.php:135

PHP   4. PHPUnit\TextUI\TestRunner->doRun() phar:///path/tests/build/php/tools/phpunit.phar/phpunit/TextUI/Command.php:206

PHP   5. Mock_Stomp_b056d082->__destruct() phar:///path/tests/build/php/tools/phpunit.phar/phpunit-mock-objects/Generator.php(263) : eval()'d code:0

PHP   6. Mock_Stomp_b056d082->__phpunit_getInvocationMocker() phar:///path/tests/build/php/tools/phpunit.phar/phpunit-mock-objects/Generator.php(263) : eval()'d code:47

PHP Notice:  Undefined property: Mock_Stomp_b056d082::$__phpunit_configurable in phar:///path/tests/build/php/tools/phpunit.phar/phpunit-mock-objects/Generator.php(263) : eval()'d code on line 362

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 12:01:26 2019 UTC