sebastianbergmann/phpunit-mock-objects

Test failure

remicollet opened this issue · 0 comments

Q A
phpunit-mock-objects version 5.0.6
PHPUnit version 6.5.5
PHP version 7.0.27
Installation Method other

Test failure:

PHPUnit 6.5.5 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.0.27
Configuration: /dev/shm/BUILD/phpunit-mock-objects-33fd41a76e746b8fa96d00b49a23dadfa8334cdf/phpunit.xml

...............................................................  63 / 164 ( 38%)
......................................................SS...F... 126 / 164 ( 76%)
........S................S...S...S....                          164 / 164 (100%)

Time: 2.08 seconds, Memory: 6.00MB

There was 1 failure:

1) /dev/shm/BUILD/phpunit-mock-objects-33fd41a76e746b8fa96d00b49a23dadfa8334cdf/tests/Generator/397.phpt
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
-class MockC extends C implements PHPUnit\Framework\MockObject\MockObject
-{
-    private $__phpunit_invocationMocker;
-    private $__phpunit_originalObject;
-    private $__phpunit_configurable = ['m'];
-
-    public function __clone()
-    {
-        $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
-    }
-
-    public function m(?C $other): C
-    {
-        $arguments = array($other);
-        $count     = func_num_args();
-
-        if ($count > 1) {
-            $_arguments = func_get_args();
-
-            for ($i = 1; $i < $count; $i++) {
-                $arguments[] = $_arguments[$i];
-            }
-        }
-
-        $result = $this->__phpunit_getInvocationMocker()->invoke(
-            new \PHPUnit\Framework\MockObject\Invocation\ObjectInvocation(
-                'C', 'm', $arguments, 'C', $this, true
-            )
-        );
-
-        return $result;
-    }
-
-    public function expects(\PHPUnit\Framework\MockObject\Matcher\Invocation $matcher)
-    {
-        return $this->__phpunit_getInvocationMocker()->expects($matcher);
-    }
-
-    public function method()
-    {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
-        $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
-    }
-
-    public function __phpunit_setOriginalObject($originalObject)
-    {
-        $this->__phpunit_originalObject = $originalObject;
-    }
-
-    public function __phpunit_getInvocationMocker()
-    {
-        if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
-        }
-
-        return $this->__phpunit_invocationMocker;
-    }
-
-    public function __phpunit_hasMatchers()
-    {
-        return $this->__phpunit_getInvocationMocker()->hasMatchers();
-    }
-
-    public function __phpunit_verify($unsetInvocationMocker = true)
-    {
-        $this->__phpunit_getInvocationMocker()->verify();
-
-        if ($unsetInvocationMocker) {
-            $this->__phpunit_invocationMocker = null;
-        }
-    }
-}
+Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in - on line 4

/usr/share/php/PHPUnit6/Framework/Constraint/Constraint.php:117
/usr/share/php/PHPUnit6/Framework/Constraint/Constraint.php:62
/usr/share/php/PHPUnit6/Framework/Assert.php:2116
/usr/share/php/PHPUnit6/Framework/Assert.php:1768
/usr/share/php/PHPUnit6/Runner/PhptTestCase.php:137
/usr/share/php/PHPUnit6/Runner/PhptTestCase.php:208
/usr/share/php/PHPUnit6/Framework/TestSuite.php:755
/usr/share/php/PHPUnit6/Framework/TestSuite.php:755
/usr/share/php/PHPUnit6/TextUI/TestRunner.php:546
/usr/share/php/PHPUnit6/TextUI/Command.php:195
/usr/share/php/PHPUnit6/TextUI/Command.php:148

Notice:

  • test suite ok with 7.1.13 and 7.2.1
  • also reported on travis (same error)