When run codeception i got a lots fo errors: DeepCopy\DeepCopy::recursiveCopy.
This is a problem so confuse me!


Here is the code :
public function testGetComplexItemNeeds() {
$this->specify('[getComplexItemNeeds] : ', function($expected) {
$actual = \common\services\ConfigService::getComplexItemNeeds('300001');
expect('getComplexItemNeeds', $actual)->equals($expected);
}, ['examples' => [
[0 => [
'gold' => 1,
'list' => [
300018 => 1,
],
]
],
]]);
}
php_error.log:
PHP 195. DeepCopy\DeepCopy::copyArray($array = array ('0000000025e4802e0000000050ab4f11' => class tests\codeception\frontend\UnitTester { protected $scenario = class Codeception\Scenario { ... }; protected $friends = array (...) }, '0000000025e480490000000050ab4f11' => class Codeception\Scenario { protected $test = class tests\codeception\frontend\service\ConfigServiceTest { ... }; protected $steps = array (...);
xdebug:
i use xdebug to trace the problem found that when the function specifyCloneProperties deep copy the unitTester the php script down.
You can turn off deep clone in your bootstrap.php file:
<?php
// disable deep cloning of properties inside specify block
\Codeception\Specify\Config::setDeepClone(false);
?>
Or turn on/off in the test. It's also increased performance of your tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With