first commit
This commit is contained in:
.travis.ymlCOPYINGMakefileREADME.mdphpunit.integration.xmlphpunit.xml
appinfo
composer.jsoncomposer.lockcss
img
js
lib
Controller
Db
Helper
Migration
Service
templates
tests
vendor
autoload.php
bin
composer
ClassLoader.phpInstalledVersions.phpLICENSEautoload_classmap.phpautoload_files.phpautoload_namespaces.phpautoload_psr4.phpautoload_real.phpautoload_static.phpinstalled.jsoninstalled.php
doctrine
instantiator
myclabs
deep-copy
.github
LICENSEREADME.mdcomposer.jsonsrc
DeepCopy
DeepCopy.php
Exception
Filter
Matcher
Reflection
TypeFilter
TypeMatcher
deep_copy.phpphpdocumentor
reflection-common
reflection-docblock
LICENSEREADME.mdcomposer.json
src
DocBlock.php
DocBlock
Description.phpDescriptionFactory.phpExampleFinder.phpSerializer.phpStandardTagFactory.phpTag.phpTagFactory.php
DocBlockFactory.phpDocBlockFactoryInterface.phpTags
Exception
Utils.phptype-resolver
LICENSEREADME.mdcomposer.json
src
FqsenResolver.phpPseudoType.php
PseudoTypes
CallableString.phpFalse_.phpHtmlEscapedString.phpIntegerRange.phpList_.phpLiteralString.phpLowercaseString.phpNegativeInteger.phpNonEmptyLowercaseString.phpNonEmptyString.phpNumericString.phpNumeric_.phpPositiveInteger.phpTraitString.phpTrue_.php
Type.phpTypeResolver.phpTypes
AbstractList.phpAggregatedType.phpArrayKey.phpArray_.phpBoolean.phpCallable_.phpClassString.phpCollection.phpCompound.phpContext.phpContextFactory.phpExpression.phpFloat_.phpInteger.phpInterfaceString.phpIntersection.phpIterable_.phpMixed_.phpNever_.phpNull_.phpNullable.phpObject_.phpParent_.phpResource_.phpScalar.phpSelf_.phpStatic_.phpString_.phpThis.phpVoid_.php
phpspec
prophecy
CHANGES.mdLICENSEREADME.mdcomposer.json
src
Prophecy
Argument.php
Argument
Call
Comparator
Doubler
CachedDoubler.php
ClassPatch
ClassPatchInterface.phpDisableConstructorPatch.phpHhvmExceptionPatch.phpKeywordPatch.phpMagicCallPatch.phpProphecySubjectPatch.phpReflectionClassNewInstancePatch.phpSplFileInfoPatch.phpThrowablePatch.phpTraversablePatch.php
DoubleInterface.phpDoubler.phpGenerator
ClassCodeGenerator.phpClassCreator.phpClassMirror.php
LazyDouble.phpNameGenerator.phpNode
ReflectionInterface.phpTypeHintReference.phpException
Call
Doubler
ClassCreatorException.phpClassMirrorException.phpClassNotFoundException.phpDoubleException.phpDoublerException.phpInterfaceNotFoundException.phpMethodNotExtendableException.phpMethodNotFoundException.phpReturnByReferenceException.php
Exception.phpInvalidArgumentException.phpPrediction
AggregateException.phpFailedPredictionException.phpNoCallsException.phpPredictionException.phpUnexpectedCallsCountException.phpUnexpectedCallsException.php
Prophecy
PhpDocumentor
ClassAndInterfaceTagRetriever.phpClassTagRetriever.phpLegacyClassTagRetriever.phpMethodTagRetrieverInterface.php
Prediction
CallPrediction.phpCallTimesPrediction.phpCallbackPrediction.phpNoCallsPrediction.phpPredictionInterface.php
Promise
Prophecy
MethodProphecy.phpObjectProphecy.phpProphecyInterface.phpProphecySubjectInterface.phpRevealer.phpRevealerInterface.php
Prophet.phpUtil
phpunit
php-code-coverage
.gitattributes
.github
.gitignore.php_cs.travis.ymlChangeLog-2.2.mdChangeLog-3.0.mdChangeLog-3.1.mdChangeLog-3.2.mdChangeLog-3.3.mdChangeLog-4.0.mdLICENSEREADME.mdbuild.xmlcomposer.jsonphpunit.xmlsrc
CodeCoverage.php
Driver
Exception
CoveredCodeNotExecutedException.phpException.phpInvalidArgumentException.phpMissingCoversAnnotationException.phpRuntimeException.phpUnintentionallyCoveredCodeException.php
Filter.phpNode
Report
Clover.phpCrap4j.php
Util.phpHtml
Facade.phpRenderer.php
PHP.phpText.phpRenderer
Dashboard.phpDirectory.phpFile.php
Template
coverage_bar.html.dist
css
dashboard.html.distdirectory.html.distdirectory_item.html.distfile.html.distfile_item.html.distfonts
glyphicons-halflings-regular.eotglyphicons-halflings-regular.svgglyphicons-halflings-regular.ttfglyphicons-halflings-regular.woffglyphicons-halflings-regular.woff2
js
method_item.html.distXml
tests
TestCase.php
_files
BankAccount-clover.xmlBankAccount-crap4j.xmlBankAccount-text.txtBankAccount.phpBankAccountTest.phpCoverageClassExtendedTest.phpCoverageClassTest.phpCoverageFunctionParenthesesTest.phpCoverageFunctionParenthesesWhitespaceTest.phpCoverageFunctionTest.phpCoverageMethodOneLineAnnotationTest.phpCoverageMethodParenthesesTest.phpCoverageMethodParenthesesWhitespaceTest.phpCoverageMethodTest.phpCoverageNoneTest.phpCoverageNotPrivateTest.phpCoverageNotProtectedTest.phpCoverageNotPublicTest.phpCoverageNothingTest.phpCoveragePrivateTest.phpCoverageProtectedTest.phpCoveragePublicTest.phpCoverageTwoDefaultClassAnnotations.phpCoveredClass.phpCoveredFunction.phpNamespaceCoverageClassExtendedTest.phpNamespaceCoverageClassTest.phpNamespaceCoverageCoversClassPublicTest.phpNamespaceCoverageCoversClassTest.phpNamespaceCoverageMethodTest.phpNamespaceCoverageNotPrivateTest.phpNamespaceCoverageNotProtectedTest.phpNamespaceCoverageNotPublicTest.phpNamespaceCoveragePrivateTest.phpNamespaceCoverageProtectedTest.phpNamespaceCoveragePublicTest.phpNamespaceCoveredClass.phpNotExistingCoveredElementTest.phpclass-with-anonymous-function-clover.xmlclass-with-anonymous-function-crap4j.xmlclass-with-anonymous-function-text.txtignored-lines-clover.xmlignored-lines-crap4j.xmlignored-lines-text.txtsource_with_class_and_anonymous_function.phpsource_with_ignore.phpsource_with_namespace.phpsource_with_oneline_annotations.phpsource_without_ignore.phpsource_without_namespace.php
bootstrap.phpReport
HTML
CoverageForBankAccount
CoverageForClassWithAnonymousFunction
CoverageForFileWithIgnoredLines
XML
CoverageForBankAccount
CoverageForClassWithAnonymousFunction
CoverageForFileWithIgnoredLines
tests
php-file-iterator
php-text-template
php-timer
php-token-stream
.gitattributes.gitignore.travis.ymlChangeLog.mdLICENSEREADME.mdbuild.xmlcomposer.jsonphpunit.xml
src
tests
Token
TokenTest.php_fixture
classExtendsNamespacedClass.phpclassInNamespace.phpclassInScopedNamespace.phpclassUsesNamespacedFunction.phpclass_with_method_named_empty.phpclass_with_method_that_declares_anonymous_class.phpclass_with_method_that_declares_anonymous_class2.phpclass_with_multiple_anonymous_classes_and_functions.phpclosure.phpissue19.phpissue30.phpmultipleNamespacesWithOneClassUsingBraces.phpmultipleNamespacesWithOneClassUsingNonBraceSyntax.phpphp-code-coverage-issue-424.phpsource.phpsource2.phpsource3.phpsource4.phpsource5.php
bootstrap.phpphpunit-mock-objects
.gitattributes.gitignore.php_cs.travis.ymlCONTRIBUTING.mdLICENSEREADME.mdbuild.xmlcomposer.jsonphpunit.xml
src
Framework
MockObject
Builder
Identity.phpInvocationMocker.phpMatch.phpMethodNameMatch.phpNamespace.phpParametersMatch.phpStub.php
Exception
Generator.phpGenerator
deprecation.tpl.distmocked_class.tpl.distmocked_class_method.tpl.distmocked_clone.tpl.distmocked_method.tpl.distmocked_method_void.tpl.distmocked_static_method.tpl.distproxied_method.tpl.distproxied_method_void.tpl.disttrait_class.tpl.distunmocked_clone.tpl.distwsdl_class.tpl.distwsdl_method.tpl.dist
Invocation.phpInvocation
InvocationMocker.phpInvokable.phpMatcher.phpMatcher
AnyInvokedCount.phpAnyParameters.phpConsecutiveParameters.phpInvocation.phpInvokedAtIndex.phpInvokedAtLeastCount.phpInvokedAtLeastOnce.phpInvokedAtMostCount.phpInvokedCount.phpInvokedRecorder.phpMethodName.phpParameters.phpStatelessInvocation.php
MockBuilder.phpMockObject.phpStub.phpStub
ConsecutiveCalls.phpException.phpMatcherCollection.phpReturn.phpReturnArgument.phpReturnCallback.phpReturnReference.phpReturnSelf.phpReturnValueMap.php
Verifiable.phptests
GeneratorTest.phpMockBuilderTest.phpMockObjectTest.phpProxyObjectTest.php
MockObject
Builder
Generator
232.phptabstract_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.phptnullable_types.phptproxy.phptreturn_type_declarations_nullable.phptreturn_type_declarations_object_method.phptreturn_type_declarations_self.phptreturn_type_declarations_static_method.phptreturn_type_declarations_void.phptscalar_type_declarations.phptwsdl_class.phptwsdl_class_namespace.phptwsdl_class_partial.phpt
Invocation
Matcher
class_with_deprecated_method.phpt_fixture
AbstractMockTestClass.phpAbstractTrait.phpAnInterface.phpAnInterfaceWithReturnType.phpAnotherInterface.phpBar.phpClassThatImplementsSerializable.phpClassWithSelfTypeHint.phpClassWithStaticMethod.phpFoo.phpFunctionCallback.phpGoogleSearch.wsdlInterfaceWithSemiReservedMethodName.phpInterfaceWithStaticMethod.phpMethodCallback.phpMethodCallbackByReference.phpMockTestInterface.phpMockable.phpPartialMockTestClass.phpSingletonClass.phpSomeClass.phpStaticMockTestClass.phpStringableClass.phpTraversableMockTestInterface.php
bootstrap.phpphpunit
.gitattributes
.github
.gitignore.php_cs.dist.stickler.yml.travis.ymlChangeLog-5.7.mdLICENSEREADME.mdbuild.xmlcomposer.jsonphpunitphpunit.xmlphpunit.xsdsrc
Exception.php
Extensions
GroupTestSuite.phpPhptTestCase.phpPhptTestSuite.phpRepeatedTest.phpTestDecorator.phpTicketListener.php
ForwardCompatibility
Assert.phpAssertionFailedError.phpBaseTestListener.phpTest.phpTestCase.phpTestListener.phpTestSuite.php
Framework
Assert.php
Assert
AssertionFailedError.phpBaseTestListener.phpCodeCoverageException.phpConstraint.phpConstraint
And.phpArrayHasKey.phpArraySubset.phpAttribute.phpCallback.phpClassHasAttribute.phpClassHasStaticAttribute.phpComposite.phpCount.phpDirectoryExists.phpException.phpExceptionCode.phpExceptionMessage.phpExceptionMessageRegExp.phpFileExists.phpGreaterThan.phpIsAnything.phpIsEmpty.phpIsEqual.phpIsFalse.phpIsFinite.phpIsIdentical.phpIsInfinite.phpIsInstanceOf.phpIsJson.phpIsNan.phpIsNull.phpIsReadable.phpIsTrue.phpIsType.phpIsWritable.phpJsonMatches.php
CoveredCodeNotExecutedException.phpError.phpJsonMatches
LessThan.phpNot.phpObjectHasAttribute.phpOr.phpPCREMatch.phpSameSize.phpStringContains.phpStringEndsWith.phpStringMatches.phpStringStartsWith.phpTraversableContains.phpTraversableContainsOnly.phpXor.phpError
Exception.phpExceptionWrapper.phpExpectationFailedException.phpIncompleteTest.phpIncompleteTestCase.phpIncompleteTestError.phpInvalidCoversTargetException.phpMissingCoversAnnotationException.phpOutputError.phpRiskyTest.phpRiskyTestError.phpSelfDescribing.phpSkippedTest.phpSkippedTestCase.phpSkippedTestError.phpSkippedTestSuiteError.phpSyntheticError.phpTest.phpTestCase.phpTestFailure.phpTestListener.phpTestResult.phpTestSuite.phpTestSuite
UnintentionallyCoveredCodeError.phpWarning.phpWarningTestCase.phpRunner
TextUI
Util
tests
Extensions
Fail
Framework
AssertTest.phpBaseTestListenerTest.php
Constraint
ArraySubsetTest.phpCountTest.phpExceptionMessageRegExpTest.phpExceptionMessageTest.phpIsJsonTest.php
ConstraintTest.phpSuiteTest.phpTestCaseTest.phpTestFailureTest.phpTestImplementorTest.phpTestListenerTest.phpJsonMatches
JsonMatchesTest.phpRegression
GitHub
1149.phpt
1149
1216.phpt1216
1265.phpt1265
1330.phpt1330
1335.phpt1335
1337.phpt1337
1348.phpt1348
1351.phpt1351
1374.phpt1374
1437.phpt1437
1468.phpt1468
1471.phpt1471
1472.phpt1472
1570.phpt1570
2137-filter.phpt2137-no_filter.phpt2137
2145.phpt2145
2158.phpt2158
2299
2366.phpt2366
2380.phpt2380
2382.phpt2382
2435.phpt2435
244.phpt244
2731.phpt2731
2758.phpt2758
2811.phpt2811
2972.phpt2972
322.phpt322
433.phpt433
445.phpt445
498.phpt498
503.phpt503
581.phpt581
74.phpt74
765.phpt765
797.phpt797
863.phpt873-php5.phpt873-php7.phpt873
Trac
Runner
TextUI
_files
abstract-test-class.phptassertion.phptcode-coverage-ignore.phptcolors-always.phptconcrete-test-class.phptcustom-printer-debug.phptcustom-printer-verbose.phptdataprovider-debug.phptdataprovider-issue-2833.phptdataprovider-issue-2859.phptdataprovider-issue-2922.phptdataprovider-log-xml-isolation.phptdataprovider-log-xml.phptdataprovider-testdox.phptdebug.phptdefault-isolation.phptdefault.phptdependencies-clone.phptdependencies-isolation.phptdependencies.phptdependencies2-isolation.phptdependencies2.phptdependencies3-isolation.phptdependencies3.phptdisable-code-coverage-ignore.phptempty-testcase.phptexception-stack.phptexclude-group-isolation.phptexclude-group.phptfailure-isolation.phptfailure-reverse-list.phptfailure.phptfatal-isolation.phptfilter-class-isolation.phptfilter-class.phptfilter-dataprovider-by-classname-and-range-isolation.phptfilter-dataprovider-by-classname-and-range.phptfilter-dataprovider-by-number-isolation.phptfilter-dataprovider-by-number.phptfilter-dataprovider-by-only-range-isolation.phptfilter-dataprovider-by-only-range.phptfilter-dataprovider-by-only-regexp-isolation.phptfilter-dataprovider-by-only-regexp.phptfilter-dataprovider-by-only-string-isolation.phptfilter-dataprovider-by-only-string.phptfilter-dataprovider-by-range-isolation.phptfilter-dataprovider-by-range.phptfilter-dataprovider-by-regexp-isolation.phptfilter-dataprovider-by-regexp.phptfilter-dataprovider-by-string-isolation.phptfilter-dataprovider-by-string.phptfilter-method-case-insensitive.phptfilter-method-case-sensitive-no-result.phptfilter-method-isolation.phptfilter-method.phptfilter-no-results.phptforward-compatibility.phptgroup-isolation.phptgroup.phpthelp.phpthelp2.phptini-isolation.phptlist-groups.phptlist-suites.phptlog-json-post-66021.phptlog-junit.phptlog-tap.phptlog-teamcity.phptmycommand.phptoptions-after-arguments.phptoutput-isolation.phptphar-extension-suppressed.phptphar-extension.phptphpt-args.phptphpt-env.phptphpt-external.phptphpt-stderr.phptphpt-stdin.phptphpt-xfail.phptrepeat.phptreport-useless-tests-incomplete.phptreport-useless-tests-isolation.phptreport-useless-tests.phptstop-on-warning-via-cli.phptstop-on-warning-via-config.phpttap.phptteamcity-inner-exceptions.phptteamcity.phpttest-suffix-multiple.phpttest-suffix-single.phpttestdox-exclude-group.phpttestdox-group.phpttestdox-html.phpttestdox-text.phpttestdox-xml.phpttestdox.phptUtil
ConfigurationTest.phpGetoptTest.phpGlobalStateTest.phpPHPTest.phpRegexTest.php
TestDox
TestTest.phpXMLTest.php_files
AbstractTest.phpArrayAccessible.phpAssertionExample.phpAssertionExampleTest.phpAuthor.phpBankAccount.phpBankAccountTest.phpBankAccountTest.test.phpBankAccountTest2.phpBaseTestListenerSample.phpBeforeAndAfterTest.phpBeforeClassAndAfterClassTest.phpBeforeClassWithOnlyDataProviderTest.phpBook.phpCalculator.phpChangeCurrentWorkingDirectoryTest.phpClassWithNonPublicAttributes.phpClassWithScalarTypeDeclarations.phpClassWithToString.phpClonedDependencyTest.phpConcreteTest.my.phpConcreteTest.phpCoverageClassExtendedTest.phpCoverageClassTest.phpCoverageFunctionParenthesesTest.phpCoverageFunctionParenthesesWhitespaceTest.phpCoverageFunctionTest.phpCoverageMethodOneLineAnnotationTest.phpCoverageMethodParenthesesTest.phpCoverageMethodParenthesesWhitespaceTest.phpCoverageMethodTest.phpCoverageNamespacedFunctionTest.phpCoverageNoneTest.phpCoverageNotPrivateTest.phpCoverageNotProtectedTest.phpCoverageNotPublicTest.phpCoverageNothingTest.phpCoveragePrivateTest.phpCoverageProtectedTest.phpCoveragePublicTest.phpCoverageTwoDefaultClassAnnotations.phpCoveredClass.phpCoveredFunction.phpCustomPrinter.phpDataProviderDebugTest.phpDataProviderDependencyTest.phpDataProviderFilterTest.phpDataProviderIncompleteTest.php
bootstrap.phpDataProviderIssue2833
DataProviderIssue2859
DataProviderIssue2922
DataProviderSkippedTest.phpDataProviderTest.phpDataProviderTestDoxTest.phpDependencyFailureTest.phpDependencySuccessTest.phpDependencyTestSuite.phpDoubleTestCase.phpDummyException.phpEmptyTestCaseTest.phpExceptionInAssertPostConditionsTest.phpExceptionInAssertPreConditionsTest.phpExceptionInSetUpTest.phpExceptionInTearDownTest.phpExceptionInTest.phpExceptionNamespaceTest.phpExceptionStackTest.phpExceptionTest.phpFailure.phpFailureTest.phpFatalTest.phpIgnoreCodeCoverageClass.phpIgnoreCodeCoverageClassTest.phpIncompleteTest.phpInheritance
InheritedTestCase.phpIniTest.phpIsolationTest.phpJsonData
MockRunner.phpMockable.phpMultiDependencyTest.phpMultipleDataProviderTest.phpMyCommand.phpNamespaceCoverageClassExtendedTest.phpNamespaceCoverageClassTest.phpNamespaceCoverageCoversClassPublicTest.phpNamespaceCoverageCoversClassTest.phpNamespaceCoverageMethodTest.phpNamespaceCoverageNotPrivateTest.phpNamespaceCoverageNotProtectedTest.phpNamespaceCoverageNotPublicTest.phpNamespaceCoveragePrivateTest.phpNamespaceCoverageProtectedTest.phpNamespaceCoveragePublicTest.phpNamespaceCoveredClass.phpNamespaceCoveredFunction.phpNoArgTestCaseTest.phpNoTestCaseClass.phpNoTestCases.phpNonStatic.phpNotExistingCoveredElementTest.phpNotPublicTestCase.phpNotVoidTestCase.phpNothingTest.phpOneTestCase.phpOutputTestCase.phpOverrideTestCase.phpRequirementsClassBeforeClassHookTest.phpRequirementsClassDocBlockTest.phpRequirementsTest.phpSampleArrayAccess.phpSampleClass.phpSingleton.phpStackTest.phpStatusTest.phpStopOnWarningTestSuite.phpStopsOnWarningTest.phpStruct.phpSuccess.phpTemplateMethodsTest.phpTestAutoreferenced.phpTestDoxGroupTest.phpTestGeneratorMaker.phpTestIncomplete.phpTestIterator.phpTestIterator2.phpTestSkipped.phpTestTestError.phpTestWithTest.phpThrowExceptionTestCase.phpThrowNoExceptionTestCase.phpWasRun.phpbar.xmlconfiguration.colors.empty.xmlconfiguration.colors.false.xmlconfiguration.colors.invalid.xmlconfiguration.colors.true.xmlconfiguration.custom-printer.xmlconfiguration.suites.xmlconfiguration.xmlconfiguration_empty.xmlconfiguration_stop_on_warning.xmlconfiguration_xinclude.xmlexpectedFileFormat.txtfoo.xmlphpt-for-coverage.phptphpt-xfail.phptphpunit-example-extension
structureAttributesAreSameButValuesAreNot.xmlstructureExpected.xmlstructureIgnoreTextNodes.xmlstructureIsSameButDataIsNot.xmlstructureWrongNumberOfAttributes.xmlstructureWrongNumberOfNodes.xmlsebastian
code-unit-reverse-lookup
comparator
.gitignore.travis.ymlLICENSEREADME.mdbuild.xml
build
composer.jsonphpunit.xml.distsrc
ArrayComparator.phpComparator.phpComparisonFailure.phpDOMNodeComparator.phpDateTimeComparator.phpDoubleComparator.phpExceptionComparator.phpFactory.phpMockObjectComparator.phpNumericComparator.phpObjectComparator.phpResourceComparator.phpScalarComparator.phpSplObjectStorageComparator.phpTypeComparator.php
tests
ArrayComparatorTest.phpDOMNodeComparatorTest.phpDateTimeComparatorTest.phpDoubleComparatorTest.phpExceptionComparatorTest.phpFactoryTest.phpMockObjectComparatorTest.phpNumericComparatorTest.phpObjectComparatorTest.phpResourceComparatorTest.phpScalarComparatorTest.phpSplObjectStorageComparatorTest.phpTypeComparatorTest.php
_files
Author.phpBook.phpClassWithToString.phpSampleClass.phpStruct.phpTestClass.phpTestClassComparator.php
autoload.phpbootstrap.phpdiff
.gitignore.php_cs.travis.ymlLICENSEREADME.mdbuild.xmlcomposer.jsonphpunit.xml
src
Chunk.phpDiff.phpDiffer.php
LCS
LongestCommonSubsequence.phpMemoryEfficientLongestCommonSubsequenceImplementation.phpTimeEfficientLongestCommonSubsequenceImplementation.php
Line.phpParser.phptests
environment
exporter
global-state
object-enumerator
recursion-context
resource-operations
version
symfony
polyfill-ctype
yaml
webmozart
200
vendor/phpunit/phpunit-mock-objects/tests/GeneratorTest.php
vendored
Normal file
200
vendor/phpunit/phpunit-mock-objects/tests/GeneratorTest.php
vendored
Normal file
@ -0,0 +1,200 @@
|
||||
<?php
|
||||
/**
|
||||
* @covers PHPUnit_Framework_MockObject_Generator
|
||||
*
|
||||
* @uses PHPUnit_Framework_MockObject_InvocationMocker
|
||||
* @uses PHPUnit_Framework_MockObject_Builder_InvocationMocker
|
||||
* @uses PHPUnit_Framework_MockObject_Invocation_Object
|
||||
* @uses PHPUnit_Framework_MockObject_Invocation_Static
|
||||
* @uses PHPUnit_Framework_MockObject_Matcher
|
||||
* @uses PHPUnit_Framework_MockObject_Matcher_InvokedRecorder
|
||||
* @uses PHPUnit_Framework_MockObject_Matcher_MethodName
|
||||
* @uses PHPUnit_Framework_MockObject_Stub_Return
|
||||
* @uses PHPUnit_Framework_MockObject_Matcher_InvokedCount
|
||||
*/
|
||||
class Framework_MockObject_GeneratorTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var PHPUnit_Framework_MockObject_Generator
|
||||
*/
|
||||
private $generator;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_MockObject_RuntimeException
|
||||
*/
|
||||
public function testGetMockFailsWhenInvalidFunctionNameIsPassedInAsAFunctionToMock()
|
||||
{
|
||||
$this->generator->getMock(stdClass::class, [0]);
|
||||
}
|
||||
|
||||
public function testGetMockCanCreateNonExistingFunctions()
|
||||
{
|
||||
$mock = $this->generator->getMock(stdClass::class, ['testFunction']);
|
||||
|
||||
$this->assertTrue(method_exists($mock, 'testFunction'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_MockObject_RuntimeException
|
||||
* @expectedExceptionMessage duplicates: "foo, bar, foo" (duplicate: "foo")
|
||||
*/
|
||||
public function testGetMockGeneratorFails()
|
||||
{
|
||||
$this->generator->getMock(stdClass::class, ['foo', 'bar', 'foo']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 7
|
||||
*/
|
||||
public function testGetMockBlacklistedMethodNamesPhp7()
|
||||
{
|
||||
$mock = $this->generator->getMock(InterfaceWithSemiReservedMethodName::class);
|
||||
|
||||
$this->assertTrue(method_exists($mock, 'unset'));
|
||||
$this->assertInstanceOf(InterfaceWithSemiReservedMethodName::class, $mock);
|
||||
}
|
||||
|
||||
public function testGetMockForAbstractClassDoesNotFailWhenFakingInterfaces()
|
||||
{
|
||||
$mock = $this->generator->getMockForAbstractClass(Countable::class);
|
||||
|
||||
$this->assertTrue(method_exists($mock, 'count'));
|
||||
}
|
||||
|
||||
public function testGetMockForAbstractClassStubbingAbstractClass()
|
||||
{
|
||||
$mock = $this->generator->getMockForAbstractClass(AbstractMockTestClass::class);
|
||||
|
||||
$this->assertTrue(method_exists($mock, 'doSomething'));
|
||||
}
|
||||
|
||||
public function testGetMockForAbstractClassWithNonExistentMethods()
|
||||
{
|
||||
$mock = $this->generator->getMockForAbstractClass(
|
||||
AbstractMockTestClass::class,
|
||||
[],
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
['nonexistentMethod']
|
||||
);
|
||||
|
||||
$this->assertTrue(method_exists($mock, 'nonexistentMethod'));
|
||||
$this->assertTrue(method_exists($mock, 'doSomething'));
|
||||
}
|
||||
|
||||
public function testGetMockForAbstractClassShouldCreateStubsOnlyForAbstractMethodWhenNoMethodsWereInformed()
|
||||
{
|
||||
$mock = $this->generator->getMockForAbstractClass(AbstractMockTestClass::class);
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('doSomething')
|
||||
->willReturn('testing');
|
||||
|
||||
$this->assertEquals('testing', $mock->doSomething());
|
||||
$this->assertEquals(1, $mock->returnAnything());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getMockForAbstractClassExpectsInvalidArgumentExceptionDataprovider
|
||||
* @expectedException PHPUnit_Framework_Exception
|
||||
*/
|
||||
public function testGetMockForAbstractClassExpectingInvalidArgumentException($className, $mockClassName)
|
||||
{
|
||||
$this->generator->getMockForAbstractClass($className, [], $mockClassName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_MockObject_RuntimeException
|
||||
*/
|
||||
public function testGetMockForAbstractClassAbstractClassDoesNotExist()
|
||||
{
|
||||
$this->generator->getMockForAbstractClass('Tux');
|
||||
}
|
||||
|
||||
public function getMockForAbstractClassExpectsInvalidArgumentExceptionDataprovider()
|
||||
{
|
||||
return [
|
||||
'className not a string' => [[], ''],
|
||||
'mockClassName not a string' => [Countable::class, new stdClass],
|
||||
];
|
||||
}
|
||||
|
||||
public function testGetMockForTraitWithNonExistentMethodsAndNonAbstractMethods()
|
||||
{
|
||||
$mock = $this->generator->getMockForTrait(
|
||||
AbstractTrait::class,
|
||||
[],
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
['nonexistentMethod']
|
||||
);
|
||||
|
||||
$this->assertTrue(method_exists($mock, 'nonexistentMethod'));
|
||||
$this->assertTrue(method_exists($mock, 'doSomething'));
|
||||
$this->assertTrue($mock->mockableMethod());
|
||||
$this->assertTrue($mock->anotherMockableMethod());
|
||||
}
|
||||
|
||||
public function testGetMockForTraitStubbingAbstractMethod()
|
||||
{
|
||||
$mock = $this->generator->getMockForTrait(AbstractTrait::class);
|
||||
|
||||
$this->assertTrue(method_exists($mock, 'doSomething'));
|
||||
}
|
||||
|
||||
public function testGetMockForSingletonWithReflectionSuccess()
|
||||
{
|
||||
$mock = $this->generator->getMock(SingletonClass::class, ['doSomething'], [], '', false);
|
||||
|
||||
$this->assertInstanceOf('SingletonClass', $mock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_MockObject_RuntimeException
|
||||
*/
|
||||
public function testExceptionIsRaisedForMutuallyExclusiveOptions()
|
||||
{
|
||||
$this->generator->getMock(stdClass::class, [], [], '', false, true, true, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 7
|
||||
*/
|
||||
public function testCanImplementInterfacesThatHaveMethodsWithReturnTypes()
|
||||
{
|
||||
$stub = $this->generator->getMock([AnInterfaceWithReturnType::class, AnInterface::class]);
|
||||
|
||||
$this->assertInstanceOf(AnInterfaceWithReturnType::class, $stub);
|
||||
$this->assertInstanceOf(AnInterface::class, $stub);
|
||||
$this->assertInstanceOf(PHPUnit_Framework_MockObject_MockObject::class, $stub);
|
||||
}
|
||||
|
||||
public function testCanConfigureMethodsForDoubleOfNonExistentClass()
|
||||
{
|
||||
$className = 'X' . md5(microtime());
|
||||
|
||||
$mock = $this->generator->getMock($className, ['someMethod']);
|
||||
|
||||
$this->assertInstanceOf($className, $mock);
|
||||
}
|
||||
|
||||
public function testCanInvokeMethodsOfNonExistentClass()
|
||||
{
|
||||
$className = 'X' . md5(microtime());
|
||||
|
||||
$mock = $this->generator->getMock($className, ['someMethod']);
|
||||
|
||||
$mock->expects($this->once())->method('someMethod');
|
||||
|
||||
$this->assertNull($mock->someMethod());
|
||||
}
|
||||
}
|
126
vendor/phpunit/phpunit-mock-objects/tests/MockBuilderTest.php
vendored
Normal file
126
vendor/phpunit/phpunit-mock-objects/tests/MockBuilderTest.php
vendored
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the PHPUnit_MockObject package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
class Framework_MockBuilderTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testMockBuilderRequiresClassName()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)->getMock();
|
||||
|
||||
$this->assertTrue($mock instanceof Mockable);
|
||||
}
|
||||
|
||||
public function testByDefaultMocksAllMethods()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)->getMock();
|
||||
|
||||
$this->assertNull($mock->mockableMethod());
|
||||
$this->assertNull($mock->anotherMockableMethod());
|
||||
}
|
||||
|
||||
public function testMethodsToMockCanBeSpecified()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)
|
||||
->setMethods(['mockableMethod'])
|
||||
->getMock();
|
||||
|
||||
$this->assertNull($mock->mockableMethod());
|
||||
$this->assertTrue($mock->anotherMockableMethod());
|
||||
}
|
||||
|
||||
public function testMethodExceptionsToMockCanBeSpecified()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)
|
||||
->setMethodsExcept(['mockableMethod'])
|
||||
->getMock();
|
||||
|
||||
$this->assertTrue($mock->mockableMethod());
|
||||
$this->assertNull($mock->anotherMockableMethod());
|
||||
}
|
||||
|
||||
public function testEmptyMethodExceptionsToMockCanBeSpecified()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)
|
||||
->setMethodsExcept()
|
||||
->getMock();
|
||||
|
||||
$this->assertNull($mock->mockableMethod());
|
||||
$this->assertNull($mock->anotherMockableMethod());
|
||||
}
|
||||
|
||||
public function testByDefaultDoesNotPassArgumentsToTheConstructor()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)->getMock();
|
||||
|
||||
$this->assertEquals([null, null], $mock->constructorArgs);
|
||||
}
|
||||
|
||||
public function testMockClassNameCanBeSpecified()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)
|
||||
->setMockClassName('ACustomClassName')
|
||||
->getMock();
|
||||
|
||||
$this->assertTrue($mock instanceof ACustomClassName);
|
||||
}
|
||||
|
||||
public function testConstructorArgumentsCanBeSpecified()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)
|
||||
->setConstructorArgs([23, 42])
|
||||
->getMock();
|
||||
|
||||
$this->assertEquals([23, 42], $mock->constructorArgs);
|
||||
}
|
||||
|
||||
public function testOriginalConstructorCanBeDisabled()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->assertNull($mock->constructorArgs);
|
||||
}
|
||||
|
||||
public function testByDefaultOriginalCloneIsPreserved()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)
|
||||
->getMock();
|
||||
|
||||
$cloned = clone $mock;
|
||||
|
||||
$this->assertTrue($cloned->cloned);
|
||||
}
|
||||
|
||||
public function testOriginalCloneCanBeDisabled()
|
||||
{
|
||||
$mock = $this->getMockBuilder(Mockable::class)
|
||||
->disableOriginalClone()
|
||||
->getMock();
|
||||
|
||||
$mock->cloned = false;
|
||||
$cloned = clone $mock;
|
||||
|
||||
$this->assertFalse($cloned->cloned);
|
||||
}
|
||||
|
||||
public function testProvidesAFluentInterface()
|
||||
{
|
||||
$spec = $this->getMockBuilder(Mockable::class)
|
||||
->setMethods(['mockableMethod'])
|
||||
->setConstructorArgs([])
|
||||
->setMockClassName('DummyClassName')
|
||||
->disableOriginalConstructor()
|
||||
->disableOriginalClone()
|
||||
->disableAutoload();
|
||||
|
||||
$this->assertTrue($spec instanceof PHPUnit_Framework_MockObject_MockBuilder);
|
||||
}
|
||||
}
|
63
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Builder/InvocationMockerTest.php
vendored
Normal file
63
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Builder/InvocationMockerTest.php
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
class Framework_MockObject_Builder_InvocationMockerTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testWillReturnWithOneValue()
|
||||
{
|
||||
$mock = $this->getMockBuilder(stdClass::class)
|
||||
->setMethods(['foo'])
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('foo')
|
||||
->willReturn(1);
|
||||
|
||||
$this->assertEquals(1, $mock->foo());
|
||||
}
|
||||
|
||||
public function testWillReturnWithMultipleValues()
|
||||
{
|
||||
$mock = $this->getMockBuilder(stdClass::class)
|
||||
->setMethods(['foo'])
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('foo')
|
||||
->willReturn(1, 2, 3);
|
||||
|
||||
$this->assertEquals(1, $mock->foo());
|
||||
$this->assertEquals(2, $mock->foo());
|
||||
$this->assertEquals(3, $mock->foo());
|
||||
}
|
||||
|
||||
public function testWillReturnOnConsecutiveCalls()
|
||||
{
|
||||
$mock = $this->getMockBuilder(stdClass::class)
|
||||
->setMethods(['foo'])
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('foo')
|
||||
->willReturnOnConsecutiveCalls(1, 2, 3);
|
||||
|
||||
$this->assertEquals(1, $mock->foo());
|
||||
$this->assertEquals(2, $mock->foo());
|
||||
$this->assertEquals(3, $mock->foo());
|
||||
}
|
||||
|
||||
public function testWillReturnByReference()
|
||||
{
|
||||
$mock = $this->getMockBuilder(stdClass::class)
|
||||
->setMethods(['foo'])
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('foo')
|
||||
->willReturnReference($value);
|
||||
|
||||
$this->assertSame(null, $mock->foo());
|
||||
$value = 'foo';
|
||||
$this->assertSame('foo', $mock->foo());
|
||||
$value = 'bar';
|
||||
$this->assertSame('bar', $mock->foo());
|
||||
}
|
||||
}
|
129
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/232.phpt
vendored
Normal file
129
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/232.phpt
vendored
Normal file
@ -0,0 +1,129 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', true, true)
|
||||
--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;
|
||||
private $__phpunit_configurable = ['speak'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
147
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/abstract_class.phpt
vendored
Normal file
147
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/abstract_class.phpt
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['one', 'two', 'three'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
125
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class.phpt
vendored
Normal file
125
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class.phpt
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['bar', 'baz'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
77
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_call_parent_clone.phpt
vendored
Normal file
77
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_call_parent_clone.phpt
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
76
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_call_parent_constructor.phpt
vendored
Normal file
76
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_call_parent_constructor.phpt
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
76
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_dont_call_parent_clone.phpt
vendored
Normal file
76
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_dont_call_parent_clone.phpt
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
76
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_dont_call_parent_constructor.phpt
vendored
Normal file
76
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_dont_call_parent_constructor.phpt
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
81
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_implementing_interface_call_parent_constructor.phpt
vendored
Normal file
81
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_implementing_interface_call_parent_constructor.phpt
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
81
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_implementing_interface_dont_call_parent_constructor.phpt
vendored
Normal file
81
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_implementing_interface_dont_call_parent_constructor.phpt
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
103
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_partial.phpt
vendored
Normal file
103
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_partial.phpt
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
92
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_with_method_named_method.phpt
vendored
Normal file
92
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_with_method_named_method.phpt
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['method'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
99
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_with_method_with_variadic_arguments.phpt
vendored
Normal file
99
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/class_with_method_with_variadic_arguments.phpt
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('ClassWithMethodWithVariadicArguments', array(), 'MockFoo', true, true)
|
||||
--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;
|
||||
private $__phpunit_configurable = ['methodwithvariadicarguments'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
97
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/interface.phpt
vendored
Normal file
97
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/interface.phpt
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
126
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/invocation_object_clone_object.phpt
vendored
Normal file
126
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/invocation_object_clone_object.phpt
vendored
Normal file
@ -0,0 +1,126 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['bar', 'baz'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
127
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class.phpt
vendored
Normal file
127
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class.phpt
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['bar', 'baz'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
79
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_call_parent_clone.phpt
vendored
Normal file
79
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_call_parent_clone.phpt
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
78
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_call_parent_constructor.phpt
vendored
Normal file
78
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_call_parent_constructor.phpt
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
78
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_dont_call_parent_clone.phpt
vendored
Normal file
78
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_dont_call_parent_clone.phpt
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
78
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_dont_call_parent_constructor.phpt
vendored
Normal file
78
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_dont_call_parent_constructor.phpt
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
83
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_implementing_interface_call_parent_constructor.phpt
vendored
Normal file
83
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_implementing_interface_call_parent_constructor.phpt
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
83
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt
vendored
Normal file
83
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_implementing_interface_dont_call_parent_constructor.phpt
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
105
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_partial.phpt
vendored
Normal file
105
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_class_partial.phpt
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
99
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_interface.phpt
vendored
Normal file
99
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/namespaced_interface.phpt
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
74
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/nonexistent_class.phpt
vendored
Normal file
74
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/nonexistent_class.phpt
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
82
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/nonexistent_class_with_namespace.phpt
vendored
Normal file
82
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/nonexistent_class_with_namespace.phpt
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
82
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/nonexistent_class_with_namespace_starting_with_separator.phpt
vendored
Normal file
82
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/nonexistent_class_with_namespace_starting_with_separator.phpt
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = [];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
103
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/nullable_types.phpt
vendored
Normal file
103
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/nullable_types.phpt
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', true, true)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!version_compare(PHP_VERSION, '7.1', '>=')) print 'skip: PHP >= 7.1 required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function bar(?int $x)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(?int $x)
|
||||
{
|
||||
$arguments = array($x);
|
||||
$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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
121
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/proxy.phpt
vendored
Normal file
121
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/proxy.phpt
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
--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;
|
||||
private $__phpunit_configurable = ['bar', 'baz'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
101
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_nullable.phpt
vendored
Normal file
101
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_nullable.phpt
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', true, true)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!version_compare(PHP_VERSION, '7.1', '>=')) print 'skip: PHP >= 7.1 required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
interface Foo
|
||||
{
|
||||
public function bar(string $baz): ?string;
|
||||
}
|
||||
|
||||
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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(string $baz): ?string
|
||||
{
|
||||
$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, '?string', $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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
104
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_object_method.phpt
vendored
Normal file
104
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_object_method.phpt
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', true, true)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!version_compare(PHP_VERSION, '7.0', '>=')) print 'skip: PHP >= 7.0 required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function bar(string $baz): Bar
|
||||
{
|
||||
return 'test';
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(string $baz): Bar
|
||||
{
|
||||
$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, 'Bar', $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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
101
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_self.phpt
vendored
Normal file
101
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_self.phpt
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', true, true)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!version_compare(PHP_VERSION, '7.0', '>=')) print 'skip: PHP >= 7.0 required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
interface Foo
|
||||
{
|
||||
public function bar(string $baz): self;
|
||||
}
|
||||
|
||||
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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(string $baz): Foo
|
||||
{
|
||||
$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, 'Foo', $this, true
|
||||
)
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->expects($matcher);
|
||||
}
|
||||
|
||||
public function method()
|
||||
{
|
||||
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
|
||||
$expects = $this->expects($any);
|
||||
return call_user_func_array(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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
87
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_static_method.phpt
vendored
Normal file
87
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_static_method.phpt
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', true, true)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!version_compare(PHP_VERSION, '7.0', '>=')) print 'skip: PHP >= 7.0 required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public static function bar(string $baz): Bar
|
||||
{
|
||||
return 'test';
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public static function bar(string $baz): Bar
|
||||
{
|
||||
throw new PHPUnit_Framework_MockObject_BadMethodCallException('Static method "bar" cannot be invoked on mock object');
|
||||
}
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
99
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_void.phpt
vendored
Normal file
99
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/return_type_declarations_void.phpt
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', true, true)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!version_compare(PHP_VERSION, '7.1', '>=')) print 'skip: PHP >= 7.1 required';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
interface Foo
|
||||
{
|
||||
public function bar(string $baz): void;
|
||||
}
|
||||
|
||||
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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function bar(string $baz): void
|
||||
{
|
||||
$arguments = array($baz);
|
||||
$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, 'void', $this, true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
103
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/scalar_type_declarations.phpt
vendored
Normal file
103
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/scalar_type_declarations.phpt
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', true, true)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!version_compare(PHP_VERSION, '7.0', '>=')) print 'skip: PHP >= 7.0 required';
|
||||
?>
|
||||
--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;
|
||||
private $__phpunit_configurable = ['bar'];
|
||||
|
||||
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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
37
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/wsdl_class.phpt
vendored
Normal file
37
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/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(
|
||||
__DIR__ . '/../../_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
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/wsdl_class_namespace.phpt
vendored
Normal file
39
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/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(
|
||||
__DIR__ . '/../../_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
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/wsdl_class_partial.phpt
vendored
Normal file
30
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Generator/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(
|
||||
__DIR__ . '/../../_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)
|
||||
{
|
||||
}
|
||||
}
|
108
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Invocation/ObjectTest.php
vendored
Normal file
108
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Invocation/ObjectTest.php
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
class Framework_MockObject_Invocation_ObjectTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testConstructorRequiresClassAndMethodAndParametersAndObject()
|
||||
{
|
||||
$this->assertInstanceOf(
|
||||
PHPUnit_Framework_MockObject_Invocation_Object::class,
|
||||
new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
['an_argument'],
|
||||
'ReturnType',
|
||||
new stdClass
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testAllowToGetClassNameSetInConstructor()
|
||||
{
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
['an_argument'],
|
||||
'ReturnType',
|
||||
new stdClass
|
||||
);
|
||||
|
||||
$this->assertSame('FooClass', $invocation->className);
|
||||
}
|
||||
|
||||
public function testAllowToGetMethodNameSetInConstructor()
|
||||
{
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
['an_argument'],
|
||||
'ReturnType',
|
||||
new stdClass
|
||||
);
|
||||
|
||||
$this->assertSame('FooMethod', $invocation->methodName);
|
||||
}
|
||||
|
||||
public function testAllowToGetObjectSetInConstructor()
|
||||
{
|
||||
$expectedObject = new stdClass;
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
['an_argument'],
|
||||
'ReturnType',
|
||||
$expectedObject
|
||||
);
|
||||
|
||||
$this->assertSame($expectedObject, $invocation->object);
|
||||
}
|
||||
|
||||
public function testAllowToGetMethodParametersSetInConstructor()
|
||||
{
|
||||
$expectedParameters = [
|
||||
'foo', 5, ['a', 'b'], new stdClass, null, false
|
||||
];
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
$expectedParameters,
|
||||
'ReturnType',
|
||||
new stdClass
|
||||
);
|
||||
|
||||
$this->assertSame($expectedParameters, $invocation->parameters);
|
||||
}
|
||||
|
||||
public function testConstructorAllowToSetFlagCloneObjectsInParameters()
|
||||
{
|
||||
$parameters = [new stdClass];
|
||||
$cloneObjects = true;
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
$parameters,
|
||||
'ReturnType',
|
||||
new stdClass,
|
||||
$cloneObjects
|
||||
);
|
||||
|
||||
$this->assertEquals($parameters, $invocation->parameters);
|
||||
$this->assertNotSame($parameters, $invocation->parameters);
|
||||
}
|
||||
|
||||
public function testAllowToGetReturnTypeSetInConstructor()
|
||||
{
|
||||
$expectedReturnType = 'string';
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
['an_argument'],
|
||||
$expectedReturnType,
|
||||
new stdClass
|
||||
);
|
||||
|
||||
$this->assertSame($expectedReturnType, $invocation->returnType);
|
||||
}
|
||||
}
|
87
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Invocation/StaticTest.php
vendored
Normal file
87
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Invocation/StaticTest.php
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
class Framework_MockObject_Invocation_StaticTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testConstructorRequiresClassAndMethodAndParameters()
|
||||
{
|
||||
$this->assertInstanceOf(
|
||||
PHPUnit_Framework_MockObject_Invocation_Static::class,
|
||||
new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
['an_argument'],
|
||||
'ReturnType'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testAllowToGetClassNameSetInConstructor()
|
||||
{
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
['an_argument'],
|
||||
'ReturnType'
|
||||
);
|
||||
|
||||
$this->assertSame('FooClass', $invocation->className);
|
||||
}
|
||||
|
||||
public function testAllowToGetMethodNameSetInConstructor()
|
||||
{
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
['an_argument'],
|
||||
'ReturnType'
|
||||
);
|
||||
|
||||
$this->assertSame('FooMethod', $invocation->methodName);
|
||||
}
|
||||
|
||||
public function testAllowToGetMethodParametersSetInConstructor()
|
||||
{
|
||||
$expectedParameters = [
|
||||
'foo', 5, ['a', 'b'], new stdClass, null, false
|
||||
];
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
$expectedParameters,
|
||||
'ReturnType'
|
||||
);
|
||||
|
||||
$this->assertSame($expectedParameters, $invocation->parameters);
|
||||
}
|
||||
|
||||
public function testConstructorAllowToSetFlagCloneObjectsInParameters()
|
||||
{
|
||||
$parameters = [new stdClass];
|
||||
$cloneObjects = true;
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
$parameters,
|
||||
'ReturnType',
|
||||
$cloneObjects
|
||||
);
|
||||
|
||||
$this->assertEquals($parameters, $invocation->parameters);
|
||||
$this->assertNotSame($parameters, $invocation->parameters);
|
||||
}
|
||||
|
||||
public function testAllowToGetReturnTypeSetInConstructor()
|
||||
{
|
||||
$expectedReturnType = 'string';
|
||||
|
||||
$invocation = new PHPUnit_Framework_MockObject_Invocation_Static(
|
||||
'FooClass',
|
||||
'FooMethod',
|
||||
['an_argument'],
|
||||
$expectedReturnType
|
||||
);
|
||||
|
||||
$this->assertSame($expectedReturnType, $invocation->returnType);
|
||||
}
|
||||
}
|
56
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Matcher/ConsecutiveParametersTest.php
vendored
Normal file
56
vendor/phpunit/phpunit-mock-objects/tests/MockObject/Matcher/ConsecutiveParametersTest.php
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
class Framework_MockObject_Matcher_ConsecutiveParametersTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testIntegration()
|
||||
{
|
||||
$mock = $this->getMockBuilder(stdClass::class)
|
||||
->setMethods(['foo'])
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('foo')
|
||||
->withConsecutive(
|
||||
['bar'],
|
||||
[21, 42]
|
||||
);
|
||||
|
||||
$this->assertNull($mock->foo('bar'));
|
||||
$this->assertNull($mock->foo(21, 42));
|
||||
}
|
||||
|
||||
public function testIntegrationWithLessAssertionsThanMethodCalls()
|
||||
{
|
||||
$mock = $this->getMockBuilder(stdClass::class)
|
||||
->setMethods(['foo'])
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('foo')
|
||||
->withConsecutive(
|
||||
['bar']
|
||||
);
|
||||
|
||||
$this->assertNull($mock->foo('bar'));
|
||||
$this->assertNull($mock->foo(21, 42));
|
||||
}
|
||||
|
||||
public function testIntegrationExpectingException()
|
||||
{
|
||||
$mock = $this->getMockBuilder(stdClass::class)
|
||||
->setMethods(['foo'])
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method('foo')
|
||||
->withConsecutive(
|
||||
['bar'],
|
||||
[21, 42]
|
||||
);
|
||||
|
||||
$mock->foo('bar');
|
||||
|
||||
$this->expectException(PHPUnit_Framework_ExpectationFailedException::class);
|
||||
|
||||
$mock->foo('invalid');
|
||||
}
|
||||
}
|
105
vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_with_deprecated_method.phpt
vendored
Normal file
105
vendor/phpunit/phpunit-mock-objects/tests/MockObject/class_with_deprecated_method.phpt
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
--TEST--
|
||||
PHPUnit_Framework_MockObject_Generator::generate('ClassWithDeprecatedMethod', array(), 'MockFoo', TRUE, TRUE)
|
||||
--FILE--
|
||||
<?php
|
||||
class ClassWithDeprecatedMethod
|
||||
{
|
||||
/**
|
||||
* @deprecated this method
|
||||
* is deprecated
|
||||
*/
|
||||
public function deprecatedMethod()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
$generator = new PHPUnit_Framework_MockObject_Generator;
|
||||
|
||||
$mock = $generator->generate(
|
||||
'ClassWithDeprecatedMethod',
|
||||
array(),
|
||||
'MockFoo',
|
||||
TRUE,
|
||||
TRUE
|
||||
);
|
||||
|
||||
print $mock['code'];
|
||||
?>
|
||||
--EXPECTF--
|
||||
class MockFoo extends ClassWithDeprecatedMethod implements PHPUnit_Framework_MockObject_MockObject
|
||||
{
|
||||
private $__phpunit_invocationMocker;
|
||||
private $__phpunit_originalObject;
|
||||
private $__phpunit_configurable = ['deprecatedmethod'];
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
|
||||
}
|
||||
|
||||
public function deprecatedMethod()
|
||||
{
|
||||
@trigger_error('The ClassWithDeprecatedMethod::deprecatedMethod method is deprecated (this method is deprecated).', E_USER_DEPRECATED);
|
||||
|
||||
$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(
|
||||
'ClassWithDeprecatedMethod', 'deprecatedMethod', $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($this->__phpunit_configurable);
|
||||
}
|
||||
|
||||
return $this->__phpunit_invocationMocker;
|
||||
}
|
||||
|
||||
public function __phpunit_hasMatchers()
|
||||
{
|
||||
return $this->__phpunit_getInvocationMocker()->hasMatchers();
|
||||
}
|
||||
|
||||
public function __phpunit_verify($unsetInvocationMocker = true)
|
||||
{
|
||||
$this->__phpunit_getInvocationMocker()->verify();
|
||||
|
||||
if ($unsetInvocationMocker) {
|
||||
$this->__phpunit_invocationMocker = null;
|
||||
}
|
||||
}
|
||||
}
|
1034
vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php
vendored
Normal file
1034
vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
39
vendor/phpunit/phpunit-mock-objects/tests/ProxyObjectTest.php
vendored
Normal file
39
vendor/phpunit/phpunit-mock-objects/tests/ProxyObjectTest.php
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of the PHPUnit_MockObject package.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
class Framework_ProxyObjectTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testMockedMethodIsProxiedToOriginalMethod()
|
||||
{
|
||||
$proxy = $this->getMockBuilder(Bar::class)
|
||||
->enableProxyingToOriginalMethods()
|
||||
->getMock();
|
||||
|
||||
$proxy->expects($this->once())
|
||||
->method('doSomethingElse');
|
||||
|
||||
$foo = new Foo;
|
||||
|
||||
$this->assertEquals('result', $foo->doSomething($proxy));
|
||||
}
|
||||
|
||||
public function testMockedMethodWithReferenceIsProxiedToOriginalMethod()
|
||||
{
|
||||
$proxy = $this->getMockBuilder(MethodCallbackByReference::class)
|
||||
->enableProxyingToOriginalMethods()
|
||||
->getMock();
|
||||
|
||||
$a = $b = $c = 0;
|
||||
|
||||
$proxy->callback($a, $b, $c);
|
||||
|
||||
$this->assertEquals(1, $b);
|
||||
}
|
||||
}
|
10
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AbstractMockTestClass.php
vendored
Normal file
10
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AbstractMockTestClass.php
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
abstract class AbstractMockTestClass implements MockTestInterface
|
||||
{
|
||||
abstract public function doSomething();
|
||||
|
||||
public function returnAnything()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
15
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AbstractTrait.php
vendored
Normal file
15
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AbstractTrait.php
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
trait AbstractTrait
|
||||
{
|
||||
abstract public function doSomething();
|
||||
|
||||
public function mockableMethod()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function anotherMockableMethod()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AnInterface.php
vendored
Normal file
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AnInterface.php
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
interface AnInterface
|
||||
{
|
||||
public function doSomething();
|
||||
}
|
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AnInterfaceWithReturnType.php
vendored
Normal file
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AnInterfaceWithReturnType.php
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
interface AnInterfaceWithReturnType
|
||||
{
|
||||
public function returnAnArray(): array;
|
||||
}
|
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AnotherInterface.php
vendored
Normal file
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/AnotherInterface.php
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
interface AnotherInterface
|
||||
{
|
||||
public function doSomethingElse();
|
||||
}
|
8
vendor/phpunit/phpunit-mock-objects/tests/_fixture/Bar.php
vendored
Normal file
8
vendor/phpunit/phpunit-mock-objects/tests/_fixture/Bar.php
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
class Bar
|
||||
{
|
||||
public function doSomethingElse()
|
||||
{
|
||||
return 'result';
|
||||
}
|
||||
}
|
15
vendor/phpunit/phpunit-mock-objects/tests/_fixture/ClassThatImplementsSerializable.php
vendored
Normal file
15
vendor/phpunit/phpunit-mock-objects/tests/_fixture/ClassThatImplementsSerializable.php
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
class ClassThatImplementsSerializable implements Serializable
|
||||
{
|
||||
public function serialize()
|
||||
{
|
||||
return get_object_vars($this);
|
||||
}
|
||||
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
foreach (unserialize($serialized) as $key => $value) {
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
}
|
7
vendor/phpunit/phpunit-mock-objects/tests/_fixture/ClassWithSelfTypeHint.php
vendored
Normal file
7
vendor/phpunit/phpunit-mock-objects/tests/_fixture/ClassWithSelfTypeHint.php
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
class ClassWithSelfTypeHint
|
||||
{
|
||||
public function foo(self $foo)
|
||||
{
|
||||
}
|
||||
}
|
7
vendor/phpunit/phpunit-mock-objects/tests/_fixture/ClassWithStaticMethod.php
vendored
Normal file
7
vendor/phpunit/phpunit-mock-objects/tests/_fixture/ClassWithStaticMethod.php
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
class ClassWithStaticMethod
|
||||
{
|
||||
public static function staticMethod()
|
||||
{
|
||||
}
|
||||
}
|
8
vendor/phpunit/phpunit-mock-objects/tests/_fixture/Foo.php
vendored
Normal file
8
vendor/phpunit/phpunit-mock-objects/tests/_fixture/Foo.php
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
public function doSomething(Bar $bar)
|
||||
{
|
||||
return $bar->doSomethingElse();
|
||||
}
|
||||
}
|
9
vendor/phpunit/phpunit-mock-objects/tests/_fixture/FunctionCallback.php
vendored
Normal file
9
vendor/phpunit/phpunit-mock-objects/tests/_fixture/FunctionCallback.php
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
function functionCallback()
|
||||
{
|
||||
$args = func_get_args();
|
||||
|
||||
if ($args == ['foo', 'bar']) {
|
||||
return 'pass';
|
||||
}
|
||||
}
|
198
vendor/phpunit/phpunit-mock-objects/tests/_fixture/GoogleSearch.wsdl
vendored
Normal file
198
vendor/phpunit/phpunit-mock-objects/tests/_fixture/GoogleSearch.wsdl
vendored
Normal file
@ -0,0 +1,198 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- WSDL description of the Google Web APIs.
|
||||
The Google Web APIs are in beta release. All interfaces are subject to
|
||||
change as we refine and extend our APIs. Please see the terms of use
|
||||
for more information. -->
|
||||
|
||||
<!-- Revision 2002-08-16 -->
|
||||
|
||||
<definitions name="GoogleSearch"
|
||||
targetNamespace="urn:GoogleSearch"
|
||||
xmlns:typens="urn:GoogleSearch"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/">
|
||||
|
||||
<!-- Types for search - result elements, directory categories -->
|
||||
|
||||
<types>
|
||||
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:GoogleSearch">
|
||||
|
||||
<xsd:complexType name="GoogleSearchResult">
|
||||
<xsd:all>
|
||||
<xsd:element name="documentFiltering" type="xsd:boolean"/>
|
||||
<xsd:element name="searchComments" type="xsd:string"/>
|
||||
<xsd:element name="estimatedTotalResultsCount" type="xsd:int"/>
|
||||
<xsd:element name="estimateIsExact" type="xsd:boolean"/>
|
||||
<xsd:element name="resultElements" type="typens:ResultElementArray"/>
|
||||
<xsd:element name="searchQuery" type="xsd:string"/>
|
||||
<xsd:element name="startIndex" type="xsd:int"/>
|
||||
<xsd:element name="endIndex" type="xsd:int"/>
|
||||
<xsd:element name="searchTips" type="xsd:string"/>
|
||||
<xsd:element name="directoryCategories" type="typens:DirectoryCategoryArray"/>
|
||||
<xsd:element name="searchTime" type="xsd:double"/>
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="ResultElement">
|
||||
<xsd:all>
|
||||
<xsd:element name="summary" type="xsd:string"/>
|
||||
<xsd:element name="URL" type="xsd:string"/>
|
||||
<xsd:element name="snippet" type="xsd:string"/>
|
||||
<xsd:element name="title" type="xsd:string"/>
|
||||
<xsd:element name="cachedSize" type="xsd:string"/>
|
||||
<xsd:element name="relatedInformationPresent" type="xsd:boolean"/>
|
||||
<xsd:element name="hostName" type="xsd:string"/>
|
||||
<xsd:element name="directoryCategory" type="typens:DirectoryCategory"/>
|
||||
<xsd:element name="directoryTitle" type="xsd:string"/>
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="ResultElementArray">
|
||||
<xsd:complexContent>
|
||||
<xsd:restriction base="soapenc:Array">
|
||||
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:ResultElement[]"/>
|
||||
</xsd:restriction>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="DirectoryCategoryArray">
|
||||
<xsd:complexContent>
|
||||
<xsd:restriction base="soapenc:Array">
|
||||
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:DirectoryCategory[]"/>
|
||||
</xsd:restriction>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="DirectoryCategory">
|
||||
<xsd:all>
|
||||
<xsd:element name="fullViewableName" type="xsd:string"/>
|
||||
<xsd:element name="specialEncoding" type="xsd:string"/>
|
||||
</xsd:all>
|
||||
</xsd:complexType>
|
||||
|
||||
</xsd:schema>
|
||||
</types>
|
||||
|
||||
<!-- Messages for Google Web APIs - cached page, search, spelling. -->
|
||||
|
||||
<message name="doGetCachedPage">
|
||||
<part name="key" type="xsd:string"/>
|
||||
<part name="url" type="xsd:string"/>
|
||||
</message>
|
||||
|
||||
<message name="doGetCachedPageResponse">
|
||||
<part name="return" type="xsd:base64Binary"/>
|
||||
</message>
|
||||
|
||||
<message name="doSpellingSuggestion">
|
||||
<part name="key" type="xsd:string"/>
|
||||
<part name="phrase" type="xsd:string"/>
|
||||
</message>
|
||||
|
||||
<message name="doSpellingSuggestionResponse">
|
||||
<part name="return" type="xsd:string"/>
|
||||
</message>
|
||||
|
||||
<!-- note, ie and oe are ignored by server; all traffic is UTF-8. -->
|
||||
|
||||
<message name="doGoogleSearch">
|
||||
<part name="key" type="xsd:string"/>
|
||||
<part name="q" type="xsd:string"/>
|
||||
<part name="start" type="xsd:int"/>
|
||||
<part name="maxResults" type="xsd:int"/>
|
||||
<part name="filter" type="xsd:boolean"/>
|
||||
<part name="restrict" type="xsd:string"/>
|
||||
<part name="safeSearch" type="xsd:boolean"/>
|
||||
<part name="lr" type="xsd:string"/>
|
||||
<part name="ie" type="xsd:string"/>
|
||||
<part name="oe" type="xsd:string"/>
|
||||
</message>
|
||||
|
||||
<message name="doGoogleSearchResponse">
|
||||
<part name="return" type="typens:GoogleSearchResult"/>
|
||||
</message>
|
||||
|
||||
<!-- Port for Google Web APIs, "GoogleSearch" -->
|
||||
|
||||
<portType name="GoogleSearchPort">
|
||||
|
||||
<operation name="doGetCachedPage">
|
||||
<input message="typens:doGetCachedPage"/>
|
||||
<output message="typens:doGetCachedPageResponse"/>
|
||||
</operation>
|
||||
|
||||
<operation name="doSpellingSuggestion">
|
||||
<input message="typens:doSpellingSuggestion"/>
|
||||
<output message="typens:doSpellingSuggestionResponse"/>
|
||||
</operation>
|
||||
|
||||
<operation name="doGoogleSearch">
|
||||
<input message="typens:doGoogleSearch"/>
|
||||
<output message="typens:doGoogleSearchResponse"/>
|
||||
</operation>
|
||||
|
||||
</portType>
|
||||
|
||||
|
||||
<!-- Binding for Google Web APIs - RPC, SOAP over HTTP -->
|
||||
|
||||
<binding name="GoogleSearchBinding" type="typens:GoogleSearchPort">
|
||||
<soap:binding style="rpc"
|
||||
transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
|
||||
<operation name="doGetCachedPage">
|
||||
<soap:operation soapAction="urn:GoogleSearchAction"/>
|
||||
<input>
|
||||
<soap:body use="encoded"
|
||||
namespace="urn:GoogleSearch"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded"
|
||||
namespace="urn:GoogleSearch"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
|
||||
<operation name="doSpellingSuggestion">
|
||||
<soap:operation soapAction="urn:GoogleSearchAction"/>
|
||||
<input>
|
||||
<soap:body use="encoded"
|
||||
namespace="urn:GoogleSearch"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded"
|
||||
namespace="urn:GoogleSearch"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
|
||||
<operation name="doGoogleSearch">
|
||||
<soap:operation soapAction="urn:GoogleSearchAction"/>
|
||||
<input>
|
||||
<soap:body use="encoded"
|
||||
namespace="urn:GoogleSearch"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded"
|
||||
namespace="urn:GoogleSearch"
|
||||
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
|
||||
<!-- Endpoint for Google Web APIs -->
|
||||
<service name="GoogleSearchService">
|
||||
<port name="GoogleSearchPort" binding="typens:GoogleSearchBinding">
|
||||
<soap:address location="http://api.google.com/search/beta2"/>
|
||||
</port>
|
||||
</service>
|
||||
|
||||
</definitions>
|
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/InterfaceWithSemiReservedMethodName.php
vendored
Normal file
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/InterfaceWithSemiReservedMethodName.php
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
interface InterfaceWithSemiReservedMethodName
|
||||
{
|
||||
public function unset();
|
||||
}
|
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/InterfaceWithStaticMethod.php
vendored
Normal file
5
vendor/phpunit/phpunit-mock-objects/tests/_fixture/InterfaceWithStaticMethod.php
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
interface InterfaceWithStaticMethod
|
||||
{
|
||||
public static function staticMethod();
|
||||
}
|
21
vendor/phpunit/phpunit-mock-objects/tests/_fixture/MethodCallback.php
vendored
Normal file
21
vendor/phpunit/phpunit-mock-objects/tests/_fixture/MethodCallback.php
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
class MethodCallback
|
||||
{
|
||||
public static function staticCallback()
|
||||
{
|
||||
$args = func_get_args();
|
||||
|
||||
if ($args == ['foo', 'bar']) {
|
||||
return 'pass';
|
||||
}
|
||||
}
|
||||
|
||||
public function nonStaticCallback()
|
||||
{
|
||||
$args = func_get_args();
|
||||
|
||||
if ($args == ['foo', 'bar']) {
|
||||
return 'pass';
|
||||
}
|
||||
}
|
||||
}
|
13
vendor/phpunit/phpunit-mock-objects/tests/_fixture/MethodCallbackByReference.php
vendored
Normal file
13
vendor/phpunit/phpunit-mock-objects/tests/_fixture/MethodCallbackByReference.php
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
class MethodCallbackByReference
|
||||
{
|
||||
public function bar(&$a, &$b, $c)
|
||||
{
|
||||
Legacy::bar($a, $b, $c);
|
||||
}
|
||||
|
||||
public function callback(&$a, &$b, $c)
|
||||
{
|
||||
$b = 1;
|
||||
}
|
||||
}
|
6
vendor/phpunit/phpunit-mock-objects/tests/_fixture/MockTestInterface.php
vendored
Normal file
6
vendor/phpunit/phpunit-mock-objects/tests/_fixture/MockTestInterface.php
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
interface MockTestInterface
|
||||
{
|
||||
public function returnAnything();
|
||||
public function returnAnythingElse();
|
||||
}
|
28
vendor/phpunit/phpunit-mock-objects/tests/_fixture/Mockable.php
vendored
Normal file
28
vendor/phpunit/phpunit-mock-objects/tests/_fixture/Mockable.php
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
class Mockable
|
||||
{
|
||||
public $constructorArgs;
|
||||
public $cloned;
|
||||
|
||||
public function __construct($arg1 = null, $arg2 = null)
|
||||
{
|
||||
$this->constructorArgs = [$arg1, $arg2];
|
||||
}
|
||||
|
||||
public function mockableMethod()
|
||||
{
|
||||
// something different from NULL
|
||||
return true;
|
||||
}
|
||||
|
||||
public function anotherMockableMethod()
|
||||
{
|
||||
// something different from NULL
|
||||
return true;
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->cloned = true;
|
||||
}
|
||||
}
|
18
vendor/phpunit/phpunit-mock-objects/tests/_fixture/PartialMockTestClass.php
vendored
Normal file
18
vendor/phpunit/phpunit-mock-objects/tests/_fixture/PartialMockTestClass.php
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
class PartialMockTestClass
|
||||
{
|
||||
public $constructorCalled = false;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->constructorCalled = true;
|
||||
}
|
||||
|
||||
public function doSomething()
|
||||
{
|
||||
}
|
||||
|
||||
public function doAnotherThing()
|
||||
{
|
||||
}
|
||||
}
|
28
vendor/phpunit/phpunit-mock-objects/tests/_fixture/SingletonClass.php
vendored
Normal file
28
vendor/phpunit/phpunit-mock-objects/tests/_fixture/SingletonClass.php
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
class SingletonClass
|
||||
{
|
||||
public static function getInstance()
|
||||
{
|
||||
}
|
||||
|
||||
public function doSomething()
|
||||
{
|
||||
}
|
||||
|
||||
protected function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
final private function __sleep()
|
||||
{
|
||||
}
|
||||
|
||||
final private function __wakeup()
|
||||
{
|
||||
}
|
||||
|
||||
final private function __clone()
|
||||
{
|
||||
}
|
||||
}
|
13
vendor/phpunit/phpunit-mock-objects/tests/_fixture/SomeClass.php
vendored
Normal file
13
vendor/phpunit/phpunit-mock-objects/tests/_fixture/SomeClass.php
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
class SomeClass
|
||||
{
|
||||
public function doSomething($a, $b)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public function doSomethingElse($c)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
12
vendor/phpunit/phpunit-mock-objects/tests/_fixture/StaticMockTestClass.php
vendored
Normal file
12
vendor/phpunit/phpunit-mock-objects/tests/_fixture/StaticMockTestClass.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
class StaticMockTestClass
|
||||
{
|
||||
public static function doSomething()
|
||||
{
|
||||
}
|
||||
|
||||
public static function doSomethingElse()
|
||||
{
|
||||
return static::doSomething();
|
||||
}
|
||||
}
|
8
vendor/phpunit/phpunit-mock-objects/tests/_fixture/StringableClass.php
vendored
Normal file
8
vendor/phpunit/phpunit-mock-objects/tests/_fixture/StringableClass.php
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
class StringableClass
|
||||
{
|
||||
public function __toString()
|
||||
{
|
||||
return '12345';
|
||||
}
|
||||
}
|
4
vendor/phpunit/phpunit-mock-objects/tests/_fixture/TraversableMockTestInterface.php
vendored
Normal file
4
vendor/phpunit/phpunit-mock-objects/tests/_fixture/TraversableMockTestInterface.php
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
interface TraversableMockTestInterface extends Traversable
|
||||
{
|
||||
}
|
3
vendor/phpunit/phpunit-mock-objects/tests/bootstrap.php
vendored
Normal file
3
vendor/phpunit/phpunit-mock-objects/tests/bootstrap.php
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
require __DIR__ . '/_fixture/FunctionCallback.php';
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
Reference in New Issue
Block a user