Initial Commit
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
{prologue}{class_declaration}
|
||||
{
|
||||
private static $__phpunit_staticInvocationMocker;
|
||||
private $__phpunit_invocationMocker;
|
||||
|
||||
{clone}{mocked_methods}
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return self::__phpunit_getStaticInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public static function __phpunit_getStaticInvocationMocker()
|
||||
{
|
||||
if (self::$__phpunit_staticInvocationMocker === NULL) {
|
||||
self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return self::$__phpunit_staticInvocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return self::__phpunit_getStaticInvocationMocker()->hasMatchers() ||
|
||||
$this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
self::__phpunit_getStaticInvocationMocker()->verify();
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
}
|
||||
|
||||
public function __phpunit_cleanup()
|
||||
{
|
||||
self::$__phpunit_staticInvocationMocker = NULL;
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}{epilogue}
|
||||
@@ -0,0 +1,4 @@
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
{modifier} function {reference}{method_name}({arguments_decl})
|
||||
{
|
||||
$arguments = array({arguments_call});
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > {arguments_count}) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = {arguments_count}; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'{class_name}', '{method_name}', $arguments, $this, {clone_arguments}
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
{modifier} static function {reference}{method_name}({arguments_decl})
|
||||
{
|
||||
$arguments = array({arguments_call});
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > {arguments_count}) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = {arguments_count}; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = self::__phpunit_getStaticInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
'{class_name}', '{method_name}', $arguments, {clone_arguments}
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class {class_name}
|
||||
{
|
||||
use {trait_name};
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
parent::__clone();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{namespace}
|
||||
|
||||
class {class_name} extends \SOAPClient
|
||||
{
|
||||
public function __construct($wsdl, array $options)
|
||||
{
|
||||
parent::__construct('{wsdl}', $options);
|
||||
}
|
||||
{methods}}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
public function {method_name}({arguments})
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user