change getDouble add constructor args - #130
Conversation
Change to be able to specify the "array" in the third argument of the "getDouble method"
|
@ytetsuro Maybe you should change "getDouble" like this: <?php
public function getDouble($classname, $params, $enable_constructor = false, $constructor_args = [])and then describe as follows <?php
public function test_parse_csv()
{
// set constructor args
$spl_mock = $this->getDobule('SplFileObject', [
'current' => ['foo', 'bar'],
'next' => NULL
], true, ['php://memory']);
} |
|
@tianhe1986 Yeah, it is better. Because But do we really need this? We don't have to use |
change attribute name
I'm sorry.
I think this is very rare cases. |
If i want to create a " Mock " on "SplFileObject" this feature was thought that want .
LogicException: The parent constructor was not called: the object is in an invalid state
_RuntimeException: SplFileObject::_construct() expects at least 1 parameter, 0 given
Therefore , I want to describe as follows .