diff -pruN 5.0.6-1/ChangeLog.md 6.1.1-1/ChangeLog.md
--- 5.0.6-1/ChangeLog.md	1970-01-01 00:00:00.000000000 +0000
+++ 6.1.1-1/ChangeLog.md	2018-04-11 04:50:36.000000000 +0000
@@ -0,0 +1,33 @@
+# ChangeLog
+
+All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
+
+## [6.1.1] - 2018-04-11
+
+### Fixed
+
+* Fixed [#416](https://github.com/sebastianbergmann/phpunit-mock-objects/pull/416): Stubbing/Mocking of traits stopped working
+
+## [6.1.0] - 2018-04-06
+
+### Added
+
+* Implemented [#405](https://github.com/sebastianbergmann/phpunit-mock-objects/pull/405): Add option for disabling return value generation for stubbed methods
+
+### Fixed
+
+* Fixed [#402](https://github.com/sebastianbergmann/phpunit-mock-objects/pull/402): Interfaces that extend `Throwable` cannot be stubbed
+
+## [6.0.1] - 2018-02-15
+
+### Fixed
+
+* Fixed [#406](https://github.com/sebastianbergmann/phpunit-mock-objects/issues/406): `parent` return type declaration is not handled correctly
+
+## [6.0.0] - 2018-02-01
+
+[6.1.1]: https://github.com/sebastianbergmann/phpunit-mock-objects/compare/6.1.0...6.1.1
+[6.1.0]: https://github.com/sebastianbergmann/phpunit-mock-objects/compare/6.0...6.1.0
+[6.0.1]: https://github.com/sebastianbergmann/phpunit-mock-objects/compare/6.0.0...6.0.1
+[6.0.0]: https://github.com/sebastianbergmann/phpunit-mock-objects/compare/5.0...6.0.0
+
diff -pruN 5.0.6-1/composer.json 6.1.1-1/composer.json
--- 5.0.6-1/composer.json	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/composer.json	2018-04-11 04:50:36.000000000 +0000
@@ -20,16 +20,13 @@
     },
     "prefer-stable": true,
     "require": {
-        "php": "^7.0",
+        "php": "^7.1",
         "phpunit/php-text-template": "^1.2.1",
         "doctrine/instantiator": "^1.0.5",
         "sebastian/exporter": "^3.1"
     },
     "require-dev": {
-        "phpunit/phpunit": "^6.5"
-    },
-    "conflict": {
-        "phpunit/phpunit": "<6.0"
+        "phpunit/phpunit": "^7.0"
     },
     "config": {
         "optimize-autoloader": true,
@@ -50,7 +47,7 @@
     },
     "extra": {
         "branch-alias": {
-            "dev-master": "5.0.x-dev"
+            "dev-master": "6.1-dev"
         }
     }
 }
diff -pruN 5.0.6-1/debian/changelog 6.1.1-1/debian/changelog
--- 5.0.6-1/debian/changelog	2018-01-13 06:38:03.000000000 +0000
+++ 6.1.1-1/debian/changelog	2018-04-20 19:44:42.000000000 +0000
@@ -1,3 +1,46 @@
+phpunit-mock-object (6.1.1-1) unstable; urgency=medium
+
+  * Team upload
+
+  [ Sebastian Bergmann ]
+  * Prepare release
+
+  [ Thomas Müller ]
+  * Mock interfaces which extend Throwable as classes which extend Exception
+    and Throwable
+
+  [ David Prévot ]
+  * Update Standards-Version to 4.1.4
+
+ -- David Prévot <taffit@debian.org>  Fri, 20 Apr 2018 09:44:42 -1000
+
+phpunit-mock-object (6.0.1-2) unstable; urgency=medium
+
+  * Team upload, to unstable, with the rest of the latest PHPUnit stack
+  * Fix Vcs-* URLs
+  * Drop Luis Uribe from Uploaders (Closes: #894003)
+
+ -- David Prévot <taffit@debian.org>  Thu, 29 Mar 2018 10:52:03 -1000
+
+phpunit-mock-object (6.0.1-1) experimental; urgency=medium
+
+  * Team upload to experimental since phpunit/sid currently depends on
+    phpunit-mock-object (<< 6~~)
+
+  [ Sebastian Bergmann ]
+  * Remove version check that is no longer required
+  * Prepare release
+  * Bump copyright year
+
+  [ David Prévot ]
+  * Drop now useless patch (php 7.1 is required)
+  * Update copyright (years)
+  * Move project repository to salsa.d.o
+  * Update Standards-Version to 4.1.3
+  * Build-Depend on phpunit 7
+
+ -- David Prévot <taffit@debian.org>  Sun, 04 Mar 2018 18:27:50 -1000
+
 phpunit-mock-object (5.0.6-1) unstable; urgency=medium
 
   * Team upload
diff -pruN 5.0.6-1/debian/control 6.1.1-1/debian/control
--- 5.0.6-1/debian/control	2017-12-04 23:08:55.000000000 +0000
+++ 6.1.1-1/debian/control	2018-04-20 19:37:18.000000000 +0000
@@ -2,21 +2,20 @@ Source: phpunit-mock-object
 Section: php
 Priority: optional
 Maintainer: Debian PHP PEAR Maintainers <pkg-php-pear@lists.alioth.debian.org>
-Uploaders: Luis Uribe <acme@eviled.org>,
-           Prach Pongpanich <prachpub@gmail.com>
+Uploaders: Prach Pongpanich <prachpub@gmail.com>
 Build-Depends: ant,
                debhelper (>= 9),
                php-doctrine-instantiator,
                php-soap,
                php-text-template,
                phpab,
-               phpunit (>= 6),
+               phpunit (>= 7),
                phpunit-exporter,
                pkg-php-tools (>= 1.29~)
-Standards-Version: 4.1.2
+Standards-Version: 4.1.4
 Homepage: https://github.com/sebastianbergmann/phpunit-mock-objects
-Vcs-Git: git://anonscm.debian.org/pkg-php/phpunit-mock-object.git
-Vcs-Browser: http://anonscm.debian.org/cgit/pkg-php/phpunit-mock-object.git
+Vcs-Git: https://salsa.debian.org/php-team/pear/phpunit-mock-object.git
+Vcs-Browser: https://salsa.debian.org/php-team/pear/phpunit-mock-object
 
 Package: phpunit-mock-object
 Architecture: all
diff -pruN 5.0.6-1/debian/copyright 6.1.1-1/debian/copyright
--- 5.0.6-1/debian/copyright	2017-12-04 23:08:55.000000000 +0000
+++ 6.1.1-1/debian/copyright	2018-03-29 20:02:08.000000000 +0000
@@ -1,16 +1,10 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: PHPUnit_MockObject
 Upstream-Contact: Sebastian Bergmann <sebastian@phpunit.de>
 Source: https://github.com/sebastianbergmann/phpunit-mock-objects/
 
 Files: *
-Copyright: (c) 2002-2017, Sebastian Bergmann <sebastian@phpunit.de>
-License: BSD-3-clause
-
-Files: debian/*
-Copyright: (c) 2012, Luis Uribe <acme@eviled.org>
-License: BSD-2-clause
-
+Copyright: (c) 2002-2018, Sebastian Bergmann <sebastian@phpunit.de>
 License: BSD-3-clause
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
@@ -30,32 +24,6 @@ License: BSD-3-clause
  .
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-License: BSD-2-clause
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- .
- Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- .
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
- .
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
diff -pruN 5.0.6-1/debian/patches/0002-Closes-398.patch 6.1.1-1/debian/patches/0002-Closes-398.patch
--- 5.0.6-1/debian/patches/0002-Closes-398.patch	2018-01-13 06:38:03.000000000 +0000
+++ 6.1.1-1/debian/patches/0002-Closes-398.patch	1970-01-01 00:00:00.000000000 +0000
@@ -1,22 +0,0 @@
-From: Sebastian Bergmann <sb@sebastian-bergmann.de>
-Date: Sun, 7 Jan 2018 18:10:51 +0100
-Subject: Closes #398
-
-Origin: upstream, https://github.com/sebastianbergmann/phpunit-mock-objects/commit/e244c19aec6a1f0a2ff9e498b9b4bed22537730a
----
- tests/Generator/397.phpt | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/tests/Generator/397.phpt b/tests/Generator/397.phpt
-index 1259e6f..71e32a4 100644
---- a/tests/Generator/397.phpt
-+++ b/tests/Generator/397.phpt
-@@ -1,5 +1,8 @@
- --TEST--
- https://github.com/sebastianbergmann/phpunit-mock-objects/issues/397
-+--SKIPIF--
-+<?php
-+if (!version_compare(PHP_VERSION, '7.1', '>=')) print 'skip: PHP >= 7.1 required';
- --FILE--
- <?php
- class C
diff -pruN 5.0.6-1/debian/patches/series 6.1.1-1/debian/patches/series
--- 5.0.6-1/debian/patches/series	2018-01-13 06:38:03.000000000 +0000
+++ 6.1.1-1/debian/patches/series	2018-03-05 04:21:50.000000000 +0000
@@ -1,2 +1 @@
 0001-Extend-clean-up.patch
-0002-Closes-398.patch
diff -pruN 5.0.6-1/.gitignore 6.1.1-1/.gitignore
--- 5.0.6-1/.gitignore	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/.gitignore	2018-04-11 04:50:36.000000000 +0000
@@ -1,4 +1,5 @@
 /.idea
+/.php_cs
 /.php_cs.cache
 /composer.lock
 /vendor
diff -pruN 5.0.6-1/LICENSE 6.1.1-1/LICENSE
--- 5.0.6-1/LICENSE	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/LICENSE	2018-04-11 04:50:36.000000000 +0000
@@ -1,6 +1,6 @@
 phpunit-mock-objects
 
-Copyright (c) 2002-2017, Sebastian Bergmann <sebastian@phpunit.de>.
+Copyright (c) 2002-2018, Sebastian Bergmann <sebastian@phpunit.de>.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff -pruN 5.0.6-1/.php_cs 6.1.1-1/.php_cs
--- 5.0.6-1/.php_cs	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/.php_cs	1970-01-01 00:00:00.000000000 +0000
@@ -1,87 +0,0 @@
-<?php
-$header = <<<'EOF'
-This file is part of the phpunit-mock-objects package.
-
-(c) Sebastian Bergmann <sebastian@phpunit.de>
-
-For the full copyright and license information, please view the LICENSE
-file that was distributed with this source code.
-EOF;
-
-return PhpCsFixer\Config::create()
-    ->setRiskyAllowed(true)
-    ->setRules(
-        [
-            'array_syntax' => ['syntax' => 'short'],
-            'binary_operator_spaces' => [
-                'align_double_arrow' => true,
-                'align_equals' => true
-            ],
-            'blank_line_after_namespace' => true,
-            'blank_line_before_statement' => [
-                'statements' => [
-                    'break',
-                    'continue',
-                    'return',
-                    'throw',
-                    'try',
-                ],
-            ],
-            'braces' => true,
-            'cast_spaces' => true,
-            'concat_space' => ['spacing' => 'one'],
-            'elseif' => true,
-            'encoding' => true,
-            'full_opening_tag' => true,
-            'function_declaration' => true,
-            'header_comment' => ['header' => $header, 'separate' => 'none'],
-            'indentation_type' => true,
-            'line_ending' => true,
-            'lowercase_constants' => true,
-            'lowercase_keywords' => true,
-            'method_argument_space' => true,
-            'native_function_invocation' => true,
-            'no_alias_functions' => true,
-            'no_blank_lines_after_class_opening' => true,
-            'no_blank_lines_after_phpdoc' => true,
-            'no_closing_tag' => true,
-            'no_empty_phpdoc' => true,
-            'no_empty_statement' => true,
-            'no_extra_consecutive_blank_lines' => true,
-            'no_leading_namespace_whitespace' => true,
-            'no_singleline_whitespace_before_semicolons' => true,
-            'no_spaces_after_function_name' => true,
-            'no_spaces_inside_parenthesis' => true,
-            'no_trailing_comma_in_list_call' => true,
-            'no_trailing_whitespace' => true,
-            'no_unused_imports' => true,
-            'no_whitespace_in_blank_line' => true,
-            'ordered_imports' => true,
-            'phpdoc_align' => true,
-            'phpdoc_indent' => true,
-            'phpdoc_no_access' => true,
-            'phpdoc_no_empty_return' => true,
-            'phpdoc_no_package' => true,
-            'phpdoc_scalar' => true,
-            'phpdoc_separation' => true,
-            'phpdoc_to_comment' => true,
-            'phpdoc_trim' => true,
-            'phpdoc_types' => true,
-            'phpdoc_var_without_name' => true,
-            'self_accessor' => true,
-            'simplified_null_return' => true,
-            'single_blank_line_at_eof' => true,
-            'single_import_per_statement' => true,
-            'single_line_after_imports' => true,
-            'single_quote' => true,
-            'ternary_operator_spaces' => true,
-            'trim_array_spaces' => true,
-            'visibility_required' => true,
-        ]
-    )
-    ->setFinder(
-        PhpCsFixer\Finder::create()
-        ->files()
-        ->in(__DIR__ . '/src')
-        ->name('*.php')
-    );
diff -pruN 5.0.6-1/.php_cs.dist 6.1.1-1/.php_cs.dist
--- 5.0.6-1/.php_cs.dist	1970-01-01 00:00:00.000000000 +0000
+++ 6.1.1-1/.php_cs.dist	2018-04-11 04:50:36.000000000 +0000
@@ -0,0 +1,155 @@
+<?php
+$header = <<<'EOF'
+This file is part of the phpunit-mock-objects package.
+
+(c) Sebastian Bergmann <sebastian@phpunit.de>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+EOF;
+
+return PhpCsFixer\Config::create()
+    ->setRiskyAllowed(true)
+    ->setRules(
+        [
+            'array_syntax' => ['syntax' => 'short'],
+            'binary_operator_spaces' => [
+                'operators' => [
+                    '=' => 'align',
+                    '=>' => 'align',
+                ],
+            ],
+            'blank_line_after_namespace' => true,
+            'blank_line_before_statement' => [
+                'statements' => [
+                    'break',
+                    'continue',
+                    'return',
+                    'throw',
+                    'try',
+                ],
+            ],
+            'braces' => true,
+            'cast_spaces' => true,
+            'class_attributes_separation' => ['elements' => ['method']],
+            'compact_nullable_typehint' => true,
+            'concat_space' => ['spacing' => 'one'],
+            'declare_equal_normalize' => ['space' => 'none'],
+            'dir_constant' => true,
+            'elseif' => true,
+            'encoding' => true,
+            'full_opening_tag' => true,
+            'function_declaration' => true,
+            'header_comment' => ['header' => $header, 'separate' => 'none'],
+            'indentation_type' => true,
+            'line_ending' => true,
+            'list_syntax' => ['syntax' => 'short'],
+            'lowercase_cast' => true,
+            'lowercase_constants' => true,
+            'lowercase_keywords' => true,
+            'magic_constant_casing' => true,
+            'method_argument_space' => ['ensure_fully_multiline' => true],
+            'modernize_types_casting' => true,
+            'native_function_casing' => true,
+            'native_function_invocation' => true,
+            'no_alias_functions' => true,
+            'no_blank_lines_after_class_opening' => true,
+            'no_blank_lines_after_phpdoc' => true,
+            'no_closing_tag' => true,
+            'no_empty_comment' => true,
+            'no_empty_phpdoc' => true,
+            'no_empty_statement' => true,
+            'no_extra_blank_lines' => true,
+            'no_homoglyph_names' => true,
+            'no_leading_import_slash' => true,
+            'no_leading_namespace_whitespace' => true,
+            'no_mixed_echo_print' => ['use' => 'print'],
+            'no_null_property_initialization' => true,
+            'no_short_bool_cast' => true,
+            'no_short_echo_tag' => true,
+            'no_singleline_whitespace_before_semicolons' => true,
+            'no_spaces_after_function_name' => true,
+            'no_spaces_inside_parenthesis' => true,
+            'no_superfluous_elseif' => true,
+            'no_trailing_comma_in_list_call' => true,
+            'no_trailing_comma_in_singleline_array' => true,
+            'no_trailing_whitespace' => true,
+            'no_trailing_whitespace_in_comment' => true,
+            'no_unneeded_control_parentheses' => true,
+            'no_unneeded_curly_braces' => true,
+            'no_unneeded_final_method' => true,
+            'no_unreachable_default_argument_value' => true,
+            'no_unused_imports' => true,
+            'no_useless_else' => true,
+            'no_whitespace_before_comma_in_array' => true,
+            'no_whitespace_in_blank_line' => true,
+            'non_printable_character' => true,
+            'normalize_index_brace' => true,
+            'object_operator_without_whitespace' => true,
+            'ordered_class_elements' => [
+                'order' => [
+                    'use_trait',
+                    'constant_public',
+                    'constant_protected',
+                    'constant_private',
+                    'property_public_static',
+                    'property_protected_static',
+                    'property_private_static',
+                    'property_public',
+                    'property_protected',
+                    'property_private',
+                    'method_public_static',
+                    'construct',
+                    'destruct',
+                    'magic',
+                    'phpunit',
+                    'method_public',
+                    'method_protected',
+                    'method_private',
+                    'method_protected_static',
+                    'method_private_static',
+                ],
+            ],
+            'ordered_imports' => true,
+            'phpdoc_add_missing_param_annotation' => true,
+            'phpdoc_align' => true,
+            'phpdoc_annotation_without_dot' => true,
+            'phpdoc_indent' => true,
+            'phpdoc_no_access' => true,
+            'phpdoc_no_empty_return' => true,
+            'phpdoc_no_package' => true,
+            'phpdoc_order' => true,
+            'phpdoc_return_self_reference' => true,
+            'phpdoc_scalar' => true,
+            'phpdoc_separation' => true,
+            'phpdoc_single_line_var_spacing' => true,
+            'phpdoc_to_comment' => true,
+            'phpdoc_trim' => true,
+            'phpdoc_types' => true,
+            'phpdoc_types_order' => true,
+            'phpdoc_var_without_name' => true,
+            'pow_to_exponentiation' => true,
+            'protected_to_private' => true,
+            'return_type_declaration' => ['space_before' => 'none'],
+            'self_accessor' => true,
+            'short_scalar_cast' => true,
+            'simplified_null_return' => true,
+            'single_blank_line_at_eof' => true,
+            'single_import_per_statement' => true,
+            'single_line_after_imports' => true,
+            'single_quote' => true,
+            'standardize_not_equals' => true,
+            'ternary_to_null_coalescing' => true,
+            'trim_array_spaces' => true,
+            'unary_operator_spaces' => true,
+            'visibility_required' => true,
+            //'void_return' => true,
+            'whitespace_after_comma_in_array' => true,
+        ]
+    )
+    ->setFinder(
+        PhpCsFixer\Finder::create()
+        ->files()
+        ->in(__DIR__ . '/src')
+        ->name('*.php')
+    );
diff -pruN 5.0.6-1/README.md 6.1.1-1/README.md
--- 5.0.6-1/README.md	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/README.md	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 [![Latest Stable Version](https://img.shields.io/packagist/v/phpunit/phpunit-mock-objects.svg?style=flat-square)](https://packagist.org/packages/phpunit/phpunit-mock-objects)
-[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.0-8892BF.svg?style=flat-square)](https://php.net/)
+[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://php.net/)
 [![Build Status](https://img.shields.io/travis/sebastianbergmann/phpunit-mock-objects/master.svg?style=flat-square)](https://phpunit.de/build-status.html)
 
 # phpunit-mock-objects
diff -pruN 5.0.6-1/src/Builder/Identity.php 6.1.1-1/src/Builder/Identity.php
--- 5.0.6-1/src/Builder/Identity.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Builder/Identity.php	2018-04-11 04:50:36.000000000 +0000
@@ -24,7 +24,7 @@ interface Identity
      *
      * @note The identifier is unique per mock object.
      *
-     * @param string $id Unique identification of expectation.
+     * @param string $id unique identification of expectation
      */
     public function id($id);
 }
diff -pruN 5.0.6-1/src/Builder/InvocationMocker.php 6.1.1-1/src/Builder/InvocationMocker.php
--- 5.0.6-1/src/Builder/InvocationMocker.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Builder/InvocationMocker.php	2018-04-11 04:50:36.000000000 +0000
@@ -204,9 +204,9 @@ class InvocationMocker implements Method
     /**
      * @param array ...$arguments
      *
-     * @return InvocationMocker
-     *
      * @throws RuntimeException
+     *
+     * @return InvocationMocker
      */
     public function with(...$arguments)
     {
@@ -220,9 +220,9 @@ class InvocationMocker implements Method
     /**
      * @param array ...$arguments
      *
-     * @return InvocationMocker
-     *
      * @throws RuntimeException
+     *
+     * @return InvocationMocker
      */
     public function withConsecutive(...$arguments)
     {
@@ -234,9 +234,9 @@ class InvocationMocker implements Method
     }
 
     /**
-     * @return InvocationMocker
-     *
      * @throws RuntimeException
+     *
+     * @return InvocationMocker
      */
     public function withAnyParameters()
     {
@@ -250,9 +250,9 @@ class InvocationMocker implements Method
     /**
      * @param Constraint|string $constraint
      *
-     * @return InvocationMocker
-     *
      * @throws RuntimeException
+     *
+     * @return InvocationMocker
      */
     public function method($constraint)
     {
diff -pruN 5.0.6-1/src/Builder/Match.php 6.1.1-1/src/Builder/Match.php
--- 5.0.6-1/src/Builder/Match.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Builder/Match.php	2018-04-11 04:50:36.000000000 +0000
@@ -17,8 +17,8 @@ interface Match extends Stub
     /**
      * Defines the expectation which must occur before the current is valid.
      *
-     * @param string $id The identification of the expectation that should
-     *                   occur before this one.
+     * @param string $id the identification of the expectation that should
+     *                   occur before this one
      *
      * @return Stub
      */
diff -pruN 5.0.6-1/src/Generator/mocked_class_method.tpl.dist 6.1.1-1/src/Generator/mocked_class_method.tpl.dist
--- 5.0.6-1/src/Generator/mocked_class_method.tpl.dist	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Generator/mocked_class_method.tpl.dist	2018-04-11 04:50:36.000000000 +0000
@@ -1,7 +1,8 @@
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
diff -pruN 5.0.6-1/src/Generator/mocked_class.tpl.dist 6.1.1-1/src/Generator/mocked_class.tpl.dist
--- 5.0.6-1/src/Generator/mocked_class.tpl.dist	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Generator/mocked_class.tpl.dist	2018-04-11 04:50:36.000000000 +0000
@@ -3,6 +3,7 @@
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = {configurable};
+    private $__phpunit_returnValueGeneration = true;
 
 {clone}{mocked_methods}
     public function expects(\PHPUnit\Framework\MockObject\Matcher\Invocation $matcher)
@@ -15,10 +16,15 @@
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/src/Generator/mocked_method.tpl.dist 6.1.1-1/src/Generator/mocked_method.tpl.dist
--- 5.0.6-1/src/Generator/mocked_method.tpl.dist	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Generator/mocked_method.tpl.dist	2018-04-11 04:50:36.000000000 +0000
@@ -1,7 +1,7 @@
 
     {modifier} function {reference}{method_name}({arguments_decl}){return_delim}{return_type}
     {{deprecation}
-        $arguments = array({arguments_call});
+        $arguments = [{arguments_call}];
         $count     = func_num_args();
 
         if ($count > {arguments_count}) {
diff -pruN 5.0.6-1/src/Generator/mocked_method_void.tpl.dist 6.1.1-1/src/Generator/mocked_method_void.tpl.dist
--- 5.0.6-1/src/Generator/mocked_method_void.tpl.dist	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Generator/mocked_method_void.tpl.dist	2018-04-11 04:50:36.000000000 +0000
@@ -1,7 +1,7 @@
 
     {modifier} function {reference}{method_name}({arguments_decl}){return_delim}{return_type}
     {{deprecation}
-        $arguments = array({arguments_call});
+        $arguments = [{arguments_call}];
         $count     = func_num_args();
 
         if ($count > {arguments_count}) {
diff -pruN 5.0.6-1/src/Generator/proxied_method.tpl.dist 6.1.1-1/src/Generator/proxied_method.tpl.dist
--- 5.0.6-1/src/Generator/proxied_method.tpl.dist	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Generator/proxied_method.tpl.dist	2018-04-11 04:50:36.000000000 +0000
@@ -1,7 +1,7 @@
 
     {modifier} function {reference}{method_name}({arguments_decl}){return_delim}{return_type}
     {
-        $arguments = array({arguments_call});
+        $arguments = [{arguments_call}];
         $count     = func_num_args();
 
         if ($count > {arguments_count}) {
diff -pruN 5.0.6-1/src/Generator/proxied_method_void.tpl.dist 6.1.1-1/src/Generator/proxied_method_void.tpl.dist
--- 5.0.6-1/src/Generator/proxied_method_void.tpl.dist	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Generator/proxied_method_void.tpl.dist	2018-04-11 04:50:36.000000000 +0000
@@ -1,7 +1,7 @@
 
     {modifier} function {reference}{method_name}({arguments_decl}){return_delim}{return_type}
     {
-        $arguments = array({arguments_call});
+        $arguments = [{arguments_call}];
         $count     = func_num_args();
 
         if ($count > {arguments_count}) {
diff -pruN 5.0.6-1/src/Generator.php 6.1.1-1/src/Generator.php
--- 5.0.6-1/src/Generator.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Generator.php	2018-04-11 04:50:36.000000000 +0000
@@ -67,15 +67,16 @@ class Generator
      * @param bool            $callOriginalMethods
      * @param object          $proxyTarget
      * @param bool            $allowMockingUnknownTypes
-     *
-     * @return MockObject
+     * @param bool            $returnValueGeneration
      *
      * @throws Exception
      * @throws RuntimeException
      * @throws \PHPUnit\Framework\Exception
      * @throws \ReflectionException
+     *
+     * @return MockObject
      */
-    public function getMock($type, $methods = [], array $arguments = [], $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = true, $callOriginalMethods = false, $proxyTarget = null, $allowMockingUnknownTypes = true)
+    public function getMock($type, $methods = [], array $arguments = [], $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = true, $callOriginalMethods = false, $proxyTarget = null, $allowMockingUnknownTypes = true, $returnValueGeneration = true)
     {
         if (!\is_array($type) && !\is_string($type)) {
             throw InvalidArgumentHelper::factory(1, 'array or string');
@@ -197,75 +198,12 @@ class Generator
             $callAutoload,
             $arguments,
             $callOriginalMethods,
-            $proxyTarget
+            $proxyTarget,
+            $returnValueGeneration
         );
     }
 
     /**
-     * @param string       $code
-     * @param string       $className
-     * @param array|string $type
-     * @param bool         $callOriginalConstructor
-     * @param bool         $callAutoload
-     * @param array        $arguments
-     * @param bool         $callOriginalMethods
-     * @param object       $proxyTarget
-     *
-     * @return MockObject
-     *
-     * @throws \ReflectionException
-     * @throws RuntimeException
-     */
-    private function getObject($code, $className, $type = '', $callOriginalConstructor = false, $callAutoload = false, array $arguments = [], $callOriginalMethods = false, $proxyTarget = null)
-    {
-        $this->evalClass($code, $className);
-
-        if ($callOriginalConstructor &&
-            \is_string($type) &&
-            !\interface_exists($type, $callAutoload)) {
-            if (\count($arguments) === 0) {
-                $object = new $className;
-            } else {
-                $class  = new ReflectionClass($className);
-                $object = $class->newInstanceArgs($arguments);
-            }
-        } else {
-            try {
-                $instantiator = new Instantiator;
-                $object       = $instantiator->instantiate($className);
-            } catch (InstantiatorException $exception) {
-                throw new RuntimeException($exception->getMessage());
-            }
-        }
-
-        if ($callOriginalMethods) {
-            if (!\is_object($proxyTarget)) {
-                if (\count($arguments) === 0) {
-                    $proxyTarget = new $type;
-                } else {
-                    $class       = new ReflectionClass($type);
-                    $proxyTarget = $class->newInstanceArgs($arguments);
-                }
-            }
-
-            $object->__phpunit_setOriginalObject($proxyTarget);
-        }
-
-        return $object;
-    }
-
-    /**
-     * @param string $code
-     * @param string $className
-     */
-    private function evalClass($code, $className)
-    {
-        if (!\class_exists($className, false)) {
-            eval($code);
-        }
-    }
-
-    /**
      * Returns a mock object for the specified abstract class with all abstract
      * methods of the class mocked. Concrete methods to mock can be specified with
      * the last parameter
@@ -279,11 +217,11 @@ class Generator
      * @param array  $mockedMethods
      * @param bool   $cloneArguments
      *
-     * @return MockObject
-     *
      * @throws \ReflectionException
      * @throws RuntimeException
      * @throws Exception
+     *
+     * @return MockObject
      */
     public function getMockForAbstractClass($originalClassName, array $arguments = [], $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $mockedMethods = [], $cloneArguments = true)
     {
@@ -341,11 +279,11 @@ class Generator
      * @param array  $mockedMethods
      * @param bool   $cloneArguments
      *
-     * @return MockObject
-     *
      * @throws \ReflectionException
      * @throws RuntimeException
      * @throws Exception
+     *
+     * @return MockObject
      */
     public function getMockForTrait($traitName, array $arguments = [], $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $mockedMethods = [], $cloneArguments = true)
     {
@@ -400,11 +338,11 @@ class Generator
      * @param bool   $callOriginalClone
      * @param bool   $callAutoload
      *
-     * @return object
-     *
      * @throws \ReflectionException
      * @throws RuntimeException
      * @throws Exception
+     *
+     * @return object
      */
     public function getObjectForTrait($traitName, array $arguments = [], $traitClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true)
     {
@@ -453,10 +391,10 @@ class Generator
      * @param bool         $cloneArguments
      * @param bool         $callOriginalMethods
      *
-     * @return array
-     *
      * @throws \ReflectionException
      * @throws \PHPUnit\Framework\MockObject\RuntimeException
+     *
+     * @return array
      */
     public function generate($type, array $methods = null, $mockClassName = '', $callOriginalClone = true, $callAutoload = true, $cloneArguments = true, $callOriginalMethods = false)
     {
@@ -501,9 +439,9 @@ class Generator
      * @param array  $methods
      * @param array  $options
      *
-     * @return string
-     *
      * @throws RuntimeException
+     *
+     * @return string
      */
     public function generateClassFromWsdl($wsdlFile, $className, array $methods = [], array $options = [])
     {
@@ -584,19 +522,109 @@ class Generator
     }
 
     /**
+     * @param string $className
+     *
+     * @throws \ReflectionException
+     *
+     * @return array
+     */
+    public function getClassMethods($className)
+    {
+        $class   = new ReflectionClass($className);
+        $methods = [];
+
+        foreach ($class->getMethods() as $method) {
+            if ($method->isPublic() || $method->isAbstract()) {
+                $methods[] = $method->getName();
+            }
+        }
+
+        return $methods;
+    }
+
+    /**
+     * @param string       $code
+     * @param string       $className
+     * @param array|string $type
+     * @param bool         $callOriginalConstructor
+     * @param bool         $callAutoload
+     * @param array        $arguments
+     * @param bool         $callOriginalMethods
+     * @param object       $proxyTarget
+     * @param bool         $returnValueGeneration
+     *
+     * @throws \ReflectionException
+     * @throws RuntimeException
+     *
+     * @return MockObject
+     */
+    private function getObject($code, $className, $type = '', $callOriginalConstructor = false, $callAutoload = false, array $arguments = [], $callOriginalMethods = false, $proxyTarget = null, $returnValueGeneration = true)
+    {
+        $this->evalClass($code, $className);
+
+        if ($callOriginalConstructor &&
+            \is_string($type) &&
+            !\interface_exists($type, $callAutoload)) {
+            if (\count($arguments) === 0) {
+                $object = new $className;
+            } else {
+                $class  = new ReflectionClass($className);
+                $object = $class->newInstanceArgs($arguments);
+            }
+        } else {
+            try {
+                $instantiator = new Instantiator;
+                $object       = $instantiator->instantiate($className);
+            } catch (InstantiatorException $exception) {
+                throw new RuntimeException($exception->getMessage());
+            }
+        }
+
+        if ($callOriginalMethods) {
+            if (!\is_object($proxyTarget)) {
+                if (\count($arguments) === 0) {
+                    $proxyTarget = new $type;
+                } else {
+                    $class       = new ReflectionClass($type);
+                    $proxyTarget = $class->newInstanceArgs($arguments);
+                }
+            }
+
+            $object->__phpunit_setOriginalObject($proxyTarget);
+        }
+
+        if ($object instanceof MockObject) {
+            $object->__phpunit_setReturnValueGeneration($returnValueGeneration);
+        }
+
+        return $object;
+    }
+
+    /**
+     * @param string $code
+     * @param string $className
+     */
+    private function evalClass($code, $className)
+    {
+        if (!\class_exists($className, false)) {
+            eval($code);
+        }
+    }
+
+    /**
      * @param array|string $type
-     * @param array|null   $methods
+     * @param null|array   $methods
      * @param string       $mockClassName
      * @param bool         $callOriginalClone
      * @param bool         $callAutoload
      * @param bool         $cloneArguments
      * @param bool         $callOriginalMethods
      *
-     * @return array
-     *
      * @throws \InvalidArgumentException
      * @throws \ReflectionException
      * @throws RuntimeException
+     *
+     * @return array
      */
     private function generateMock($type, $methods, $mockClassName, $callOriginalClone, $callAutoload, $cloneArguments, $callOriginalMethods)
     {
@@ -623,7 +651,8 @@ class Generator
                 $isMultipleInterfaces = true;
 
                 $additionalInterfaces[] = $_type;
-                $typeClass              = new ReflectionClass($this->generateClassName(
+                $typeClass              = new ReflectionClass(
+                    $this->generateClassName(
                     $_type,
                     $mockClassName,
                     'Mock_'
@@ -673,6 +702,20 @@ class Generator
         } else {
             $class = new ReflectionClass($mockClassName['fullClassName']);
 
+            // @see https://github.com/sebastianbergmann/phpunit/issues/2995
+            if ($isInterface && $class->implementsInterface(\Throwable::class)) {
+                $additionalInterfaces[] = $class->getName();
+                $isInterface            = false;
+
+                $mockClassName = $this->generateClassName(
+                    \Exception::class,
+                    '',
+                    'Mock_'
+                );
+
+                $class = new ReflectionClass($mockClassName['fullClassName']);
+            }
+
             if ($class->isFinal()) {
                 throw new RuntimeException(
                     \sprintf(
@@ -891,9 +934,9 @@ class Generator
      * @param bool             $cloneArguments
      * @param bool             $callOriginalMethods
      *
-     * @return string
-     *
      * @throws \PHPUnit\Framework\MockObject\RuntimeException
+     *
+     * @return string
      */
     private function generateMockedMethodDefinitionFromExisting(ReflectionMethod $method, $cloneArguments, $callOriginalMethods)
     {
@@ -939,7 +982,7 @@ class Generator
             $callOriginalMethods,
             $method->isStatic(),
             $deprecation,
-            $method->hasReturnType() && PHP_VERSION_ID >= 70100 && $method->getReturnType()->allowsNull()
+            $method->hasReturnType() && $method->getReturnType()->allowsNull()
         );
     }
 
@@ -957,9 +1000,11 @@ class Generator
      * @param bool|string $deprecation
      * @param bool        $allowsReturnNull
      *
-     * @return string
-     *
+     * @throws \ReflectionException
+     * @throws \PHPUnit\Framework\MockObject\RuntimeException
      * @throws \InvalidArgumentException
+     *
+     * @return string
      */
     private function generateMockedMethodDefinition($className, $methodName, $cloneArguments = true, $modifier = 'public', $argumentsForDeclaration = '', $argumentsForCall = '', $returnType = '', $reference = '', $callOriginalMethods = false, $static = false, $deprecation = false, $allowsReturnNull = false)
     {
@@ -979,13 +1024,31 @@ class Generator
             }
         }
 
-        // Mocked interfaces returning 'self' must explicitly declare the
-        // interface name as the return type. See
-        // https://bugs.php.net/bug.php?id=70722
+        // @see https://bugs.php.net/bug.php?id=70722
         if ($returnType === 'self') {
             $returnType = $className;
         }
 
+        // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/406
+        if ($returnType === 'parent') {
+            $reflector = new ReflectionClass($className);
+
+            $parentClass = $reflector->getParentClass();
+
+            if ($parentClass === null) {
+                throw new RuntimeException(
+                    \sprintf(
+                        'Cannot mock %s::%s because "parent" return type declaration is used but %s does not have a parent class',
+                        $className,
+                        $methodName,
+                        $className
+                    )
+                );
+            }
+
+            $returnType = $parentClass->getName();
+        }
+
         if (false !== $deprecation) {
             $deprecation         = "The $className::$methodName method is deprecated ($deprecation).";
             $deprecationTemplate = $this->getTemplate('deprecation.tpl');
@@ -1023,9 +1086,9 @@ class Generator
     /**
      * @param ReflectionMethod $method
      *
-     * @return bool
-     *
      * @throws \ReflectionException
+     *
+     * @return bool
      */
     private function canMockMethod(ReflectionMethod $method)
     {
@@ -1050,9 +1113,9 @@ class Generator
      * @param ReflectionMethod $method
      * @param bool             $forCall
      *
-     * @return string
-     *
      * @throws RuntimeException
+     *
+     * @return string
      */
     private function getMethodParameters(ReflectionMethod $method, $forCall = false)
     {
@@ -1082,7 +1145,7 @@ class Generator
             $typeDeclaration = '';
 
             if (!$forCall) {
-                if (PHP_VERSION_ID >= 70100 && $parameter->hasType() && $parameter->allowsNull()) {
+                if ($parameter->hasType() && $parameter->allowsNull()) {
                     $nullable = '?';
                 }
 
@@ -1134,32 +1197,11 @@ class Generator
     }
 
     /**
-     * @param string $className
-     *
-     * @return array
-     *
-     * @throws \ReflectionException
-     */
-    public function getClassMethods($className)
-    {
-        $class   = new ReflectionClass($className);
-        $methods = [];
-
-        foreach ($class->getMethods() as $method) {
-            if ($method->isPublic() || $method->isAbstract()) {
-                $methods[] = $method->getName();
-            }
-        }
-
-        return $methods;
-    }
-
-    /**
      * @param string $template
      *
-     * @return Text_Template
-     *
      * @throws \InvalidArgumentException
+     *
+     * @return Text_Template
      */
     private function getTemplate($template)
     {
diff -pruN 5.0.6-1/src/Invocation/Invocation.php 6.1.1-1/src/Invocation/Invocation.php
--- 5.0.6-1/src/Invocation/Invocation.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Invocation/Invocation.php	2018-04-11 04:50:36.000000000 +0000
@@ -15,7 +15,7 @@ namespace PHPUnit\Framework\MockObject;
 interface Invocation
 {
     /**
-     * @return mixed Mocked return value.
+     * @return mixed mocked return value
      */
     public function generateReturnValue();
 
diff -pruN 5.0.6-1/src/Invocation/StaticInvocation.php 6.1.1-1/src/Invocation/StaticInvocation.php
--- 5.0.6-1/src/Invocation/StaticInvocation.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Invocation/StaticInvocation.php	2018-04-11 04:50:36.000000000 +0000
@@ -83,6 +83,10 @@ class StaticInvocation implements Invoca
         $this->methodName = $methodName;
         $this->parameters = $parameters;
 
+        if (\strtolower($methodName) === '__tostring') {
+            $returnType = 'string';
+        }
+
         if (\strpos($returnType, '?') === 0) {
             $returnType                 = \substr($returnType, 1);
             $this->isReturnTypeNullable = true;
@@ -127,11 +131,11 @@ class StaticInvocation implements Invoca
     }
 
     /**
-     * @return mixed Mocked return value
-     *
      * @throws \ReflectionException
      * @throws \PHPUnit\Framework\MockObject\RuntimeException
      * @throws \PHPUnit\Framework\Exception
+     *
+     * @return mixed Mocked return value
      */
     public function generateReturnValue()
     {
diff -pruN 5.0.6-1/src/InvocationMocker.php 6.1.1-1/src/InvocationMocker.php
--- 5.0.6-1/src/InvocationMocker.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/InvocationMocker.php	2018-04-11 04:50:36.000000000 +0000
@@ -10,9 +10,11 @@
 namespace PHPUnit\Framework\MockObject;
 
 use Exception;
+use PHPUnit\Framework\ExpectationFailedException;
 use PHPUnit\Framework\MockObject\Builder\InvocationMocker as BuilderInvocationMocker;
 use PHPUnit\Framework\MockObject\Builder\Match;
 use PHPUnit\Framework\MockObject\Builder\NamespaceMatch;
+use PHPUnit\Framework\MockObject\Matcher\DeferredError;
 use PHPUnit\Framework\MockObject\Matcher\Invocation as MatcherInvocation;
 use PHPUnit\Framework\MockObject\Stub\MatcherCollection;
 
@@ -41,11 +43,18 @@ class InvocationMocker implements Matche
     private $configurableMethods = [];
 
     /**
+     * @var bool
+     */
+    private $returnValueGeneration;
+
+    /**
      * @param array $configurableMethods
+     * @param bool  $returnValueGeneration
      */
-    public function __construct(array $configurableMethods)
+    public function __construct(array $configurableMethods, bool $returnValueGeneration)
     {
-        $this->configurableMethods = $configurableMethods;
+        $this->configurableMethods   = $configurableMethods;
+        $this->returnValueGeneration = $returnValueGeneration;
     }
 
     /**
@@ -70,7 +79,7 @@ class InvocationMocker implements Matche
     /**
      * @param mixed $id
      *
-     * @return bool|null
+     * @return null|bool
      */
     public function lookupId($id)
     {
@@ -115,9 +124,9 @@ class InvocationMocker implements Matche
     /**
      * @param Invocation $invocation
      *
-     * @return mixed
-     *
      * @throws Exception
+     *
+     * @return mixed
      */
     public function invoke(Invocation $invocation)
     {
@@ -148,8 +157,22 @@ class InvocationMocker implements Matche
             return $returnValue;
         }
 
-        if (\strtolower($invocation->getMethodName()) === '__tostring') {
-            return '';
+        if ($this->returnValueGeneration === false) {
+            $exception = new ExpectationFailedException(
+                \sprintf(
+                    'Return value inference disabled and no expectation set up for %s::%s()',
+                    $invocation->getClassName(),
+                    $invocation->getMethodName()
+                )
+            );
+
+            if (\strtolower($invocation->getMethodName()) === '__tostring') {
+                $this->addMatcher(new DeferredError($exception));
+
+                return '';
+            }
+
+            throw $exception;
         }
 
         return $invocation->generateReturnValue();
@@ -172,9 +195,9 @@ class InvocationMocker implements Matche
     }
 
     /**
-     * @return bool
-     *
      * @throws \PHPUnit\Framework\ExpectationFailedException
+     *
+     * @return bool
      */
     public function verify()
     {
diff -pruN 5.0.6-1/src/Matcher/AnyInvokedCount.php 6.1.1-1/src/Matcher/AnyInvokedCount.php
--- 5.0.6-1/src/Matcher/AnyInvokedCount.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/AnyInvokedCount.php	2018-04-11 04:50:36.000000000 +0000
@@ -18,7 +18,7 @@ class AnyInvokedCount extends InvokedRec
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         return 'invoked zero or more times';
     }
diff -pruN 5.0.6-1/src/Matcher/AnyParameters.php 6.1.1-1/src/Matcher/AnyParameters.php
--- 5.0.6-1/src/Matcher/AnyParameters.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/AnyParameters.php	2018-04-11 04:50:36.000000000 +0000
@@ -19,7 +19,7 @@ class AnyParameters extends StatelessInv
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         return 'with any parameters';
     }
diff -pruN 5.0.6-1/src/Matcher/ConsecutiveParameters.php 6.1.1-1/src/Matcher/ConsecutiveParameters.php
--- 5.0.6-1/src/Matcher/ConsecutiveParameters.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/ConsecutiveParameters.php	2018-04-11 04:50:36.000000000 +0000
@@ -57,7 +57,7 @@ class ConsecutiveParameters extends Stat
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         return 'with consecutive parameters';
     }
@@ -65,9 +65,9 @@ class ConsecutiveParameters extends Stat
     /**
      * @param BaseInvocation $invocation
      *
-     * @return bool
-     *
      * @throws \PHPUnit\Framework\ExpectationFailedException
+     *
+     * @return bool
      */
     public function matches(BaseInvocation $invocation)
     {
diff -pruN 5.0.6-1/src/Matcher/DeferredError.php 6.1.1-1/src/Matcher/DeferredError.php
--- 5.0.6-1/src/Matcher/DeferredError.php	1970-01-01 00:00:00.000000000 +0000
+++ 6.1.1-1/src/Matcher/DeferredError.php	2018-04-11 04:50:36.000000000 +0000
@@ -0,0 +1,40 @@
+<?php
+/*
+ * This file is part of the phpunit-mock-objects package.
+ *
+ * (c) Sebastian Bergmann <sebastian@phpunit.de>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\Framework\MockObject\Matcher;
+
+use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
+
+class DeferredError extends StatelessInvocation
+{
+    /**
+     * @var \Throwable
+     */
+    private $exception;
+
+    public function __construct(\Throwable $exception)
+    {
+        $this->exception = $exception;
+    }
+
+    public function verify(): void
+    {
+        throw $this->exception;
+    }
+
+    public function toString(): string
+    {
+        return '';
+    }
+
+    public function matches(BaseInvocation $invocation): bool
+    {
+        return true;
+    }
+}
diff -pruN 5.0.6-1/src/Matcher/InvokedAtIndex.php 6.1.1-1/src/Matcher/InvokedAtIndex.php
--- 5.0.6-1/src/Matcher/InvokedAtIndex.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/InvokedAtIndex.php	2018-04-11 04:50:36.000000000 +0000
@@ -45,7 +45,7 @@ class InvokedAtIndex implements Invocati
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         return 'invoked at sequence index ' . $this->sequenceIndex;
     }
diff -pruN 5.0.6-1/src/Matcher/InvokedAtLeastCount.php 6.1.1-1/src/Matcher/InvokedAtLeastCount.php
--- 5.0.6-1/src/Matcher/InvokedAtLeastCount.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/InvokedAtLeastCount.php	2018-04-11 04:50:36.000000000 +0000
@@ -33,7 +33,7 @@ class InvokedAtLeastCount extends Invoke
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         return 'invoked at least ' . $this->requiredInvocations . ' times';
     }
diff -pruN 5.0.6-1/src/Matcher/InvokedAtLeastOnce.php 6.1.1-1/src/Matcher/InvokedAtLeastOnce.php
--- 5.0.6-1/src/Matcher/InvokedAtLeastOnce.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/InvokedAtLeastOnce.php	2018-04-11 04:50:36.000000000 +0000
@@ -22,7 +22,7 @@ class InvokedAtLeastOnce extends Invoked
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         return 'invoked at least once';
     }
diff -pruN 5.0.6-1/src/Matcher/InvokedAtMostCount.php 6.1.1-1/src/Matcher/InvokedAtMostCount.php
--- 5.0.6-1/src/Matcher/InvokedAtMostCount.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/InvokedAtMostCount.php	2018-04-11 04:50:36.000000000 +0000
@@ -33,7 +33,7 @@ class InvokedAtMostCount extends Invoked
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         return 'invoked at most ' . $this->allowedInvocations . ' times';
     }
diff -pruN 5.0.6-1/src/Matcher/InvokedCount.php 6.1.1-1/src/Matcher/InvokedCount.php
--- 5.0.6-1/src/Matcher/InvokedCount.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/InvokedCount.php	2018-04-11 04:50:36.000000000 +0000
@@ -46,7 +46,7 @@ class InvokedCount extends InvokedRecord
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         return 'invoked ' . $this->expectedCount . ' time(s)';
     }
diff -pruN 5.0.6-1/src/Matcher/MethodName.php 6.1.1-1/src/Matcher/MethodName.php
--- 5.0.6-1/src/Matcher/MethodName.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/MethodName.php	2018-04-11 04:50:36.000000000 +0000
@@ -30,6 +30,7 @@ class MethodName extends StatelessInvoca
 
     /**
      * @param  Constraint|string
+     * @param mixed $constraint
      *
      * @throws Constraint
      * @throws \PHPUnit\Framework\Exception
@@ -56,7 +57,7 @@ class MethodName extends StatelessInvoca
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         return 'method name ' . $this->constraint->toString();
     }
diff -pruN 5.0.6-1/src/Matcher/Parameters.php 6.1.1-1/src/Matcher/Parameters.php
--- 5.0.6-1/src/Matcher/Parameters.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher/Parameters.php	2018-04-11 04:50:36.000000000 +0000
@@ -60,7 +60,7 @@ class Parameters extends StatelessInvoca
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         $text = 'with parameter';
 
@@ -78,9 +78,9 @@ class Parameters extends StatelessInvoca
     /**
      * @param BaseInvocation $invocation
      *
-     * @return bool
-     *
      * @throws \Exception
+     *
+     * @return bool
      */
     public function matches(BaseInvocation $invocation)
     {
@@ -103,9 +103,9 @@ class Parameters extends StatelessInvoca
      * does the matcher will get the invoked() method called which should check
      * if an expectation is met.
      *
-     * @return bool
-     *
      * @throws ExpectationFailedException
+     *
+     * @return bool
      */
     public function verify()
     {
@@ -150,9 +150,9 @@ class Parameters extends StatelessInvoca
     }
 
     /**
-     * @return bool
-     *
      * @throws ExpectationFailedException
+     *
+     * @return bool
      */
     private function guardAgainstDuplicateEvaluationOfParameterConstraints()
     {
diff -pruN 5.0.6-1/src/Matcher.php 6.1.1-1/src/Matcher.php
--- 5.0.6-1/src/Matcher.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Matcher.php	2018-04-11 04:50:36.000000000 +0000
@@ -37,7 +37,7 @@ class Matcher implements MatcherInvocati
     /**
      * @var mixed
      */
-    private $afterMatchBuilderId = null;
+    private $afterMatchBuilderId;
 
     /**
      * @var bool
@@ -47,17 +47,17 @@ class Matcher implements MatcherInvocati
     /**
      * @var MethodName
      */
-    private $methodNameMatcher = null;
+    private $methodNameMatcher;
 
     /**
      * @var Parameters
      */
-    private $parametersMatcher = null;
+    private $parametersMatcher;
 
     /**
      * @var Stub
      */
-    private $stub = null;
+    private $stub;
 
     /**
      * @param MatcherInvocation $invocationMatcher
@@ -115,11 +115,11 @@ class Matcher implements MatcherInvocati
     /**
      * @param Invocation $invocation
      *
-     * @return mixed
-     *
      * @throws \Exception
      * @throws RuntimeException
      * @throws ExpectationFailedException
+     *
+     * @return mixed
      */
     public function invoked(Invocation $invocation)
     {
@@ -183,10 +183,10 @@ class Matcher implements MatcherInvocati
     /**
      * @param Invocation $invocation
      *
-     * @return bool
-     *
      * @throws RuntimeException
      * @throws ExpectationFailedException
+     *
+     * @return bool
      */
     public function matches(Invocation $invocation)
     {
@@ -292,7 +292,7 @@ class Matcher implements MatcherInvocati
     /**
      * @return string
      */
-    public function toString()
+    public function toString(): string
     {
         $list = [];
 
diff -pruN 5.0.6-1/src/MockBuilder.php 6.1.1-1/src/MockBuilder.php
--- 5.0.6-1/src/MockBuilder.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/MockBuilder.php	2018-04-11 04:50:36.000000000 +0000
@@ -74,7 +74,7 @@ class MockBuilder
     /**
      * @var object
      */
-    private $proxyTarget = null;
+    private $proxyTarget;
 
     /**
      * @var bool
@@ -82,6 +82,11 @@ class MockBuilder
     private $allowMockingUnknownTypes = true;
 
     /**
+     * @var bool
+     */
+    private $returnValueGeneration = true;
+
+    /**
      * @var Generator
      */
     private $generator;
@@ -115,7 +120,8 @@ class MockBuilder
             $this->cloneArguments,
             $this->callOriginalMethods,
             $this->proxyTarget,
-            $this->allowMockingUnknownTypes
+            $this->allowMockingUnknownTypes,
+            $this->returnValueGeneration
         );
 
         $this->testCase->registerMockObject($object);
@@ -172,7 +178,7 @@ class MockBuilder
     /**
      * Specifies the subset of methods to mock. Default is to mock none of them.
      *
-     * @param array|null $methods
+     * @param null|array $methods
      *
      * @return MockBuilder
      */
@@ -386,4 +392,24 @@ class MockBuilder
 
         return $this;
     }
+
+    /**
+     * @return MockBuilder
+     */
+    public function enableAutoReturnValueGeneration()
+    {
+        $this->returnValueGeneration = true;
+
+        return $this;
+    }
+
+    /**
+     * @return MockBuilder
+     */
+    public function disableAutoReturnValueGeneration()
+    {
+        $this->returnValueGeneration = false;
+
+        return $this;
+    }
 }
diff -pruN 5.0.6-1/src/MockObject.php 6.1.1-1/src/MockObject.php
--- 5.0.6-1/src/MockObject.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/MockObject.php	2018-04-11 04:50:36.000000000 +0000
@@ -21,16 +21,8 @@ use PHPUnit\Framework\MockObject\Matcher
 interface PHPUnit_Framework_MockObject_MockObject /*extends Verifiable*/
 {
     /**
-     * Registers a new expectation in the mock object and returns the match
-     * object which can be infused with further details.
+     * @param mixed $originalObject
      *
-     * @param Invocation $matcher
-     *
-     * @return InvocationMocker
-     */
-    public function expects(Invocation $matcher);
-
-    /**
      * @return InvocationMocker
      */
     public function __phpunit_setOriginalObject($originalObject);
@@ -52,4 +44,16 @@ interface PHPUnit_Framework_MockObject_M
      * @return bool
      */
     public function __phpunit_hasMatchers();
+
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration);
+
+    /**
+     * Registers a new expectation in the mock object and returns the match
+     * object which can be infused with further details.
+     *
+     * @param Invocation $matcher
+     *
+     * @return InvocationMocker
+     */
+    public function expects(Invocation $matcher);
 }
diff -pruN 5.0.6-1/src/Stub/ConsecutiveCalls.php 6.1.1-1/src/Stub/ConsecutiveCalls.php
--- 5.0.6-1/src/Stub/ConsecutiveCalls.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Stub/ConsecutiveCalls.php	2018-04-11 04:50:36.000000000 +0000
@@ -44,7 +44,7 @@ class ConsecutiveCalls implements Stub
         return $this->value;
     }
 
-    public function toString()
+    public function toString(): string
     {
         $exporter = new Exporter;
 
diff -pruN 5.0.6-1/src/Stub/Exception.php 6.1.1-1/src/Stub/Exception.php
--- 5.0.6-1/src/Stub/Exception.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Stub/Exception.php	2018-04-11 04:50:36.000000000 +0000
@@ -30,7 +30,7 @@ class Exception implements Stub
         throw $this->exception;
     }
 
-    public function toString()
+    public function toString(): string
     {
         $exporter = new Exporter;
 
diff -pruN 5.0.6-1/src/Stub/ReturnArgument.php 6.1.1-1/src/Stub/ReturnArgument.php
--- 5.0.6-1/src/Stub/ReturnArgument.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Stub/ReturnArgument.php	2018-04-11 04:50:36.000000000 +0000
@@ -36,7 +36,7 @@ class ReturnArgument implements Stub
         return;
     }
 
-    public function toString()
+    public function toString(): string
     {
         return \sprintf('return argument #%d', $this->argumentIndex);
     }
diff -pruN 5.0.6-1/src/Stub/ReturnCallback.php 6.1.1-1/src/Stub/ReturnCallback.php
--- 5.0.6-1/src/Stub/ReturnCallback.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Stub/ReturnCallback.php	2018-04-11 04:50:36.000000000 +0000
@@ -26,7 +26,7 @@ class ReturnCallback implements Stub
         return \call_user_func_array($this->callback, $invocation->getParameters());
     }
 
-    public function toString()
+    public function toString(): string
     {
         if (\is_array($this->callback)) {
             if (\is_object($this->callback[0])) {
diff -pruN 5.0.6-1/src/Stub/ReturnReference.php 6.1.1-1/src/Stub/ReturnReference.php
--- 5.0.6-1/src/Stub/ReturnReference.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Stub/ReturnReference.php	2018-04-11 04:50:36.000000000 +0000
@@ -33,7 +33,7 @@ class ReturnReference implements Stub
         return $this->reference;
     }
 
-    public function toString()
+    public function toString(): string
     {
         $exporter = new Exporter;
 
diff -pruN 5.0.6-1/src/Stub/ReturnSelf.php 6.1.1-1/src/Stub/ReturnSelf.php
--- 5.0.6-1/src/Stub/ReturnSelf.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Stub/ReturnSelf.php	2018-04-11 04:50:36.000000000 +0000
@@ -31,7 +31,7 @@ class ReturnSelf implements Stub
         return $invocation->getObject();
     }
 
-    public function toString()
+    public function toString(): string
     {
         return 'return the current object';
     }
diff -pruN 5.0.6-1/src/Stub/ReturnStub.php 6.1.1-1/src/Stub/ReturnStub.php
--- 5.0.6-1/src/Stub/ReturnStub.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Stub/ReturnStub.php	2018-04-11 04:50:36.000000000 +0000
@@ -33,7 +33,7 @@ class ReturnStub implements Stub
         return $this->value;
     }
 
-    public function toString()
+    public function toString(): string
     {
         $exporter = new Exporter;
 
diff -pruN 5.0.6-1/src/Stub/ReturnValueMap.php 6.1.1-1/src/Stub/ReturnValueMap.php
--- 5.0.6-1/src/Stub/ReturnValueMap.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/src/Stub/ReturnValueMap.php	2018-04-11 04:50:36.000000000 +0000
@@ -46,7 +46,7 @@ class ReturnValueMap implements Stub
         return;
     }
 
-    public function toString()
+    public function toString(): string
     {
         return 'return value from a map';
     }
diff -pruN 5.0.6-1/tests/Builder/InvocationMockerTest.php 6.1.1-1/tests/Builder/InvocationMockerTest.php
--- 5.0.6-1/tests/Builder/InvocationMockerTest.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Builder/InvocationMockerTest.php	2018-04-11 04:50:36.000000000 +0000
@@ -65,7 +65,7 @@ class InvocationMockerTest extends TestC
              ->method('foo')
              ->willReturnReference($value);
 
-        $this->assertSame(null, $mock->foo());
+        $this->assertNull($mock->foo());
         $value = 'foo';
         $this->assertSame('foo', $mock->foo());
         $value = 'bar';
diff -pruN 5.0.6-1/tests/_fixture/ExampleTrait.php 6.1.1-1/tests/_fixture/ExampleTrait.php
--- 5.0.6-1/tests/_fixture/ExampleTrait.php	1970-01-01 00:00:00.000000000 +0000
+++ 6.1.1-1/tests/_fixture/ExampleTrait.php	2018-04-11 04:50:36.000000000 +0000
@@ -0,0 +1,8 @@
+<?php
+trait ExampleTrait
+{
+    public function ohHai()
+    {
+        return __FUNCTION__;
+    }
+}
diff -pruN 5.0.6-1/tests/_fixture/ExceptionWithThrowable.php 6.1.1-1/tests/_fixture/ExceptionWithThrowable.php
--- 5.0.6-1/tests/_fixture/ExceptionWithThrowable.php	1970-01-01 00:00:00.000000000 +0000
+++ 6.1.1-1/tests/_fixture/ExceptionWithThrowable.php	2018-04-11 04:50:36.000000000 +0000
@@ -0,0 +1,5 @@
+<?php
+interface ExceptionWithThrowable extends \Throwable
+{
+}
+
diff -pruN 5.0.6-1/tests/Generator/232.phpt 6.1.1-1/tests/Generator/232.phpt
--- 5.0.6-1/tests/Generator/232.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/232.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 trait BaseTrait
@@ -44,7 +44,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -52,12 +52,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['speak'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -66,7 +67,7 @@ class MockFoo extends Foo implements PHP
 
     public function speak()
     {
-        $arguments = array();
+        $arguments = [];
         $count     = func_num_args();
 
         if ($count > 0) {
@@ -93,9 +94,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -103,10 +105,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
@@ -126,4 +133,3 @@ class MockFoo extends Foo implements PHP
         }
     }
 }
-
diff -pruN 5.0.6-1/tests/Generator/397.phpt 6.1.1-1/tests/Generator/397.phpt
--- 5.0.6-1/tests/Generator/397.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/397.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -22,12 +22,13 @@ $mock = $generator->generate(
 );
 
 print $mock['code'];
---EXPECTF--
+--EXPECT--
 class MockC extends C implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['m'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -36,7 +37,7 @@ class MockC extends C implements PHPUnit
 
     public function m(?C $other): C
     {
-        $arguments = array($other);
+        $arguments = [$other];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -63,9 +64,10 @@ class MockC extends C implements PHPUnit
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -73,10 +75,15 @@ class MockC extends C implements PHPUnit
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/abstract_class.phpt 6.1.1-1/tests/Generator/abstract_class.phpt
--- 5.0.6-1/tests/Generator/abstract_class.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/abstract_class.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 abstract class Foo
@@ -19,7 +19,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -27,12 +27,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['one', 'two', 'three'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -41,7 +42,7 @@ class MockFoo extends Foo implements PHP
 
     public function one()
     {
-        $arguments = array();
+        $arguments = [];
         $count     = func_num_args();
 
         if ($count > 0) {
@@ -63,7 +64,7 @@ class MockFoo extends Foo implements PHP
 
     public function two()
     {
-        $arguments = array();
+        $arguments = [];
         $count     = func_num_args();
 
         if ($count > 0) {
@@ -85,7 +86,7 @@ class MockFoo extends Foo implements PHP
 
     protected function three()
     {
-        $arguments = array();
+        $arguments = [];
         $count     = func_num_args();
 
         if ($count > 0) {
@@ -112,9 +113,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -122,10 +124,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_call_parent_clone.phpt 6.1.1-1/tests/Generator/class_call_parent_clone.phpt
--- 5.0.6-1/tests/Generator/class_call_parent_clone.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_call_parent_clone.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 class Foo
@@ -15,19 +15,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -42,9 +43,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -52,10 +54,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_call_parent_constructor.phpt 6.1.1-1/tests/Generator/class_call_parent_constructor.phpt
--- 5.0.6-1/tests/Generator/class_call_parent_constructor.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_call_parent_constructor.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 class Foo
@@ -15,19 +15,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -41,9 +42,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -51,10 +53,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_dont_call_parent_clone.phpt 6.1.1-1/tests/Generator/class_dont_call_parent_clone.phpt
--- 5.0.6-1/tests/Generator/class_dont_call_parent_clone.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_dont_call_parent_clone.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', false)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', false)
 --FILE--
 <?php
 class Foo
@@ -15,19 +15,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     false
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -41,9 +42,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -51,10 +53,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_dont_call_parent_constructor.phpt 6.1.1-1/tests/Generator/class_dont_call_parent_constructor.phpt
--- 5.0.6-1/tests/Generator/class_dont_call_parent_constructor.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_dont_call_parent_constructor.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 class Foo
@@ -15,19 +15,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -41,9 +42,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -51,10 +53,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_implementing_interface_call_parent_constructor.phpt 6.1.1-1/tests/Generator/class_implementing_interface_call_parent_constructor.phpt
--- 5.0.6-1/tests/Generator/class_implementing_interface_call_parent_constructor.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_implementing_interface_call_parent_constructor.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 interface IFoo
@@ -20,19 +20,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -46,9 +47,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -56,10 +58,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_implementing_interface_dont_call_parent_constructor.phpt 6.1.1-1/tests/Generator/class_implementing_interface_dont_call_parent_constructor.phpt
--- 5.0.6-1/tests/Generator/class_implementing_interface_dont_call_parent_constructor.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_implementing_interface_dont_call_parent_constructor.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 interface IFoo
@@ -20,19 +20,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -46,9 +47,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -56,10 +58,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_partial.phpt 6.1.1-1/tests/Generator/class_partial.phpt
--- 5.0.6-1/tests/Generator/class_partial.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_partial.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -27,12 +27,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -41,7 +42,7 @@ class MockFoo extends Foo implements PHP
 
     public function bar(Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -68,9 +69,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -78,10 +80,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class.phpt 6.1.1-1/tests/Generator/class.phpt
--- 5.0.6-1/tests/Generator/class.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 class Foo
@@ -19,7 +19,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -27,12 +27,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar', 'baz'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -41,7 +42,7 @@ class MockFoo extends Foo implements PHP
 
     public function bar(Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -63,7 +64,7 @@ class MockFoo extends Foo implements PHP
 
     public function baz(Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -90,9 +91,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -100,10 +102,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_with_deprecated_method.phpt 6.1.1-1/tests/Generator/class_with_deprecated_method.phpt
--- 5.0.6-1/tests/Generator/class_with_deprecated_method.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_with_deprecated_method.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('ClassWithDeprecatedMethod', array(), 'MockFoo', TRUE, TRUE)
+\PHPUnit\Framework\MockObject\Generator::generate('ClassWithDeprecatedMethod', [], 'MockFoo', TRUE, TRUE)
 --FILE--
 <?php
 class ClassWithDeprecatedMethod
@@ -19,7 +19,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
   'ClassWithDeprecatedMethod',
-  array(),
+  [],
   'MockFoo',
   TRUE,
   TRUE
@@ -27,12 +27,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends ClassWithDeprecatedMethod implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['deprecatedmethod'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -43,7 +44,7 @@ class MockFoo extends ClassWithDeprecate
     {
         @trigger_error('The ClassWithDeprecatedMethod::deprecatedMethod method is deprecated (this method is deprecated).', E_USER_DEPRECATED);
 
-        $arguments = array();
+        $arguments = [];
         $count     = func_num_args();
 
         if ($count > 0) {
@@ -70,9 +71,10 @@ class MockFoo extends ClassWithDeprecate
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -80,10 +82,15 @@ class MockFoo extends ClassWithDeprecate
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_with_method_named_method.phpt 6.1.1-1/tests/Generator/class_with_method_named_method.phpt
--- 5.0.6-1/tests/Generator/class_with_method_named_method.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_with_method_named_method.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 class Foo
@@ -15,7 +15,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -23,12 +23,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['method'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -37,7 +38,7 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $arguments = array();
+        $arguments = [];
         $count     = func_num_args();
 
         if ($count > 0) {
@@ -67,10 +68,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt 6.1.1-1/tests/Generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt
--- 5.0.6-1/tests/Generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_with_method_with_nullable_typehinted_variadic_arguments.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,9 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('ClassWithMethodWithVariadicArguments', array(), 'MockFoo', true, true)
---SKIPIF--
-<?php
-if (!version_compare(PHP_VERSION, '7.1', '>=')) print 'skip: PHP >= 7.1 required';
-?>
+\PHPUnit\Framework\MockObject\Generator::generate('ClassWithMethodWithVariadicArguments', [], 'MockFoo', true, true)
 --FILE--
 <?php
 class ClassWithMethodWithNullableTypehintedVariadicArguments
@@ -19,7 +15,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'ClassWithMethodWithNullableTypehintedVariadicArguments',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -27,12 +23,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends ClassWithMethodWithNullableTypehintedVariadicArguments implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['methodwithnullabletypehintedvariadicarguments'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -41,7 +38,7 @@ class MockFoo extends ClassWithMethodWit
 
     public function methodWithNullableTypehintedVariadicArguments($a, ?string ...$parameters)
     {
-        $arguments = array($a);
+        $arguments = [$a];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -68,9 +65,10 @@ class MockFoo extends ClassWithMethodWit
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -78,10 +76,15 @@ class MockFoo extends ClassWithMethodWit
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_with_method_with_typehinted_variadic_arguments.phpt 6.1.1-1/tests/Generator/class_with_method_with_typehinted_variadic_arguments.phpt
--- 5.0.6-1/tests/Generator/class_with_method_with_typehinted_variadic_arguments.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_with_method_with_typehinted_variadic_arguments.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('ClassWithMethodWithVariadicArguments', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('ClassWithMethodWithVariadicArguments', [], 'MockFoo', true, true)
 --FILE--
 <?php
 class ClassWithMethodWithTypehintedVariadicArguments
@@ -15,7 +15,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'ClassWithMethodWithTypehintedVariadicArguments',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -23,12 +23,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends ClassWithMethodWithTypehintedVariadicArguments implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['methodwithtypehintedvariadicarguments'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -37,7 +38,7 @@ class MockFoo extends ClassWithMethodWit
 
     public function methodWithTypehintedVariadicArguments($a, string ...$parameters)
     {
-        $arguments = array($a);
+        $arguments = [$a];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -64,9 +65,10 @@ class MockFoo extends ClassWithMethodWit
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -74,10 +76,15 @@ class MockFoo extends ClassWithMethodWit
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/class_with_method_with_variadic_arguments.phpt 6.1.1-1/tests/Generator/class_with_method_with_variadic_arguments.phpt
--- 5.0.6-1/tests/Generator/class_with_method_with_variadic_arguments.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/class_with_method_with_variadic_arguments.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('ClassWithMethodWithVariadicArguments', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('ClassWithMethodWithVariadicArguments', [], 'MockFoo', true, true)
 --FILE--
 <?php
 class ClassWithMethodWithVariadicArguments
@@ -15,7 +15,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'ClassWithMethodWithVariadicArguments',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -23,12 +23,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends ClassWithMethodWithVariadicArguments implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['methodwithvariadicarguments'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -37,7 +38,7 @@ class MockFoo extends ClassWithMethodWit
 
     public function methodWithVariadicArguments($a, ...$parameters)
     {
-        $arguments = array($a);
+        $arguments = [$a];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -64,9 +65,10 @@ class MockFoo extends ClassWithMethodWit
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -74,10 +76,15 @@ class MockFoo extends ClassWithMethodWit
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/interface.phpt 6.1.1-1/tests/Generator/interface.phpt
--- 5.0.6-1/tests/Generator/interface.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/interface.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 interface Foo
@@ -13,7 +13,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -21,12 +21,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -35,7 +36,7 @@ class MockFoo implements PHPUnit\Framewo
 
     public function bar(Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -62,9 +63,10 @@ class MockFoo implements PHPUnit\Framewo
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -72,10 +74,15 @@ class MockFoo implements PHPUnit\Framewo
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/invocation_object_clone_object.phpt 6.1.1-1/tests/Generator/invocation_object_clone_object.phpt
--- 5.0.6-1/tests/Generator/invocation_object_clone_object.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/invocation_object_clone_object.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true, true)
 --FILE--
 <?php
 class Foo
@@ -19,7 +19,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true,
@@ -28,12 +28,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar', 'baz'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -42,7 +43,7 @@ class MockFoo extends Foo implements PHP
 
     public function bar(Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -64,7 +65,7 @@ class MockFoo extends Foo implements PHP
 
     public function baz(Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -91,9 +92,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -101,10 +103,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/namespaced_class_call_parent_clone.phpt 6.1.1-1/tests/Generator/namespaced_class_call_parent_clone.phpt
--- 5.0.6-1/tests/Generator/namespaced_class_call_parent_clone.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/namespaced_class_call_parent_clone.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 namespace NS;
@@ -17,19 +17,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NS\Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -44,9 +45,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -54,10 +56,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/namespaced_class_call_parent_constructor.phpt 6.1.1-1/tests/Generator/namespaced_class_call_parent_constructor.phpt
--- 5.0.6-1/tests/Generator/namespaced_class_call_parent_constructor.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/namespaced_class_call_parent_constructor.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 namespace NS;
@@ -17,19 +17,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NS\Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -43,9 +44,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -53,10 +55,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/namespaced_class_dont_call_parent_clone.phpt 6.1.1-1/tests/Generator/namespaced_class_dont_call_parent_clone.phpt
--- 5.0.6-1/tests/Generator/namespaced_class_dont_call_parent_clone.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/namespaced_class_dont_call_parent_clone.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', array(), 'MockFoo', false)
+\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', false)
 --FILE--
 <?php
 namespace NS;
@@ -17,19 +17,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NS\Foo',
-    array(),
+    [],
     'MockFoo',
     false
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -43,9 +44,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -53,10 +55,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/namespaced_class_dont_call_parent_constructor.phpt 6.1.1-1/tests/Generator/namespaced_class_dont_call_parent_constructor.phpt
--- 5.0.6-1/tests/Generator/namespaced_class_dont_call_parent_constructor.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/namespaced_class_dont_call_parent_constructor.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 namespace NS;
@@ -17,19 +17,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NS\Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -43,9 +44,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -53,10 +55,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/namespaced_class_implementing_interface_call_parent_constructor.phpt 6.1.1-1/tests/Generator/namespaced_class_implementing_interface_call_parent_constructor.phpt
--- 5.0.6-1/tests/Generator/namespaced_class_implementing_interface_call_parent_constructor.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/namespaced_class_implementing_interface_call_parent_constructor.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 namespace NS;
@@ -22,19 +22,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NS\Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -48,9 +49,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -58,10 +60,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt 6.1.1-1/tests/Generator/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt
--- 5.0.6-1/tests/Generator/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', array(), 'MockFoo', true)
+\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true)
 --FILE--
 <?php
 namespace NS;
@@ -22,19 +22,20 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NS\Foo',
-    array(),
+    [],
     'MockFoo',
     true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -48,9 +49,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -58,10 +60,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/namespaced_class_partial.phpt 6.1.1-1/tests/Generator/namespaced_class_partial.phpt
--- 5.0.6-1/tests/Generator/namespaced_class_partial.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/namespaced_class_partial.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -29,12 +29,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -43,7 +44,7 @@ class MockFoo extends NS\Foo implements
 
     public function bar(NS\Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -70,9 +71,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -80,10 +82,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/namespaced_class.phpt 6.1.1-1/tests/Generator/namespaced_class.phpt
--- 5.0.6-1/tests/Generator/namespaced_class.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/namespaced_class.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 namespace NS;
@@ -21,7 +21,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NS\Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -29,12 +29,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar', 'baz'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -43,7 +44,7 @@ class MockFoo extends NS\Foo implements
 
     public function bar(NS\Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -65,7 +66,7 @@ class MockFoo extends NS\Foo implements
 
     public function baz(NS\Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -92,9 +93,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -102,10 +104,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/namespaced_interface.phpt 6.1.1-1/tests/Generator/namespaced_interface.phpt
--- 5.0.6-1/tests/Generator/namespaced_interface.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/namespaced_interface.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('NS\Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 namespace NS;
@@ -15,7 +15,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NS\Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -23,12 +23,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo implements PHPUnit\Framework\MockObject\MockObject, NS\Foo
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -37,7 +38,7 @@ class MockFoo implements PHPUnit\Framewo
 
     public function bar(NS\Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -64,9 +65,10 @@ class MockFoo implements PHPUnit\Framewo
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -74,10 +76,15 @@ class MockFoo implements PHPUnit\Framewo
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/nonexistent_class.phpt 6.1.1-1/tests/Generator/nonexistent_class.phpt
--- 5.0.6-1/tests/Generator/nonexistent_class.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/nonexistent_class.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('NonExistentClass', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('NonExistentClass', [], 'MockFoo', true, true)
 --FILE--
 <?php
 require __DIR__ . '/../../vendor/autoload.php';
@@ -8,7 +8,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NonExistentClass',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -16,7 +16,7 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class NonExistentClass
 {
 }
@@ -26,6 +26,7 @@ class MockFoo extends NonExistentClass i
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -39,9 +40,10 @@ class MockFoo extends NonExistentClass i
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -49,10 +51,15 @@ class MockFoo extends NonExistentClass i
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/nonexistent_class_with_namespace.phpt 6.1.1-1/tests/Generator/nonexistent_class_with_namespace.phpt
--- 5.0.6-1/tests/Generator/nonexistent_class_with_namespace.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/nonexistent_class_with_namespace.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 require __DIR__ . '/../../vendor/autoload.php';
@@ -8,7 +8,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'NS\Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -16,7 +16,7 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 namespace NS {
 
 class Foo
@@ -32,6 +32,7 @@ class MockFoo extends NS\Foo implements
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -45,9 +46,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -55,10 +57,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/nonexistent_class_with_namespace_starting_with_separator.phpt 6.1.1-1/tests/Generator/nonexistent_class_with_namespace_starting_with_separator.phpt
--- 5.0.6-1/tests/Generator/nonexistent_class_with_namespace_starting_with_separator.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/nonexistent_class_with_namespace_starting_with_separator.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 require __DIR__ . '/../../vendor/autoload.php';
@@ -8,7 +8,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     '\NS\Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -16,7 +16,7 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 namespace NS {
 
 class Foo
@@ -32,6 +32,7 @@ class MockFoo extends NS\Foo implements
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = [];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -45,9 +46,10 @@ class MockFoo extends NS\Foo implements
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -55,10 +57,15 @@ class MockFoo extends NS\Foo implements
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/nullable_types.phpt 6.1.1-1/tests/Generator/nullable_types.phpt
--- 5.0.6-1/tests/Generator/nullable_types.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/nullable_types.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,9 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
---SKIPIF--
-<?php
-if (!version_compare(PHP_VERSION, '7.1', '>=')) print 'skip: PHP >= 7.1 required';
-?>
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 class Foo
@@ -19,7 +15,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -27,12 +23,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -41,7 +38,7 @@ class MockFoo extends Foo implements PHP
 
     public function bar(?int $x)
     {
-        $arguments = array($x);
+        $arguments = [$x];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -68,9 +65,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -78,10 +76,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/proxy.phpt 6.1.1-1/tests/Generator/proxy.phpt
--- 5.0.6-1/tests/Generator/proxy.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/proxy.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -18,17 +18,18 @@ require __DIR__ . '/../../vendor/autoloa
 $generator = new \PHPUnit\Framework\MockObject\Generator;
 
 $mock = $generator->generate(
-    'Foo', array(), 'ProxyFoo', true, true, true, true
+    'Foo', [], 'ProxyFoo', true, true, true, true
 );
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class ProxyFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar', 'baz'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -37,7 +38,7 @@ class ProxyFoo extends Foo implements PH
 
     public function bar(Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -59,7 +60,7 @@ class ProxyFoo extends Foo implements PH
 
     public function baz(Foo $foo)
     {
-        $arguments = array($foo);
+        $arguments = [$foo];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -86,9 +87,10 @@ class ProxyFoo extends Foo implements PH
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -96,10 +98,15 @@ class ProxyFoo extends Foo implements PH
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/return_type_declarations_closure.phpt 6.1.1-1/tests/Generator/return_type_declarations_closure.phpt
--- 5.0.6-1/tests/Generator/return_type_declarations_closure.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/return_type_declarations_closure.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 interface Foo
@@ -13,7 +13,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -21,12 +21,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -35,7 +36,7 @@ class MockFoo implements PHPUnit\Framewo
 
     public function bar(): Closure
     {
-        $arguments = array();
+        $arguments = [];
         $count     = func_num_args();
 
         if ($count > 0) {
@@ -62,9 +63,10 @@ class MockFoo implements PHPUnit\Framewo
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -72,10 +74,15 @@ class MockFoo implements PHPUnit\Framewo
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/return_type_declarations_final.phpt 6.1.1-1/tests/Generator/return_type_declarations_final.phpt
--- 5.0.6-1/tests/Generator/return_type_declarations_final.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/return_type_declarations_final.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,9 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
---SKIPIF--
-<?php
-if (!version_compare(PHP_VERSION, '7.0', '>=')) print 'skip: PHP >= 7.0 required';
-?>
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 final class FinalClass
@@ -24,7 +20,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -32,12 +28,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -46,7 +43,7 @@ class MockFoo extends Foo implements PHP
 
     public function bar(): FinalClass
     {
-        $arguments = array();
+        $arguments = [];
         $count     = func_num_args();
 
         if ($count > 0) {
@@ -73,9 +70,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -83,10 +81,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/return_type_declarations_generator.phpt 6.1.1-1/tests/Generator/return_type_declarations_generator.phpt
--- 5.0.6-1/tests/Generator/return_type_declarations_generator.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/return_type_declarations_generator.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 interface Foo
@@ -13,7 +13,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -21,12 +21,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -35,7 +36,7 @@ class MockFoo implements PHPUnit\Framewo
 
     public function bar(): Generator
     {
-        $arguments = array();
+        $arguments = [];
         $count     = func_num_args();
 
         if ($count > 0) {
@@ -62,9 +63,10 @@ class MockFoo implements PHPUnit\Framewo
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -72,10 +74,15 @@ class MockFoo implements PHPUnit\Framewo
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/return_type_declarations_nullable.phpt 6.1.1-1/tests/Generator/return_type_declarations_nullable.phpt
--- 5.0.6-1/tests/Generator/return_type_declarations_nullable.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/return_type_declarations_nullable.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,9 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
---SKIPIF--
-<?php
-if (!version_compare(PHP_VERSION, '7.1', '>=')) print 'skip: PHP >= 7.1 required';
-?>
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 interface Foo
@@ -17,7 +13,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -25,12 +21,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -39,7 +36,7 @@ class MockFoo implements PHPUnit\Framewo
 
     public function bar(string $baz): ?string
     {
-        $arguments = array($baz);
+        $arguments = [$baz];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -66,9 +63,10 @@ class MockFoo implements PHPUnit\Framewo
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -76,10 +74,15 @@ class MockFoo implements PHPUnit\Framewo
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/return_type_declarations_object_method.phpt 6.1.1-1/tests/Generator/return_type_declarations_object_method.phpt
--- 5.0.6-1/tests/Generator/return_type_declarations_object_method.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/return_type_declarations_object_method.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 class Foo
@@ -16,7 +16,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -24,12 +24,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -38,7 +39,7 @@ class MockFoo extends Foo implements PHP
 
     public function bar(string $baz): Bar
     {
-        $arguments = array($baz);
+        $arguments = [$baz];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -65,9 +66,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -75,10 +77,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/return_type_declarations_parent.phpt 6.1.1-1/tests/Generator/return_type_declarations_parent.phpt
--- 5.0.6-1/tests/Generator/return_type_declarations_parent.phpt	1970-01-01 00:00:00.000000000 +0000
+++ 6.1.1-1/tests/Generator/return_type_declarations_parent.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -0,0 +1,110 @@
+--TEST--
+\PHPUnit\Framework\MockObject\Generator::generate('Bar', [], 'MockBar', true, true)
+--FILE--
+<?php
+abstract class Foo
+{
+    abstract public function baz();
+}
+
+class Bar extends Foo
+{
+    public function baz(): parent
+    {
+    }
+}
+
+require __DIR__ . '/../../vendor/autoload.php';
+
+$generator = new \PHPUnit\Framework\MockObject\Generator;
+
+$mock = $generator->generate(
+    'Bar',
+    [],
+    'MockBar',
+    true,
+    true
+);
+
+print $mock['code'];
+--EXPECT--
+class MockBar extends Bar implements PHPUnit\Framework\MockObject\MockObject
+{
+    private $__phpunit_invocationMocker;
+    private $__phpunit_originalObject;
+    private $__phpunit_configurable = ['baz'];
+    private $__phpunit_returnValueGeneration = true;
+
+    public function __clone()
+    {
+        $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
+    }
+
+    public function baz(): Foo
+    {
+        $arguments = [];
+        $count     = func_num_args();
+
+        if ($count > 0) {
+            $_arguments = func_get_args();
+
+            for ($i = 0; $i < $count; $i++) {
+                $arguments[] = $_arguments[$i];
+            }
+        }
+
+        $result = $this->__phpunit_getInvocationMocker()->invoke(
+            new \PHPUnit\Framework\MockObject\Invocation\ObjectInvocation(
+                'Bar', 'baz', $arguments, 'Foo', $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([$expects, 'method'], func_get_args());
+    }
+
+    public function __phpunit_setOriginalObject($originalObject)
+    {
+        $this->__phpunit_originalObject = $originalObject;
+    }
+
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
+    public function __phpunit_getInvocationMocker()
+    {
+        if ($this->__phpunit_invocationMocker === null) {
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
+        }
+
+        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;
+        }
+    }
+}
diff -pruN 5.0.6-1/tests/Generator/return_type_declarations_self.phpt 6.1.1-1/tests/Generator/return_type_declarations_self.phpt
--- 5.0.6-1/tests/Generator/return_type_declarations_self.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/return_type_declarations_self.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 interface Foo
@@ -13,7 +13,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -21,12 +21,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -35,7 +36,7 @@ class MockFoo implements PHPUnit\Framewo
 
     public function bar(string $baz): Foo
     {
-        $arguments = array($baz);
+        $arguments = [$baz];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -62,9 +63,10 @@ class MockFoo implements PHPUnit\Framewo
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -72,10 +74,15 @@ class MockFoo implements PHPUnit\Framewo
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/return_type_declarations_static_method.phpt 6.1.1-1/tests/Generator/return_type_declarations_static_method.phpt
--- 5.0.6-1/tests/Generator/return_type_declarations_static_method.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/return_type_declarations_static_method.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 class Foo
@@ -16,7 +16,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -24,12 +24,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -48,9 +49,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -58,10 +60,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/return_type_declarations_void.phpt 6.1.1-1/tests/Generator/return_type_declarations_void.phpt
--- 5.0.6-1/tests/Generator/return_type_declarations_void.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/return_type_declarations_void.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,9 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
---SKIPIF--
-<?php
-if (!version_compare(PHP_VERSION, '7.1', '>=')) print 'skip: PHP >= 7.1 required';
-?>
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 interface Foo
@@ -17,7 +13,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -25,12 +21,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -39,7 +36,7 @@ class MockFoo implements PHPUnit\Framewo
 
     public function bar(string $baz): void
     {
-        $arguments = array($baz);
+        $arguments = [$baz];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -64,9 +61,10 @@ class MockFoo implements PHPUnit\Framewo
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -74,10 +72,15 @@ class MockFoo implements PHPUnit\Framewo
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/scalar_type_declarations.phpt 6.1.1-1/tests/Generator/scalar_type_declarations.phpt
--- 5.0.6-1/tests/Generator/scalar_type_declarations.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/scalar_type_declarations.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -1,5 +1,5 @@
 --TEST--
-\PHPUnit\Framework\MockObject\Generator::generate('Foo', array(), 'MockFoo', true, true)
+\PHPUnit\Framework\MockObject\Generator::generate('Foo', [], 'MockFoo', true, true)
 --FILE--
 <?php
 class Foo
@@ -15,7 +15,7 @@ $generator = new \PHPUnit\Framework\Mock
 
 $mock = $generator->generate(
     'Foo',
-    array(),
+    [],
     'MockFoo',
     true,
     true
@@ -23,12 +23,13 @@ $mock = $generator->generate(
 
 print $mock['code'];
 ?>
---EXPECTF--
+--EXPECT--
 class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
 {
     private $__phpunit_invocationMocker;
     private $__phpunit_originalObject;
     private $__phpunit_configurable = ['bar'];
+    private $__phpunit_returnValueGeneration = true;
 
     public function __clone()
     {
@@ -37,7 +38,7 @@ class MockFoo extends Foo implements PHP
 
     public function bar(string $baz)
     {
-        $arguments = array($baz);
+        $arguments = [$baz];
         $count     = func_num_args();
 
         if ($count > 1) {
@@ -64,9 +65,10 @@ class MockFoo extends Foo implements PHP
 
     public function method()
     {
-        $any = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
+        $any     = new \PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount;
         $expects = $this->expects($any);
-        return call_user_func_array(array($expects, 'method'), func_get_args());
+
+        return call_user_func_array([$expects, 'method'], func_get_args());
     }
 
     public function __phpunit_setOriginalObject($originalObject)
@@ -74,10 +76,15 @@ class MockFoo extends Foo implements PHP
         $this->__phpunit_originalObject = $originalObject;
     }
 
+    public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
+    {
+        $this->__phpunit_returnValueGeneration = $returnValueGeneration;
+    }
+
     public function __phpunit_getInvocationMocker()
     {
         if ($this->__phpunit_invocationMocker === null) {
-            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable);
+            $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
         }
 
         return $this->__phpunit_invocationMocker;
diff -pruN 5.0.6-1/tests/Generator/wsdl_class_namespace.phpt 6.1.1-1/tests/Generator/wsdl_class_namespace.phpt
--- 5.0.6-1/tests/Generator/wsdl_class_namespace.phpt	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Generator/wsdl_class_namespace.phpt	2018-04-11 04:50:36.000000000 +0000
@@ -3,7 +3,6 @@
 --SKIPIF--
 <?php
 if (!extension_loaded('soap')) echo 'skip: SOAP extension is required';
-?>
 --FILE--
 <?php
 require __DIR__ . '/../../vendor/autoload.php';
diff -pruN 5.0.6-1/tests/GeneratorTest.php 6.1.1-1/tests/GeneratorTest.php
--- 5.0.6-1/tests/GeneratorTest.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/GeneratorTest.php	2018-04-11 04:50:36.000000000 +0000
@@ -59,9 +59,6 @@ class GeneratorTest extends TestCase
         $this->generator->getMock(stdClass::class, ['foo', 'bar', 'foo']);
     }
 
-    /**
-     * @requires PHP 7
-     */
     public function testGetMockBlacklistedMethodNamesPhp7()
     {
         $mock = $this->generator->getMock(InterfaceWithSemiReservedMethodName::class);
@@ -176,9 +173,6 @@ class GeneratorTest extends TestCase
         $this->generator->getMock(stdClass::class, [], [], '', false, true, true, true, true);
     }
 
-    /**
-     * @requires PHP 7
-     */
     public function testCanImplementInterfacesThatHaveMethodsWithReturnTypes()
     {
         $stub = $this->generator->getMock([AnInterfaceWithReturnType::class, AnInterface::class]);
@@ -207,4 +201,13 @@ class GeneratorTest extends TestCase
 
         $this->assertNull($mock->someMethod());
     }
+
+    public function testMockingOfThrowable()
+    {
+        $stub = $this->generator->getMock(ExceptionWithThrowable::class);
+
+        $this->assertInstanceOf(ExceptionWithThrowable::class, $stub);
+        $this->assertInstanceOf(Exception::class, $stub);
+        $this->assertInstanceOf(MockObject::class, $stub);
+    }
 }
diff -pruN 5.0.6-1/tests/Invocation/StaticInvocationTest.php 6.1.1-1/tests/Invocation/StaticInvocationTest.php
--- 5.0.6-1/tests/Invocation/StaticInvocationTest.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/Invocation/StaticInvocationTest.php	2018-04-11 04:50:36.000000000 +0000
@@ -96,4 +96,19 @@ class StaticInvocationTest extends TestC
 
         $this->assertSame($expectedReturnType, $invocation->getReturnType());
     }
+
+    public function testToStringWillReturnEmptyString()
+    {
+        $expectedReturnType = 'string';
+
+        $invocation = new StaticInvocation(
+            'FooClass',
+            '__toString',
+            [],
+            ''
+        );
+
+        $this->assertSame($expectedReturnType, $invocation->getReturnType());
+        $this->assertSame('', $invocation->generateReturnValue());
+    }
 }
diff -pruN 5.0.6-1/tests/MockBuilderTest.php 6.1.1-1/tests/MockBuilderTest.php
--- 5.0.6-1/tests/MockBuilderTest.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/MockBuilderTest.php	2018-04-11 04:50:36.000000000 +0000
@@ -17,7 +17,7 @@ class MockBuilderTest extends TestCase
     {
         $mock = $this->getMockBuilder(Mockable::class)->getMock();
 
-        $this->assertTrue($mock instanceof Mockable);
+        $this->assertInstanceOf(Mockable::class, $mock);
     }
 
     public function testByDefaultMocksAllMethods()
@@ -71,7 +71,7 @@ class MockBuilderTest extends TestCase
                      ->setMockClassName('ACustomClassName')
                      ->getMock();
 
-        $this->assertTrue($mock instanceof ACustomClassName);
+        $this->assertInstanceOf(ACustomClassName::class, $mock);
     }
 
     public function testConstructorArgumentsCanBeSpecified()
@@ -124,6 +124,6 @@ class MockBuilderTest extends TestCase
                      ->disableOriginalClone()
                      ->disableAutoload();
 
-        $this->assertTrue($spec instanceof MockBuilder);
+        $this->assertInstanceOf(MockBuilder::class, $spec);
     }
 }
diff -pruN 5.0.6-1/tests/MockObjectTest.php 6.1.1-1/tests/MockObjectTest.php
--- 5.0.6-1/tests/MockObjectTest.php	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/tests/MockObjectTest.php	2018-04-11 04:50:36.000000000 +0000
@@ -229,7 +229,7 @@ class MockObjectTest extends TestCase
 
         $this->assertEquals('d', $mock->doSomething('a', 'b', 'c'));
         $this->assertEquals('h', $mock->doSomething('e', 'f', 'g'));
-        $this->assertEquals(null, $mock->doSomething('foo', 'bar'));
+        $this->assertNull($mock->doSomething('foo', 'bar'));
 
         $mock = $this->getMockBuilder(AnInterface::class)
                      ->getMock();
@@ -240,7 +240,7 @@ class MockObjectTest extends TestCase
 
         $this->assertEquals('d', $mock->doSomething('a', 'b', 'c'));
         $this->assertEquals('h', $mock->doSomething('e', 'f', 'g'));
-        $this->assertEquals(null, $mock->doSomething('foo', 'bar'));
+        $this->assertNull($mock->doSomething('foo', 'bar'));
     }
 
     public function testStubbedReturnArgument()
@@ -598,7 +598,7 @@ class MockObjectTest extends TestCase
 
         $mock->doSomethingElse($expectedObject);
 
-        $this->assertEquals(1, count($actualArguments));
+        $this->assertCount(1, $actualArguments);
         $this->assertEquals($expectedObject, $actualArguments[0]);
         $this->assertNotSame($expectedObject, $actualArguments[0]);
     }
@@ -626,7 +626,7 @@ class MockObjectTest extends TestCase
 
         $mock->doSomethingElse($expectedObject);
 
-        $this->assertEquals(1, count($actualArguments));
+        $this->assertCount(1, $actualArguments);
         $this->assertSame($expectedObject, $actualArguments[0]);
     }
 
@@ -733,7 +733,8 @@ class MockObjectTest extends TestCase
                 ' Array (' . PHP_EOL .
                 '-    0 => \'first\'' . PHP_EOL .
                 '-    1 => \'second\'' . PHP_EOL .
-                '+    0 => \'second\'' . PHP_EOL,
+                '+    0 => \'second\'' . PHP_EOL .
+                ' )' . PHP_EOL,
                 $e->getMessage()
             );
         }
@@ -1051,9 +1052,41 @@ class MockObjectTest extends TestCase
         $this->assertInstanceOf(MockObject::class, $stub->methodWithClassReturnTypeDeclaration());
     }
 
-    /**
-     * @requires PHP 7.1
-     */
+    public function testDisableAutomaticReturnValueGeneration()
+    {
+        $mock = $this->getMockBuilder(SomeClass::class)
+            ->disableAutoReturnValueGeneration()
+            ->getMock();
+
+        $this->expectException(ExpectationFailedException::class);
+        $this->expectExceptionMessage(
+            'Return value inference disabled and no expectation set up for SomeClass::doSomethingElse()'
+        );
+
+        $mock->doSomethingElse(1);
+    }
+
+    public function testDisableAutomaticReturnValueGenerationWithToString()
+    {
+        $mock = $this->getMockBuilder(StringableClass::class)
+            ->disableAutoReturnValueGeneration()
+            ->getMock();
+
+        (string) $mock;
+
+        try {
+            $mock->__phpunit_verify();
+            $this->fail('Exception expected');
+        } catch (ExpectationFailedException $e) {
+            $this->assertSame(
+                'Return value inference disabled and no expectation set up for StringableClass::__toString()',
+                $e->getMessage()
+            );
+        }
+
+        $this->resetMockObjects();
+    }
+
     public function testVoidReturnTypeIsMockedCorrectly()
     {
         /** @var ClassWithAllPossibleReturnTypes|MockObject $stub */
@@ -1072,4 +1105,11 @@ class MockObjectTest extends TestCase
 
         $this->assertInstanceOf(stdClass::class, $stub->methodWithObjectReturnTypeDeclaration());
     }
+
+    public function testGetObjectForTrait()
+    {
+        $object = $this->getObjectForTrait(ExampleTrait::class);
+
+        $this->assertSame('ohHai', $object->ohHai());
+    }
 }
diff -pruN 5.0.6-1/.travis.yml 6.1.1-1/.travis.yml
--- 5.0.6-1/.travis.yml	2018-01-06 05:45:45.000000000 +0000
+++ 6.1.1-1/.travis.yml	2018-04-11 04:50:36.000000000 +0000
@@ -3,7 +3,6 @@ language: php
 sudo: false
 
 php:
-  - 7.0
   - 7.1
   - 7.2
   - master
