[BUGFIX] Fix serializable object creation with PHP 5.6 22/40522/11
authorHelmut Hummel <helmut.hummel@typo3.org>
Fri, 17 Apr 2015 15:47:43 +0000 (17:47 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 1 Dec 2015 11:54:34 +0000 (12:54 +0100)
This makes use of doctrine/instantiator to catch this and many
other PHP issues when instantiating objects without constructor.

Resolves: #66473
Resolves: #66885
Releases: 6.2
Change-Id: Ibeaf94ca8227befc4f5a863dd4b688c54b8fcd4c
Reviewed-on: https://review.typo3.org/40522
Reviewed-by: Stephan Großberndt <stephan@grossberndt.de>
Tested-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
39 files changed:
composer.json
typo3/contrib/vendor/autoload.php
typo3/contrib/vendor/composer/autoload_classmap.php
typo3/contrib/vendor/composer/autoload_psr4.php
typo3/contrib/vendor/composer/autoload_real.php
typo3/contrib/vendor/doctrine/instantiator/.gitignore [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/.scrutinizer.yml [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/.travis.install.sh [new file with mode: 0755]
typo3/contrib/vendor/doctrine/instantiator/.travis.yml [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/CONTRIBUTING.md [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/LICENSE [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/README.md [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/composer.json [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/phpmd.xml.dist [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/phpunit.xml.dist [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ExceptionAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/FinalExceptionAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php [new file with mode: 0644]
typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php
typo3/sysext/extbase/Classes/Object/Container/Container.php

index 1d4a00e..bbd1ceb 100644 (file)
@@ -35,6 +35,7 @@
                "ext-session": "*",
                "ext-xml": "*",
                "helhum/class-alias-loader": "1.1.5",
+               "doctrine/instantiator": "1.0.5",
                "typo3/cms-composer-installers": "1.1.4"
        },
        "require-dev": {
index ec27e8a..b123035 100644 (file)
@@ -10,7 +10,7 @@ require_once __DIR__ . '/composer' . '/autoload_real.php';
 // autoload.php @generated by Helhum/ClassAliasLoader
 
 return call_user_func(function() {
-       $composerClassLoader = ComposerAutoloaderInit4c44b875ec3edaa633a1f5c6149aef50::getLoader();
+       $composerClassLoader = ComposerAutoloaderInit76facc4bbe2878e5d3747f14e2635ea9::getLoader();
        $aliasClassLoader = new Helhum\ClassAliasLoader\Composer\ClassAliasLoader($composerClassLoader);
 
        $classAliasMap = require __DIR__ . '/composer/autoload_classaliasmap.php';
index efd78af..88a7c43 100644 (file)
@@ -6,6 +6,11 @@ $vendorDir = dirname(dirname(__FILE__));
 $baseDir = dirname(dirname(dirname($vendorDir)));
 
 return array(
+    'doctrine\\instantiator\\exception\\exceptioninterface' => $vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php',
+    'doctrine\\instantiator\\exception\\invalidargumentexception' => $vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php',
+    'doctrine\\instantiator\\exception\\unexpectedvalueexception' => $vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php',
+    'doctrine\\instantiator\\instantiator' => $vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php',
+    'doctrine\\instantiator\\instantiatorinterface' => $vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php',
     'helhum\\classaliasloader\\composer\\classaliasgenerator' => $vendorDir . '/helhum/class-alias-loader/Classes/Composer/ClassAliasGenerator.php',
     'helhum\\classaliasloader\\composer\\classaliasloader' => $vendorDir . '/helhum/class-alias-loader/Classes/Composer/ClassAliasLoader.php',
     'helhum\\classaliasloader\\composer\\plugin' => $vendorDir . '/helhum/class-alias-loader/Classes/Composer/Plugin.php',
index e299671..f605d7b 100644 (file)
@@ -20,4 +20,5 @@ return array(
     'TYPO3\\CMS\\Backend\\' => array($baseDir . '/typo3/sysext/backend/Classes'),
     'Psr\\Log\\' => array($baseDir . '/typo3/contrib/Psr/Log'),
     'Helhum\\ClassAliasLoader\\' => array($vendorDir . '/helhum/class-alias-loader/Classes'),
+    'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'),
 );
index 05b54c8..66303d9 100644 (file)
@@ -2,7 +2,7 @@
 
 // autoload_real.php @generated by Composer
 
-class ComposerAutoloaderInit4c44b875ec3edaa633a1f5c6149aef50
+class ComposerAutoloaderInit76facc4bbe2878e5d3747f14e2635ea9
 {
     private static $loader;
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit4c44b875ec3edaa633a1f5c6149aef50
             return self::$loader;
         }
 
-        spl_autoload_register(array('ComposerAutoloaderInit4c44b875ec3edaa633a1f5c6149aef50', 'loadClassLoader'), true, true);
+        spl_autoload_register(array('ComposerAutoloaderInit76facc4bbe2878e5d3747f14e2635ea9', 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        spl_autoload_unregister(array('ComposerAutoloaderInit4c44b875ec3edaa633a1f5c6149aef50', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInit76facc4bbe2878e5d3747f14e2635ea9', 'loadClassLoader'));
 
         $map = require __DIR__ . '/autoload_namespaces.php';
         foreach ($map as $namespace => $path) {
@@ -44,7 +44,7 @@ class ComposerAutoloaderInit4c44b875ec3edaa633a1f5c6149aef50
     }
 }
 
-function composerRequire4c44b875ec3edaa633a1f5c6149aef50($file)
+function composerRequire76facc4bbe2878e5d3747f14e2635ea9($file)
 {
     require $file;
 }
diff --git a/typo3/contrib/vendor/doctrine/instantiator/.gitignore b/typo3/contrib/vendor/doctrine/instantiator/.gitignore
new file mode 100644 (file)
index 0000000..e3e368d
--- /dev/null
@@ -0,0 +1,5 @@
+phpunit.xml
+composer.lock
+build
+vendor
+coverage.clover
diff --git a/typo3/contrib/vendor/doctrine/instantiator/.scrutinizer.yml b/typo3/contrib/vendor/doctrine/instantiator/.scrutinizer.yml
new file mode 100644 (file)
index 0000000..aad5e40
--- /dev/null
@@ -0,0 +1,46 @@
+before_commands:
+    - "composer install --prefer-source"
+
+tools:
+    external_code_coverage:
+        timeout: 600
+    php_code_coverage:
+        enabled: true
+        test_command: ./vendor/bin/phpunit
+    php_code_sniffer:
+        enabled: true
+        config:
+            standard: PSR2
+        filter:
+            paths: ["src/*", "tests/*"]
+    php_cpd:
+        enabled: true
+        excluded_dirs: ["build/*", "tests", "vendor"]
+    php_cs_fixer:
+        enabled: true
+        config:
+            level: all
+        filter:
+            paths: ["src/*", "tests/*"]
+    php_loc:
+        enabled: true
+        excluded_dirs: ["build", "tests", "vendor"]
+    php_mess_detector:
+        enabled: true
+        config:
+            ruleset: phpmd.xml.dist
+            design_rules: { eval_expression: false }
+        filter:
+            paths: ["src/*"]
+    php_pdepend:
+        enabled: true
+        excluded_dirs: ["build", "tests", "vendor"]
+    php_analyzer:
+        enabled: true
+        filter:
+            paths: ["src/*", "tests/*"]
+    php_hhvm:
+        enabled: true
+        filter:
+            paths: ["src/*", "tests/*"]
+    sensiolabs_security_checker: true
diff --git a/typo3/contrib/vendor/doctrine/instantiator/.travis.install.sh b/typo3/contrib/vendor/doctrine/instantiator/.travis.install.sh
new file mode 100755 (executable)
index 0000000..2819188
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -x
+if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] || [ "$TRAVIS_PHP_VERSION" = 'hhvm-nightly' ] ; then
+    curl -sS https://getcomposer.org/installer > composer-installer.php
+    hhvm composer-installer.php
+    hhvm -v ResourceLimit.SocketDefaultTimeout=30 -v Http.SlowQueryThreshold=30000 composer.phar update --prefer-source
+elif [ "$TRAVIS_PHP_VERSION" = '5.3.3' ] ; then
+    composer self-update
+    composer update --prefer-source --no-dev
+    composer dump-autoload
+else
+    composer self-update
+    composer update --prefer-source
+fi
diff --git a/typo3/contrib/vendor/doctrine/instantiator/.travis.yml b/typo3/contrib/vendor/doctrine/instantiator/.travis.yml
new file mode 100644 (file)
index 0000000..7f1ec5f
--- /dev/null
@@ -0,0 +1,22 @@
+language: php
+
+php:
+  - 5.3.3
+  - 5.3
+  - 5.4
+  - 5.5
+  - 5.6
+  - hhvm
+
+before_script:
+  - ./.travis.install.sh
+  - if [ $TRAVIS_PHP_VERSION = '5.6' ]; then PHPUNIT_FLAGS="--coverage-clover coverage.clover"; else PHPUNIT_FLAGS=""; fi
+
+script:
+  - if [ $TRAVIS_PHP_VERSION = '5.3.3' ]; then phpunit; fi
+  - if [ $TRAVIS_PHP_VERSION != '5.3.3' ]; then ./vendor/bin/phpunit $PHPUNIT_FLAGS; fi
+  - if [ $TRAVIS_PHP_VERSION != '5.3.3' ]; then ./vendor/bin/phpcs --standard=PSR2 ./src/ ./tests/; fi
+  - if [[ $TRAVIS_PHP_VERSION != '5.3.3' && $TRAVIS_PHP_VERSION != '5.4.29' && $TRAVIS_PHP_VERSION != '5.5.13' ]]; then php -n ./vendor/bin/athletic -p ./tests/DoctrineTest/InstantiatorPerformance/ -f GroupedFormatter; fi
+
+after_script:
+  - if [ $TRAVIS_PHP_VERSION = '5.6' ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
diff --git a/typo3/contrib/vendor/doctrine/instantiator/CONTRIBUTING.md b/typo3/contrib/vendor/doctrine/instantiator/CONTRIBUTING.md
new file mode 100644 (file)
index 0000000..75b84b2
--- /dev/null
@@ -0,0 +1,35 @@
+# Contributing
+
+ * Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
+ * The project will follow strict [object calisthenics](http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php)
+ * Any contribution must provide tests for additional introduced conditions
+ * Any un-confirmed issue needs a failing test case before being accepted
+ * Pull requests must be sent from a new hotfix/feature branch, not from `master`.
+
+## Installation
+
+To install the project and run the tests, you need to clone it first:
+
+```sh
+$ git clone git://github.com/doctrine/instantiator.git
+```
+
+You will then need to run a composer installation:
+
+```sh
+$ cd Instantiator
+$ curl -s https://getcomposer.org/installer | php
+$ php composer.phar update
+```
+
+## Testing
+
+The PHPUnit version to be used is the one installed as a dev- dependency via composer:
+
+```sh
+$ ./vendor/bin/phpunit
+```
+
+Accepted coverage for new contributions is 80%. Any contribution not satisfying this requirement 
+won't be merged.
+
diff --git a/typo3/contrib/vendor/doctrine/instantiator/LICENSE b/typo3/contrib/vendor/doctrine/instantiator/LICENSE
new file mode 100644 (file)
index 0000000..4d983d1
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (c) 2014 Doctrine Project
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/typo3/contrib/vendor/doctrine/instantiator/README.md b/typo3/contrib/vendor/doctrine/instantiator/README.md
new file mode 100644 (file)
index 0000000..393ec7c
--- /dev/null
@@ -0,0 +1,40 @@
+# Instantiator
+
+This library provides a way of avoiding usage of constructors when instantiating PHP classes.
+
+[![Build Status](https://travis-ci.org/doctrine/instantiator.svg?branch=master)](https://travis-ci.org/doctrine/instantiator)
+[![Code Coverage](https://scrutinizer-ci.com/g/doctrine/instantiator/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master)
+[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/instantiator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master)
+[![Dependency Status](https://www.versioneye.com/package/php--doctrine--instantiator/badge.svg)](https://www.versioneye.com/package/php--doctrine--instantiator)
+[![HHVM Status](http://hhvm.h4cc.de/badge/doctrine/instantiator.png)](http://hhvm.h4cc.de/package/doctrine/instantiator)
+
+[![Latest Stable Version](https://poser.pugx.org/doctrine/instantiator/v/stable.png)](https://packagist.org/packages/doctrine/instantiator)
+[![Latest Unstable Version](https://poser.pugx.org/doctrine/instantiator/v/unstable.png)](https://packagist.org/packages/doctrine/instantiator)
+
+## Installation
+
+The suggested installation method is via [composer](https://getcomposer.org/):
+
+```sh
+php composer.phar require "doctrine/instantiator:~1.0.3"
+```
+
+## Usage
+
+The instantiator is able to create new instances of any class without using the constructor or any API of the class
+itself:
+
+```php
+$instantiator = new \Doctrine\Instantiator\Instantiator();
+
+$instance = $instantiator->instantiate('My\\ClassName\\Here');
+```
+
+## Contributing
+
+Please read the [CONTRIBUTING.md](CONTRIBUTING.md) contents if you wish to help out!
+
+## Credits
+
+This library was migrated from [ocramius/instantiator](https://github.com/Ocramius/Instantiator), which
+has been donated to the doctrine organization, and which is now deprecated in favour of this package.
diff --git a/typo3/contrib/vendor/doctrine/instantiator/composer.json b/typo3/contrib/vendor/doctrine/instantiator/composer.json
new file mode 100644 (file)
index 0000000..4823890
--- /dev/null
@@ -0,0 +1,45 @@
+{
+    "name":              "doctrine/instantiator",
+    "description":       "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+    "type":              "library",
+    "license":           "MIT",
+    "homepage":          "https://github.com/doctrine/instantiator",
+    "keywords":          [
+        "instantiate",
+        "constructor"
+    ],
+    "authors": [
+        {
+            "name":     "Marco Pivetta",
+            "email":    "ocramius@gmail.com",
+            "homepage": "http://ocramius.github.com/"
+        }
+    ],
+    "require": {
+        "php": ">=5.3,<8.0-DEV"
+    },
+    "require-dev": {
+        "ext-phar":                  "*",
+        "ext-pdo":                   "*",
+        "phpunit/phpunit":           "~4.0",
+        "squizlabs/php_codesniffer": "~2.0",
+        "athletic/athletic":         "~0.1.8"
+    },
+    "autoload": {
+        "psr-4": {
+            "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+        }
+    },
+    "autoload-dev": {
+        "psr-0": {
+            "DoctrineTest\\InstantiatorPerformance\\": "tests",
+            "DoctrineTest\\InstantiatorTest\\": "tests",
+            "DoctrineTest\\InstantiatorTestAsset\\": "tests"
+        }
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "1.0.x-dev"
+        }
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/phpmd.xml.dist b/typo3/contrib/vendor/doctrine/instantiator/phpmd.xml.dist
new file mode 100644 (file)
index 0000000..8254105
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ruleset
+    name="Instantiator rules"
+    xmlns="http://pmd.sf.net/ruleset/1.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+    xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
+>
+    <rule ref="rulesets/cleancode.xml">
+        <!-- static access is used for caching purposes -->
+        <exclude name="StaticAccess"/>
+    </rule>
+    <rule ref="rulesets/codesize.xml"/>
+    <rule ref="rulesets/controversial.xml"/>
+    <rule ref="rulesets/design.xml"/>
+    <rule ref="rulesets/naming.xml"/>
+    <rule ref="rulesets/unusedcode.xml"/>
+    <rule
+        name="NPathComplexity"
+        message="The {0} {1}() has an NPath complexity of {2}. The configured NPath complexity threshold is {3}."
+        class="PHP_PMD_Rule_Design_NpathComplexity"
+    >
+        <properties>
+            <property name="minimum" description="The npath reporting threshold" value="10"/>
+        </properties>
+    </rule>
+</ruleset>
diff --git a/typo3/contrib/vendor/doctrine/instantiator/phpunit.xml.dist b/typo3/contrib/vendor/doctrine/instantiator/phpunit.xml.dist
new file mode 100644 (file)
index 0000000..0a8d570
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<phpunit
+    bootstrap="./vendor/autoload.php"
+    colors="true"
+    convertErrorsToExceptions="true"
+    convertNoticesToExceptions="true"
+    convertWarningsToExceptions="true"
+    verbose="true"
+    stopOnFailure="false"
+    processIsolation="false"
+    backupGlobals="false"
+    syntaxCheck="true"
+>
+    <testsuite name="Doctrine\Instantiator tests">
+        <directory>./tests/DoctrineTest/InstantiatorTest</directory>
+    </testsuite>
+    <filter>
+        <whitelist addUncoveredFilesFromWhitelist="true">
+            <directory suffix=".php">./src</directory>
+        </whitelist>
+    </filter>
+</phpunit>
diff --git a/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php b/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php
new file mode 100644 (file)
index 0000000..3065375
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Instantiator\Exception;
+
+/**
+ * Base exception marker interface for the instantiator component
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+interface ExceptionInterface
+{
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php b/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php
new file mode 100644 (file)
index 0000000..ea8d28c
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Instantiator\Exception;
+
+use InvalidArgumentException as BaseInvalidArgumentException;
+use ReflectionClass;
+
+/**
+ * Exception for invalid arguments provided to the instantiator
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface
+{
+    /**
+     * @param string $className
+     *
+     * @return self
+     */
+    public static function fromNonExistingClass($className)
+    {
+        if (interface_exists($className)) {
+            return new self(sprintf('The provided type "%s" is an interface, and can not be instantiated', $className));
+        }
+
+        if (PHP_VERSION_ID >= 50400 && trait_exists($className)) {
+            return new self(sprintf('The provided type "%s" is a trait, and can not be instantiated', $className));
+        }
+
+        return new self(sprintf('The provided class "%s" does not exist', $className));
+    }
+
+    /**
+     * @param ReflectionClass $reflectionClass
+     *
+     * @return self
+     */
+    public static function fromAbstractClass(ReflectionClass $reflectionClass)
+    {
+        return new self(sprintf(
+            'The provided class "%s" is abstract, and can not be instantiated',
+            $reflectionClass->getName()
+        ));
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php b/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php
new file mode 100644 (file)
index 0000000..1681e56
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Instantiator\Exception;
+
+use Exception;
+use ReflectionClass;
+use UnexpectedValueException as BaseUnexpectedValueException;
+
+/**
+ * Exception for given parameters causing invalid/unexpected state on instantiation
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class UnexpectedValueException extends BaseUnexpectedValueException implements ExceptionInterface
+{
+    /**
+     * @param ReflectionClass $reflectionClass
+     * @param Exception       $exception
+     *
+     * @return self
+     */
+    public static function fromSerializationTriggeredException(ReflectionClass $reflectionClass, Exception $exception)
+    {
+        return new self(
+            sprintf(
+                'An exception was raised while trying to instantiate an instance of "%s" via un-serialization',
+                $reflectionClass->getName()
+            ),
+            0,
+            $exception
+        );
+    }
+
+    /**
+     * @param ReflectionClass $reflectionClass
+     * @param string          $errorString
+     * @param int             $errorCode
+     * @param string          $errorFile
+     * @param int             $errorLine
+     *
+     * @return UnexpectedValueException
+     */
+    public static function fromUncleanUnSerialization(
+        ReflectionClass $reflectionClass,
+        $errorString,
+        $errorCode,
+        $errorFile,
+        $errorLine
+    ) {
+        return new self(
+            sprintf(
+                'Could not produce an instance of "%s" via un-serialization, since an error was triggered '
+                . 'in file "%s" at line "%d"',
+                $reflectionClass->getName(),
+                $errorFile,
+                $errorLine
+            ),
+            0,
+            new Exception($errorString, $errorCode)
+        );
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php b/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php
new file mode 100644 (file)
index 0000000..6d5b3b6
--- /dev/null
@@ -0,0 +1,273 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Instantiator;
+
+use Closure;
+use Doctrine\Instantiator\Exception\InvalidArgumentException;
+use Doctrine\Instantiator\Exception\UnexpectedValueException;
+use Exception;
+use ReflectionClass;
+
+/**
+ * {@inheritDoc}
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+final class Instantiator implements InstantiatorInterface
+{
+    /**
+     * Markers used internally by PHP to define whether {@see \unserialize} should invoke
+     * the method {@see \Serializable::unserialize()} when dealing with classes implementing
+     * the {@see \Serializable} interface.
+     */
+    const SERIALIZATION_FORMAT_USE_UNSERIALIZER   = 'C';
+    const SERIALIZATION_FORMAT_AVOID_UNSERIALIZER = 'O';
+
+    /**
+     * @var \Closure[] of {@see \Closure} instances used to instantiate specific classes
+     */
+    private static $cachedInstantiators = array();
+
+    /**
+     * @var object[] of objects that can directly be cloned
+     */
+    private static $cachedCloneables = array();
+
+    /**
+     * {@inheritDoc}
+     */
+    public function instantiate($className)
+    {
+        if (isset(self::$cachedCloneables[$className])) {
+            return clone self::$cachedCloneables[$className];
+        }
+
+        if (isset(self::$cachedInstantiators[$className])) {
+            $factory = self::$cachedInstantiators[$className];
+
+            return $factory();
+        }
+
+        return $this->buildAndCacheFromFactory($className);
+    }
+
+    /**
+     * Builds the requested object and caches it in static properties for performance
+     *
+     * @param string $className
+     *
+     * @return object
+     */
+    private function buildAndCacheFromFactory($className)
+    {
+        $factory  = self::$cachedInstantiators[$className] = $this->buildFactory($className);
+        $instance = $factory();
+
+        if ($this->isSafeToClone(new ReflectionClass($instance))) {
+            self::$cachedCloneables[$className] = clone $instance;
+        }
+
+        return $instance;
+    }
+
+    /**
+     * Builds a {@see \Closure} capable of instantiating the given $className without
+     * invoking its constructor.
+     *
+     * @param string $className
+     *
+     * @return Closure
+     */
+    private function buildFactory($className)
+    {
+        $reflectionClass = $this->getReflectionClass($className);
+
+        if ($this->isInstantiableViaReflection($reflectionClass)) {
+            return function () use ($reflectionClass) {
+                return $reflectionClass->newInstanceWithoutConstructor();
+            };
+        }
+
+        $serializedString = sprintf(
+            '%s:%d:"%s":0:{}',
+            $this->getSerializationFormat($reflectionClass),
+            strlen($className),
+            $className
+        );
+
+        $this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString);
+
+        return function () use ($serializedString) {
+            return unserialize($serializedString);
+        };
+    }
+
+    /**
+     * @param string $className
+     *
+     * @return ReflectionClass
+     *
+     * @throws InvalidArgumentException
+     */
+    private function getReflectionClass($className)
+    {
+        if (! class_exists($className)) {
+            throw InvalidArgumentException::fromNonExistingClass($className);
+        }
+
+        $reflection = new ReflectionClass($className);
+
+        if ($reflection->isAbstract()) {
+            throw InvalidArgumentException::fromAbstractClass($reflection);
+        }
+
+        return $reflection;
+    }
+
+    /**
+     * @param ReflectionClass $reflectionClass
+     * @param string          $serializedString
+     *
+     * @throws UnexpectedValueException
+     *
+     * @return void
+     */
+    private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, $serializedString)
+    {
+        set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) {
+            $error = UnexpectedValueException::fromUncleanUnSerialization(
+                $reflectionClass,
+                $message,
+                $code,
+                $file,
+                $line
+            );
+        });
+
+        $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString);
+
+        restore_error_handler();
+
+        if ($error) {
+            throw $error;
+        }
+    }
+
+    /**
+     * @param ReflectionClass $reflectionClass
+     * @param string          $serializedString
+     *
+     * @throws UnexpectedValueException
+     *
+     * @return void
+     */
+    private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, $serializedString)
+    {
+        try {
+            unserialize($serializedString);
+        } catch (Exception $exception) {
+            restore_error_handler();
+
+            throw UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $exception);
+        }
+    }
+
+    /**
+     * @param ReflectionClass $reflectionClass
+     *
+     * @return bool
+     */
+    private function isInstantiableViaReflection(ReflectionClass $reflectionClass)
+    {
+        if (\PHP_VERSION_ID >= 50600) {
+            return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal());
+        }
+
+        return \PHP_VERSION_ID >= 50400 && ! $this->hasInternalAncestors($reflectionClass);
+    }
+
+    /**
+     * Verifies whether the given class is to be considered internal
+     *
+     * @param ReflectionClass $reflectionClass
+     *
+     * @return bool
+     */
+    private function hasInternalAncestors(ReflectionClass $reflectionClass)
+    {
+        do {
+            if ($reflectionClass->isInternal()) {
+                return true;
+            }
+        } while ($reflectionClass = $reflectionClass->getParentClass());
+
+        return false;
+    }
+
+    /**
+     * Verifies if the given PHP version implements the `Serializable` interface serialization
+     * with an incompatible serialization format. If that's the case, use serialization marker
+     * "C" instead of "O".
+     *
+     * @link http://news.php.net/php.internals/74654
+     *
+     * @param ReflectionClass $reflectionClass
+     *
+     * @return string the serialization format marker, either self::SERIALIZATION_FORMAT_USE_UNSERIALIZER
+     *                or self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER
+     */
+    private function getSerializationFormat(ReflectionClass $reflectionClass)
+    {
+        if ($this->isPhpVersionWithBrokenSerializationFormat()
+            && $reflectionClass->implementsInterface('Serializable')
+        ) {
+            return self::SERIALIZATION_FORMAT_USE_UNSERIALIZER;
+        }
+
+        return self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER;
+    }
+
+    /**
+     * Checks whether the current PHP runtime uses an incompatible serialization format
+     *
+     * @return bool
+     */
+    private function isPhpVersionWithBrokenSerializationFormat()
+    {
+        return PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513;
+    }
+
+    /**
+     * Checks if a class is cloneable
+     *
+     * @param ReflectionClass $reflection
+     *
+     * @return bool
+     */
+    private function isSafeToClone(ReflectionClass $reflection)
+    {
+        if (method_exists($reflection, 'isCloneable') && ! $reflection->isCloneable()) {
+            return false;
+        }
+
+        // not cloneable if it implements `__clone`, as we want to avoid calling it
+        return ! $reflection->hasMethod('__clone');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php b/typo3/contrib/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php
new file mode 100644 (file)
index 0000000..b665bea
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace Doctrine\Instantiator;
+
+/**
+ * Instantiator provides utility methods to build objects without invoking their constructors
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+interface InstantiatorInterface
+{
+    /**
+     * @param string $className
+     *
+     * @return object
+     *
+     * @throws \Doctrine\Instantiator\Exception\ExceptionInterface
+     */
+    public function instantiate($className);
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php
new file mode 100644 (file)
index 0000000..3e8fc6f
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorPerformance;
+
+use Athletic\AthleticEvent;
+use Doctrine\Instantiator\Instantiator;
+
+/**
+ * Performance tests for {@see \Doctrine\Instantiator\Instantiator}
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class InstantiatorPerformanceEvent extends AthleticEvent
+{
+    /**
+     * @var \Doctrine\Instantiator\Instantiator
+     */
+    private $instantiator;
+
+    /**
+     * {@inheritDoc}
+     */
+    protected function setUp()
+    {
+        $this->instantiator = new Instantiator();
+
+        $this->instantiator->instantiate(__CLASS__);
+        $this->instantiator->instantiate('ArrayObject');
+        $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset');
+        $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset');
+        $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset');
+    }
+
+    /**
+     * @iterations 20000
+     * @baseline
+     * @group instantiation
+     */
+    public function testInstantiateSelf()
+    {
+        $this->instantiator->instantiate(__CLASS__);
+    }
+
+    /**
+     * @iterations 20000
+     * @group instantiation
+     */
+    public function testInstantiateInternalClass()
+    {
+        $this->instantiator->instantiate('ArrayObject');
+    }
+
+    /**
+     * @iterations 20000
+     * @group instantiation
+     */
+    public function testInstantiateSimpleSerializableAssetClass()
+    {
+        $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset');
+    }
+
+    /**
+     * @iterations 20000
+     * @group instantiation
+     */
+    public function testInstantiateSerializableArrayObjectAsset()
+    {
+        $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset');
+    }
+
+    /**
+     * @iterations 20000
+     * @group instantiation
+     */
+    public function testInstantiateUnCloneableAsset()
+    {
+        $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php
new file mode 100644 (file)
index 0000000..39d9b94
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTest\Exception;
+
+use Doctrine\Instantiator\Exception\InvalidArgumentException;
+use PHPUnit_Framework_TestCase;
+use ReflectionClass;
+
+/**
+ * Tests for {@see \Doctrine\Instantiator\Exception\InvalidArgumentException}
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ *
+ * @covers \Doctrine\Instantiator\Exception\InvalidArgumentException
+ */
+class InvalidArgumentExceptionTest extends PHPUnit_Framework_TestCase
+{
+    public function testFromNonExistingTypeWithNonExistingClass()
+    {
+        $className = __CLASS__ . uniqid();
+        $exception = InvalidArgumentException::fromNonExistingClass($className);
+
+        $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\InvalidArgumentException', $exception);
+        $this->assertSame('The provided class "' . $className . '" does not exist', $exception->getMessage());
+    }
+
+    public function testFromNonExistingTypeWithTrait()
+    {
+        if (PHP_VERSION_ID < 50400) {
+            $this->markTestSkipped('Need at least PHP 5.4.0, as this test requires traits support to run');
+        }
+
+        $exception = InvalidArgumentException::fromNonExistingClass(
+            'DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset'
+        );
+
+        $this->assertSame(
+            'The provided type "DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset" is a trait, '
+            . 'and can not be instantiated',
+            $exception->getMessage()
+        );
+    }
+
+    public function testFromNonExistingTypeWithInterface()
+    {
+        $exception = InvalidArgumentException::fromNonExistingClass('Doctrine\\Instantiator\\InstantiatorInterface');
+
+        $this->assertSame(
+            'The provided type "Doctrine\\Instantiator\\InstantiatorInterface" is an interface, '
+            . 'and can not be instantiated',
+            $exception->getMessage()
+        );
+    }
+
+    public function testFromAbstractClass()
+    {
+        $reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset');
+        $exception  = InvalidArgumentException::fromAbstractClass($reflection);
+
+        $this->assertSame(
+            'The provided class "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" is abstract, '
+            . 'and can not be instantiated',
+            $exception->getMessage()
+        );
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php
new file mode 100644 (file)
index 0000000..84154e7
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTest\Exception;
+
+use Doctrine\Instantiator\Exception\UnexpectedValueException;
+use Exception;
+use PHPUnit_Framework_TestCase;
+use ReflectionClass;
+
+/**
+ * Tests for {@see \Doctrine\Instantiator\Exception\UnexpectedValueException}
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ *
+ * @covers \Doctrine\Instantiator\Exception\UnexpectedValueException
+ */
+class UnexpectedValueExceptionTest extends PHPUnit_Framework_TestCase
+{
+    public function testFromSerializationTriggeredException()
+    {
+        $reflectionClass = new ReflectionClass($this);
+        $previous        = new Exception();
+        $exception       = UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $previous);
+
+        $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception);
+        $this->assertSame($previous, $exception->getPrevious());
+        $this->assertSame(
+            'An exception was raised while trying to instantiate an instance of "'
+            . __CLASS__  . '" via un-serialization',
+            $exception->getMessage()
+        );
+    }
+
+    public function testFromUncleanUnSerialization()
+    {
+        $reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset');
+        $exception  = UnexpectedValueException::fromUncleanUnSerialization($reflection, 'foo', 123, 'bar', 456);
+
+        $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception);
+        $this->assertSame(
+            'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" '
+            . 'via un-serialization, since an error was triggered in file "bar" at line "456"',
+            $exception->getMessage()
+        );
+
+        $previous = $exception->getPrevious();
+
+        $this->assertInstanceOf('Exception', $previous);
+        $this->assertSame('foo', $previous->getMessage());
+        $this->assertSame(123, $previous->getCode());
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php
new file mode 100644 (file)
index 0000000..0a2cb93
--- /dev/null
@@ -0,0 +1,219 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTest;
+
+use Doctrine\Instantiator\Exception\UnexpectedValueException;
+use Doctrine\Instantiator\Instantiator;
+use PHPUnit_Framework_TestCase;
+use ReflectionClass;
+
+/**
+ * Tests for {@see \Doctrine\Instantiator\Instantiator}
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ *
+ * @covers \Doctrine\Instantiator\Instantiator
+ */
+class InstantiatorTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Instantiator
+     */
+    private $instantiator;
+
+    /**
+     * {@inheritDoc}
+     */
+    protected function setUp()
+    {
+        $this->instantiator = new Instantiator();
+    }
+
+    /**
+     * @param string $className
+     *
+     * @dataProvider getInstantiableClasses
+     */
+    public function testCanInstantiate($className)
+    {
+        $this->assertInstanceOf($className, $this->instantiator->instantiate($className));
+    }
+
+    /**
+     * @param string $className
+     *
+     * @dataProvider getInstantiableClasses
+     */
+    public function testInstantiatesSeparateInstances($className)
+    {
+        $instance1 = $this->instantiator->instantiate($className);
+        $instance2 = $this->instantiator->instantiate($className);
+
+        $this->assertEquals($instance1, $instance2);
+        $this->assertNotSame($instance1, $instance2);
+    }
+
+    public function testExceptionOnUnSerializationException()
+    {
+        if (defined('HHVM_VERSION')) {
+            $this->markTestSkipped(
+                'As of facebook/hhvm#3432, HHVM has no PDORow, and therefore '
+                . ' no internal final classes that cannot be instantiated'
+            );
+        }
+
+        $className = 'DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset';
+
+        if (\PHP_VERSION_ID >= 50600) {
+            $className = 'PDORow';
+        }
+
+        if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) {
+            $className = 'DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset';
+        }
+
+        $this->setExpectedException('Doctrine\\Instantiator\\Exception\\UnexpectedValueException');
+
+        $this->instantiator->instantiate($className);
+    }
+
+    public function testNoticeOnUnSerializationException()
+    {
+        if (\PHP_VERSION_ID >= 50600) {
+            $this->markTestSkipped(
+                'PHP 5.6 supports `ReflectionClass#newInstanceWithoutConstructor()` for some internal classes'
+            );
+        }
+
+        try {
+            $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset');
+
+            $this->fail('No exception was raised');
+        } catch (UnexpectedValueException $exception) {
+            $wakeUpNoticesReflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset');
+            $previous                = $exception->getPrevious();
+
+            $this->assertInstanceOf('Exception', $previous);
+
+            // in PHP 5.4.29 and PHP 5.5.13, this case is not a notice, but an exception being thrown
+            if (! (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513)) {
+                $this->assertSame(
+                    'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\WakeUpNoticesAsset" '
+                    . 'via un-serialization, since an error was triggered in file "'
+                    . $wakeUpNoticesReflection->getFileName() . '" at line "36"',
+                    $exception->getMessage()
+                );
+
+                $this->assertSame('Something went bananas while un-serializing this instance', $previous->getMessage());
+                $this->assertSame(\E_USER_NOTICE, $previous->getCode());
+            }
+        }
+    }
+
+    /**
+     * @param string $invalidClassName
+     *
+     * @dataProvider getInvalidClassNames
+     */
+    public function testInstantiationFromNonExistingClass($invalidClassName)
+    {
+        $this->setExpectedException('Doctrine\\Instantiator\\Exception\\InvalidArgumentException');
+
+        $this->instantiator->instantiate($invalidClassName);
+    }
+
+    public function testInstancesAreNotCloned()
+    {
+        $className = 'TemporaryClass' . uniqid();
+
+        eval('namespace ' . __NAMESPACE__ . '; class ' . $className . '{}');
+
+        $instance = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className);
+
+        $instance->foo = 'bar';
+
+        $instance2 = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className);
+
+        $this->assertObjectNotHasAttribute('foo', $instance2);
+    }
+
+    /**
+     * Provides a list of instantiable classes (existing)
+     *
+     * @return string[][]
+     */
+    public function getInstantiableClasses()
+    {
+        $classes = array(
+            array('stdClass'),
+            array(__CLASS__),
+            array('Doctrine\\Instantiator\\Instantiator'),
+            array('Exception'),
+            array('PharException'),
+            array('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'),
+            array('DoctrineTest\\InstantiatorTestAsset\\ExceptionAsset'),
+            array('DoctrineTest\\InstantiatorTestAsset\\FinalExceptionAsset'),
+            array('DoctrineTest\\InstantiatorTestAsset\\PharExceptionAsset'),
+            array('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'),
+            array('DoctrineTest\\InstantiatorTestAsset\\XMLReaderAsset'),
+        );
+
+        if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) {
+            return $classes;
+        }
+
+        $classes = array_merge(
+            $classes,
+            array(
+                array('PharException'),
+                array('ArrayObject'),
+                array('DoctrineTest\\InstantiatorTestAsset\\ArrayObjectAsset'),
+                array('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'),
+            )
+        );
+
+        if (\PHP_VERSION_ID >= 50600) {
+            $classes[] = array('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset');
+            $classes[] = array('DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset');
+        }
+
+        return $classes;
+    }
+
+    /**
+     * Provides a list of instantiable classes (existing)
+     *
+     * @return string[][]
+     */
+    public function getInvalidClassNames()
+    {
+        $classNames = array(
+            array(__CLASS__ . uniqid()),
+            array('Doctrine\\Instantiator\\InstantiatorInterface'),
+            array('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'),
+        );
+
+        if (\PHP_VERSION_ID >= 50400) {
+            $classNames[] = array('DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset');
+        }
+
+        return $classNames;
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php
new file mode 100644 (file)
index 0000000..fbe28dd
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+/**
+ * A simple asset for an abstract class
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+abstract class AbstractClassAsset
+{
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php
new file mode 100644 (file)
index 0000000..56146d7
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use ArrayObject;
+use BadMethodCallException;
+
+/**
+ * Test asset that extends an internal PHP class
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class ArrayObjectAsset extends ArrayObject
+{
+    /**
+     * Constructor - should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function __construct()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ExceptionAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ExceptionAsset.php
new file mode 100644 (file)
index 0000000..43bbe46
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use Exception;
+
+/**
+ * Test asset that extends an internal PHP base exception
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class ExceptionAsset extends Exception
+{
+    /**
+     * Constructor - should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function __construct()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/FinalExceptionAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/FinalExceptionAsset.php
new file mode 100644 (file)
index 0000000..7d268f5
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use Exception;
+
+/**
+ * Test asset that extends an internal PHP base exception
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+final class FinalExceptionAsset extends Exception
+{
+    /**
+     * Constructor - should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function __construct()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php
new file mode 100644 (file)
index 0000000..553fd56
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use Phar;
+
+/**
+ * Test asset that extends an internal PHP class
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class PharAsset extends Phar
+{
+    /**
+     * Constructor - should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function __construct()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php
new file mode 100644 (file)
index 0000000..42bf73e
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use PharException;
+
+/**
+ * Test asset that extends an internal PHP class
+ * This class should be serializable without problems
+ * and without getting the "Erroneous data format for unserializing"
+ * error
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class PharExceptionAsset extends PharException
+{
+    /**
+     * Constructor - should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function __construct()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php
new file mode 100644 (file)
index 0000000..ba19aaf
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use ArrayObject;
+use BadMethodCallException;
+use Serializable;
+
+/**
+ * Serializable test asset that also extends an internal class
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class SerializableArrayObjectAsset extends ArrayObject implements Serializable
+{
+    /**
+     * Constructor - should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function __construct()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function serialize()
+    {
+        return '';
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * Should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function unserialize($serialized)
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php
new file mode 100644 (file)
index 0000000..39f84a6
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use Serializable;
+
+/**
+ * Base serializable test asset
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class SimpleSerializableAsset implements Serializable
+{
+    /**
+     * Constructor - should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function __construct()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function serialize()
+    {
+        return '';
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * Should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function unserialize($serialized)
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php
new file mode 100644 (file)
index 0000000..04e7806
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+/**
+ * A simple trait with no attached logic
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+trait SimpleTraitAsset
+{
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php
new file mode 100644 (file)
index 0000000..7d03bda
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+
+/**
+ * Base un-cloneable asset
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class UnCloneableAsset
+{
+    /**
+     * Constructor - should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function __construct()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+
+    /**
+     * Magic `__clone` - should not be invoked
+     *
+     * @throws BadMethodCallException
+     */
+    public function __clone()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php
new file mode 100644 (file)
index 0000000..b348a40
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use ArrayObject;
+use BadMethodCallException;
+
+/**
+ * A simple asset for an abstract class
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class UnserializeExceptionArrayObjectAsset extends ArrayObject
+{
+    /**
+     * {@inheritDoc}
+     */
+    public function __wakeup()
+    {
+        throw new BadMethodCallException();
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php
new file mode 100644 (file)
index 0000000..18dc671
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use ArrayObject;
+
+/**
+ * A simple asset for an abstract class
+ *
+ * @author Marco Pivetta <ocramius@gmail.com>
+ */
+class WakeUpNoticesAsset extends ArrayObject
+{
+    /**
+     * Wakeup method called after un-serialization
+     */
+    public function __wakeup()
+    {
+        trigger_error('Something went bananas while un-serializing this instance');
+    }
+}
diff --git a/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php b/typo3/contrib/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php
new file mode 100644 (file)
index 0000000..39ee699
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use XMLReader;
+
+/**
+ * Test asset that extends an internal PHP class
+ *
+ * @author Dave Marshall <dave@atst.io>
+ */
+class XMLReaderAsset extends XMLReader
+{
+    /**
+     * Constructor - should not be called
+     *
+     * @throws BadMethodCallException
+     */
+    public function __construct()
+    {
+        throw new BadMethodCallException('Not supposed to be called!');
+    }
+}
index 49ee89a..b53c297 100644 (file)
@@ -65,7 +65,6 @@ abstract class AbstractDomainObject implements DomainObjectInterface, \TYPO3\CMS
         * @return void
         */
        public function __wakeup() {
-               $this->initializeObject();
        }
 
        public function initializeObject() {
index cef2c75..7e564e8 100644 (file)
@@ -49,6 +49,11 @@ class Container implements \TYPO3\CMS\Core\SingletonInterface {
        private $classInfoFactory = NULL;
 
        /**
+        * @var \Doctrine\Instantiator\InstantiatorInterface
+        */
+       protected $instantiator = NULL;
+
+       /**
         * holds references of singletons
         *
         * @var array
@@ -96,6 +101,18 @@ class Container implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
+        * Internal method to create the class instantiator, extracted to be mockable
+        *
+        * @return \Doctrine\Instantiator\InstantiatorInterface
+        */
+       protected function getInstantiator() {
+               if ($this->instantiator == NULL) {
+                       $this->instantiator = new \Doctrine\Instantiator\Instantiator();
+               }
+               return $this->instantiator;
+       }
+
+       /**
         * Main method which should be used to get an instance of the wished class
         * specified by $className.
         *
@@ -117,8 +134,10 @@ class Container implements \TYPO3\CMS\Core\SingletonInterface {
        public function getEmptyObject($className) {
                $className = $this->getImplementationClassName($className);
                $classInfo = $this->getClassInfo($className);
-               // get an object and avoid calling __construct()
-               $object = unserialize('O:' . strlen($className) . ':"' . $className . '":0:{};');
+               $object = $this->getInstantiator()->instantiate($className);
+               if ($classInfo->getIsInitializeable() && is_callable(array($object, 'initializeObject'))) {
+                       $object->initializeObject();
+               }
                $this->injectDependencies($object, $classInfo);
                return $object;
        }