Move into nested docroot
This commit is contained in:
parent
83a0d3a149
commit
c8b70abde9
13405 changed files with 0 additions and 0 deletions
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject
232.phpt
Invocation
Matcher
abstract_class.phptclass.phptclass_call_parent_clone.phptclass_call_parent_constructor.phptclass_dont_call_parent_clone.phptclass_dont_call_parent_constructor.phptclass_implementing_interface_call_parent_constructor.phptclass_implementing_interface_dont_call_parent_constructor.phptclass_partial.phptclass_with_method_named_method.phptclass_with_method_with_variadic_arguments.phptinterface.phptinvocation_object_clone_object.phptnamespaced_class.phptnamespaced_class_call_parent_clone.phptnamespaced_class_call_parent_constructor.phptnamespaced_class_dont_call_parent_clone.phptnamespaced_class_dont_call_parent_constructor.phptnamespaced_class_implementing_interface_call_parent_constructor.phptnamespaced_class_implementing_interface_dont_call_parent_constructor.phptnamespaced_class_partial.phptnamespaced_interface.phptnonexistent_class.phptnonexistent_class_with_namespace.phptnonexistent_class_with_namespace_starting_with_separator.phptproxy.phptscalar_type_declarations.phptwsdl_class.phptwsdl_class_namespace.phptwsdl_class_partial.phpt
129
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/232.phpt
vendored
Normal file
129
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/232.phpt
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (version_compare(PHP_VERSION, '5.4.0', '<')) print 'skip: PHP >= 5.4.0 required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
trait BaseTrait
|
||||
{
|
||||
protected function hello()
|
||||
{
|
||||
return 'hello';
|
||||
}
|
||||
}
|
||||
|
||||
trait ChildTrait
|
||||
{
|
||||
use BaseTrait
|
||||
{
|
||||
hello as private hi;
|
||||
}
|
||||
|
||||
protected function hello()
|
||||
{
|
||||
return 'hi';
|
||||
}
|
||||
|
||||
protected function world()
|
||||
{
|
||||
return $this->hi();
|
||||
}
|
||||
}
|
||||
|
||||
class Foo
|
||||
{
|
||||
use ChildTrait;
|
||||
|
||||
public function speak()
|
||||
{
|
||||
return $this->world();
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function speak()
|
||||
{
|
||||
$arguments = array();
|
||||
$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_Object(
|
||||
'Foo', 'speak', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
||||
|
85
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/Invocation/ObjectTest.php
vendored
Normal file
85
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/Invocation/ObjectTest.php
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
|
||||
class Framework_MockObject_Invocation_ObjectTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testConstructorRequiresClassAndMethodAndParametersAndObject()
|
||||
{
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
array('an_argument'),
|
||||
new StdClass
|
||||
);
|
||||
}
|
||||
|
||||
public function testAllowToGetClassNameSetInConstructor()
|
||||
{
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
array('an_argument'),
|
||||
new StdClass
|
||||
);
|
||||
|
||||
$this->assertSame('FooClass', $invocation->className);
|
||||
}
|
||||
|
||||
public function testAllowToGetMethodNameSetInConstructor()
|
||||
{
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
array('an_argument'),
|
||||
new StdClass
|
||||
);
|
||||
|
||||
$this->assertSame('FooMethod', $invocation->methodName);
|
||||
}
|
||||
|
||||
public function testAllowToGetObjectSetInConstructor()
|
||||
{
|
||||
$expectedObject = new StdClass;
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
array('an_argument'),
|
||||
$expectedObject
|
||||
);
|
||||
|
||||
$this->assertSame($expectedObject, $invocation->object);
|
||||
}
|
||||
|
||||
public function testAllowToGetMethodParametersSetInConstructor()
|
||||
{
|
||||
$expectedParameters = array(
|
||||
'foo', 5, array('a', 'b'), new StdClass, null, false
|
||||
);
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
$expectedParameters,
|
||||
new StdClass
|
||||
);
|
||||
|
||||
$this->assertSame($expectedParameters, $invocation->parameters);
|
||||
}
|
||||
|
||||
public function testConstructorAllowToSetFlagCloneObjectsInParameters()
|
||||
{
|
||||
$parameters = array(new StdClass);
|
||||
$cloneObjects = true;
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
$parameters,
|
||||
new StdClass,
|
||||
$cloneObjects
|
||||
);
|
||||
|
||||
$this->assertEquals($parameters, $invocation->parameters);
|
||||
$this->assertNotSame($parameters, $invocation->parameters);
|
||||
}
|
||||
}
|
54
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/Invocation/StaticTest.php
vendored
Normal file
54
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/Invocation/StaticTest.php
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
class Framework_MockObject_Invocation_StaticTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testConstructorRequiresClassAndMethodAndParameters()
|
||||
{
|
||||
new PHPUnit_Framework_MockObject_Invocation_Static('FooClass', 'FooMethod', array('an_argument'));
|
||||
}
|
||||
|
||||
public function testAllowToGetClassNameSetInConstructor()
|
||||
{
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Static('FooClass', 'FooMethod', array('an_argument'));
|
||||
|
||||
$this->assertSame('FooClass', $invocation->className);
|
||||
}
|
||||
|
||||
public function testAllowToGetMethodNameSetInConstructor()
|
||||
{
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Static('FooClass', 'FooMethod', array('an_argument'));
|
||||
|
||||
$this->assertSame('FooMethod', $invocation->methodName);
|
||||
}
|
||||
|
||||
public function testAllowToGetMethodParametersSetInConstructor()
|
||||
{
|
||||
$expectedParameters = array(
|
||||
'foo', 5, array('a', 'b'), new StdClass, null, false
|
||||
);
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
$expectedParameters
|
||||
);
|
||||
|
||||
$this->assertSame($expectedParameters, $invocation->parameters);
|
||||
}
|
||||
|
||||
public function testConstructorAllowToSetFlagCloneObjectsInParameters()
|
||||
{
|
||||
$parameters = array(new StdClass);
|
||||
$cloneObjects = true;
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
$parameters,
|
||||
$cloneObjects
|
||||
);
|
||||
|
||||
$this->assertEquals($parameters, $invocation->parameters);
|
||||
$this->assertNotSame($parameters, $invocation->parameters);
|
||||
}
|
||||
}
|
45
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/Matcher/ConsecutiveParametersTest.php
vendored
Normal file
45
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/Matcher/ConsecutiveParametersTest.php
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
class Framework_MockObject_Matcher_ConsecutiveParametersTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testIntegration()
|
||||
{
|
||||
$mock = $this->getMock('stdClass', array('foo'));
|
||||
$mock
|
||||
->expects($this->any())
|
||||
->method('foo')
|
||||
->withConsecutive(
|
||||
array('bar'),
|
||||
array(21, 42)
|
||||
);
|
||||
$mock->foo('bar');
|
||||
$mock->foo(21, 42);
|
||||
}
|
||||
|
||||
public function testIntegrationWithLessAssertionsThenMethodCalls()
|
||||
{
|
||||
$mock = $this->getMock('stdClass', array('foo'));
|
||||
$mock
|
||||
->expects($this->any())
|
||||
->method('foo')
|
||||
->withConsecutive(
|
||||
array('bar')
|
||||
);
|
||||
$mock->foo('bar');
|
||||
$mock->foo(21, 42);
|
||||
}
|
||||
|
||||
public function testIntegrationExpectingException()
|
||||
{
|
||||
$mock = $this->getMock('stdClass', array('foo'));
|
||||
$mock
|
||||
->expects($this->any())
|
||||
->method('foo')
|
||||
->withConsecutive(
|
||||
array('bar'),
|
||||
array(21, 42)
|
||||
);
|
||||
$mock->foo('bar');
|
||||
$this->setExpectedException('PHPUnit_Framework_ExpectationFailedException');
|
||||
$mock->foo('invalid');
|
||||
}
|
||||
}
|
143
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/abstract_class.phpt
vendored
Normal file
143
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/abstract_class.phpt
vendored
Normal file
|
@ -0,0 +1,143 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
abstract class Foo
|
||||
{
|
||||
public function one()
|
||||
{
|
||||
}
|
||||
|
||||
abstract public function two();
|
||||
|
||||
abstract protected function three();
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function one()
|
||||
{
|
||||
$arguments = array();
|
||||
$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_Object(
|
||||
'Foo', 'one', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function two()
|
||||
{
|
||||
$arguments = array();
|
||||
$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_Object(
|
||||
'Foo', 'two', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function three()
|
||||
{
|
||||
$arguments = array();
|
||||
$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_Object(
|
||||
'Foo', 'three', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
121
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class.phpt
vendored
Normal file
121
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class.phpt
vendored
Normal file
|
@ -0,0 +1,121 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
}
|
||||
|
||||
public function baz(Foo $foo)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'Foo', 'bar', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function baz(Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'Foo', 'baz', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
73
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_call_parent_clone.phpt
vendored
Normal file
73
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_call_parent_clone.phpt
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function __clone()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
parent::__clone();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
72
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_call_parent_constructor.phpt
vendored
Normal file
72
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_call_parent_constructor.phpt
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
72
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_dont_call_parent_clone.phpt
vendored
Normal file
72
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_dont_call_parent_clone.phpt
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', FALSE)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function __clone()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
FALSE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
72
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_dont_call_parent_constructor.phpt
vendored
Normal file
72
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_dont_call_parent_constructor.phpt
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
interface IFoo
|
||||
{
|
||||
public function __construct($bar);
|
||||
}
|
||||
|
||||
class Foo implements IFoo
|
||||
{
|
||||
public function __construct($bar)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
interface IFoo
|
||||
{
|
||||
public function __construct($bar);
|
||||
}
|
||||
|
||||
class Foo implements IFoo
|
||||
{
|
||||
public function __construct($bar)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
99
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_partial.phpt
vendored
Normal file
99
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_partial.phpt
vendored
Normal file
|
@ -0,0 +1,99 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array('bar'), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
}
|
||||
|
||||
public function baz(Foo $foo)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array('bar'),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'Foo', 'bar', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
88
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_with_method_named_method.phpt
vendored
Normal file
88
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_with_method_named_method.phpt
vendored
Normal file
|
@ -0,0 +1,88 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function method()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$arguments = array();
|
||||
$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_Object(
|
||||
'Foo', 'method', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('ClassWithMethodWithVariadicArguments', array(), 'MockFoo', TRUE, TRUE)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (version_compare(PHP_VERSION, '5.6.0', '<')) print 'skip: PHP >= 5.6.0 required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class ClassWithMethodWithVariadicArguments
|
||||
{
|
||||
public function methodWithVariadicArguments($a, ...$parameters)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'ClassWithMethodWithVariadicArguments',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends ClassWithMethodWithVariadicArguments implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function methodWithVariadicArguments($a, ...$parameters)
|
||||
{
|
||||
$arguments = array($a);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'ClassWithMethodWithVariadicArguments', 'methodWithVariadicArguments', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
93
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/interface.phpt
vendored
Normal file
93
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/interface.phpt
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
interface Foo
|
||||
{
|
||||
public function bar(Foo $foo);
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo implements PHPUnit_Framework_MockObject_MockObject, Foo
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'Foo', 'bar', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
122
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/invocation_object_clone_object.phpt
vendored
Normal file
122
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/invocation_object_clone_object.phpt
vendored
Normal file
|
@ -0,0 +1,122 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
}
|
||||
|
||||
public function baz(Foo $foo)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'Foo', 'bar', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function baz(Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'Foo', 'baz', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
123
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/namespaced_class.phpt
vendored
Normal file
123
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/namespaced_class.phpt
vendored
Normal file
|
@ -0,0 +1,123 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace NS;
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
}
|
||||
|
||||
public function baz(Foo $foo)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new \PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(NS\Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'NS\Foo', 'bar', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function baz(NS\Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'NS\Foo', 'baz', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
75
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/namespaced_class_call_parent_clone.phpt
vendored
Normal file
75
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/namespaced_class_call_parent_clone.phpt
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace NS;
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function __clone()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new \PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
parent::__clone();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace NS;
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new \PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', FALSE)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace NS;
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function __clone()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new \PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
FALSE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace NS;
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new \PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace NS;
|
||||
|
||||
interface IFoo
|
||||
{
|
||||
public function __construct($bar);
|
||||
}
|
||||
|
||||
class Foo implements IFoo
|
||||
{
|
||||
public function __construct($bar)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new \PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace NS;
|
||||
|
||||
interface IFoo
|
||||
{
|
||||
public function __construct($bar);
|
||||
}
|
||||
|
||||
class Foo implements IFoo
|
||||
{
|
||||
public function __construct($bar)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new \PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
101
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/namespaced_class_partial.phpt
vendored
Normal file
101
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/namespaced_class_partial.phpt
vendored
Normal file
|
@ -0,0 +1,101 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array('bar'), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace NS;
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
}
|
||||
|
||||
public function baz(Foo $foo)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new \PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array('bar'),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(NS\Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'NS\Foo', 'bar', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
95
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/namespaced_interface.phpt
vendored
Normal file
95
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/namespaced_interface.phpt
vendored
Normal file
|
@ -0,0 +1,95 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace NS;
|
||||
|
||||
interface Foo
|
||||
{
|
||||
public function bar(Foo $foo);
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new \PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo implements PHPUnit_Framework_MockObject_MockObject, NS\Foo
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(NS\Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'NS\Foo', 'bar', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
70
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/nonexistent_class.phpt
vendored
Normal file
70
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/nonexistent_class.phpt
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('NonExistentClass', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NonExistentClass',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class NonExistentClass
|
||||
{
|
||||
}
|
||||
|
||||
class MockFoo extends NonExistentClass implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
78
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/nonexistent_class_with_namespace.phpt
vendored
Normal file
78
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/nonexistent_class_with_namespace.phpt
vendored
Normal file
|
@ -0,0 +1,78 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
namespace NS {
|
||||
|
||||
class Foo
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'\NS\Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
namespace NS {
|
||||
|
||||
class Foo
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
117
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/proxy.phpt
vendored
Normal file
117
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/proxy.phpt
vendored
Normal file
|
@ -0,0 +1,117 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', NULL, 'ProxyFoo', TRUE, TRUE, TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
}
|
||||
|
||||
public function baz(Foo $foo)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo', array(), 'ProxyFoo', TRUE, TRUE, TRUE, TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class ProxyFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'Foo', 'bar', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return call_user_func_array(array($this->__phpunit_originalObject, "bar"), $arguments);
|
||||
}
|
||||
|
||||
public function baz(Foo $foo)
|
||||
{
|
||||
$arguments = array($foo);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'Foo', 'baz', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return call_user_func_array(array($this->__phpunit_originalObject, "baz"), $arguments);
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
99
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/scalar_type_declarations.phpt
vendored
Normal file
99
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/scalar_type_declarations.phpt
vendored
Normal file
|
@ -0,0 +1,99 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!method_exists('ReflectionParameter', 'hasType')) print 'skip: PHP >= 7.0.0 required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function bar(string $baz)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'Foo',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(string $baz)
|
||||
{
|
||||
$arguments = array($baz);
|
||||
$count = func_num_args();
|
||||
|
||||
if ($count > 1) {
|
||||
$_arguments = func_get_args();
|
||||
|
||||
for ($i = 1; $i < $count; $i++) {
|
||||
$arguments[] = $_arguments[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->__phpunit_getInvocationMocker()->invoke(
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'Foo', 'bar', $arguments, $this, TRUE
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(array($expects, 'method'), func_get_args());
|
||||
}
|
||||
|
||||
public function __phpunit_setOriginalObject($originalObject)
|
||||
{
|
||||
$this->__phpunit_originalObject = $originalObject;
|
||||
}
|
||||
|
||||
public function __phpunit_getInvocationMocker()
|
||||
{
|
||||
if ($this->__phpunit_invocationMocker === NULL) {
|
||||
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify()
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
$this->__phpunit_invocationMocker = NULL;
|
||||
}
|
||||
}
|
37
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/wsdl_class.phpt
vendored
Normal file
37
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/wsdl_class.phpt
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl('GoogleSearch.wsdl', 'GoogleSearch')
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('soap')) echo 'skip: SOAP extension is required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
print $generator->generateClassFromWsdl(
|
||||
dirname(dirname(__FILE__)) . '/_fixture/GoogleSearch.wsdl',
|
||||
'GoogleSearch'
|
||||
);
|
||||
?>
|
||||
--EXPECTF--
|
||||
class GoogleSearch extends \SoapClient
|
||||
{
|
||||
public function __construct($wsdl, array $options)
|
||||
{
|
||||
parent::__construct('%s/GoogleSearch.wsdl', $options);
|
||||
}
|
||||
|
||||
public function doGoogleSearch($key, $q, $start, $maxResults, $filter, $restrict, $safeSearch, $lr, $ie, $oe)
|
||||
{
|
||||
}
|
||||
|
||||
public function doGetCachedPage($key, $url)
|
||||
{
|
||||
}
|
||||
|
||||
public function doSpellingSuggestion($key, $phrase)
|
||||
{
|
||||
}
|
||||
}
|
39
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/wsdl_class_namespace.phpt
vendored
Normal file
39
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/wsdl_class_namespace.phpt
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl('GoogleSearch.wsdl', 'GoogleSearch')
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('soap')) echo 'skip: SOAP extension is required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
print $generator->generateClassFromWsdl(
|
||||
dirname(dirname(__FILE__)) . '/_fixture/GoogleSearch.wsdl',
|
||||
'My\\Space\\GoogleSearch'
|
||||
);
|
||||
?>
|
||||
--EXPECTF--
|
||||
namespace My\Space;
|
||||
|
||||
class GoogleSearch extends \SoapClient
|
||||
{
|
||||
public function __construct($wsdl, array $options)
|
||||
{
|
||||
parent::__construct('%s/GoogleSearch.wsdl', $options);
|
||||
}
|
||||
|
||||
public function doGoogleSearch($key, $q, $start, $maxResults, $filter, $restrict, $safeSearch, $lr, $ie, $oe)
|
||||
{
|
||||
}
|
||||
|
||||
public function doGetCachedPage($key, $url)
|
||||
{
|
||||
}
|
||||
|
||||
public function doSpellingSuggestion($key, $phrase)
|
||||
{
|
||||
}
|
||||
}
|
30
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/wsdl_class_partial.phpt
vendored
Normal file
30
web/vendor/phpunit/phpunit-mock-objects/tests/MockObject/wsdl_class_partial.phpt
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generateClassFromWsdl('GoogleSearch.wsdl', 'GoogleSearch', array('doGoogleSearch'))
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('soap')) echo 'skip: SOAP extension is required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
print $generator->generateClassFromWsdl(
|
||||
dirname(dirname(__FILE__)) . '/_fixture/GoogleSearch.wsdl',
|
||||
'GoogleSearch',
|
||||
array('doGoogleSearch')
|
||||
);
|
||||
?>
|
||||
--EXPECTF--
|
||||
class GoogleSearch extends \SoapClient
|
||||
{
|
||||
public function __construct($wsdl, array $options)
|
||||
{
|
||||
parent::__construct('%s/GoogleSearch.wsdl', $options);
|
||||
}
|
||||
|
||||
public function doGoogleSearch($key, $q, $start, $maxResults, $filter, $restrict, $safeSearch, $lr, $ie, $oe)
|
||||
{
|
||||
}
|
||||
}
|
Reference in a new issue