diff --git a/composer.json b/composer.json index f7c61ff249727ed2d23d9ac7f7599eeecbadb044..8c45941fe90d69dc9eff213fe41e32d539a21e20 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "symfony/validator": "2.3.*", "symfony/yaml": "2.3.*", "twig/twig": "1.12.*", - "doctrine/common": "2.4.*@beta", + "doctrine/common": "dev-master", "doctrine/annotations": "dev-master#463d926a8dcc49271cb7db5a08364a70ed6e3cd3", "guzzle/http": "3.7.*", "kriswallsmith/assetic": "1.1.*@alpha", diff --git a/composer.lock b/composer.lock index c294b1368071c089f743e6cb7e5254eb638898a5..060ebb155b753e5a57404943915db4f0759664cb 100644 --- a/composer.lock +++ b/composer.lock @@ -3,7 +3,7 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "414745173d1e926721e1d7511a65dcec", + "hash": "c0c7604f8c0ed6b60809dfe98015e8b8", "packages": [ { "name": "doctrine/annotations", @@ -207,16 +207,16 @@ }, { "name": "doctrine/common", - "version": "2.4.0-RC4", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "2.4.0-RC4" + "reference": "ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/2.4.0-RC4", - "reference": "2.4.0-RC4", + "url": "https://api.github.com/repos/doctrine/common/zipball/ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0", + "reference": "ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0", "shasum": "" }, "require": { @@ -230,7 +230,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4.x-dev" + "dev-master": "2.5.x-dev" } }, "autoload": { @@ -246,7 +246,8 @@ { "name": "Jonathan Wage", "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/" + "homepage": "http://www.jwage.com/", + "role": "Creator" }, { "name": "Guilherme Blanco", @@ -262,9 +263,9 @@ "email": "kontakt@beberlei.de" }, { - "name": "Johannes M. Schmitt", + "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", + "homepage": "http://jmsyst.com", "role": "Developer of wrapped JMSSerializerBundle" } ], @@ -277,7 +278,7 @@ "persistence", "spl" ], - "time": "2013-06-21 12:11:28" + "time": "2013-12-03 21:02:18" }, { "name": "doctrine/inflector", @@ -2056,7 +2057,7 @@ ], "minimum-stability": "stable", "stability-flags": { - "doctrine/common": 10, + "doctrine/common": 20, "doctrine/annotations": 20, "kriswallsmith/assetic": 15, "symfony-cmf/routing": 15, diff --git a/core/vendor/autoload.php b/core/vendor/autoload.php index e04ca3b9905bb99b5d660f79dff3c6c7f15d358a..f8716f6c3c4cfd0dd8fafb2058c2bfc6fed42286 100644 --- a/core/vendor/autoload.php +++ b/core/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInite23e221879b77f56988466576fc63488::getLoader(); +return ComposerAutoloaderInit0fa08cab46efc8ac2870c28f0a4fd5aa::getLoader(); diff --git a/core/vendor/composer/autoload_real.php b/core/vendor/composer/autoload_real.php index c769cff35f438b6eed946801468c95e9b94ee3be..92b047245fd27138fb79f4888543247b5008051a 100644 --- a/core/vendor/composer/autoload_real.php +++ b/core/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInite23e221879b77f56988466576fc63488 +class ComposerAutoloaderInit0fa08cab46efc8ac2870c28f0a4fd5aa { private static $loader; @@ -19,9 +19,9 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInite23e221879b77f56988466576fc63488', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit0fa08cab46efc8ac2870c28f0a4fd5aa', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInite23e221879b77f56988466576fc63488', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit0fa08cab46efc8ac2870c28f0a4fd5aa', 'loadClassLoader')); $vendorDir = dirname(__DIR__); $baseDir = dirname(dirname($vendorDir)); diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index 8185314123cb8c3c2ee38dd278dfa98682deab91..c0e985b14c54d275401fc71f2256daf61f2eb10d 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -932,82 +932,6 @@ "string" ] }, - { - "name": "doctrine/common", - "version": "2.4.0-RC4", - "version_normalized": "2.4.0.0-RC4", - "source": { - "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "2.4.0-RC4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/2.4.0-RC4", - "reference": "2.4.0-RC4", - "shasum": "" - }, - "require": { - "doctrine/annotations": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/inflector": "1.*", - "doctrine/lexer": "1.*", - "php": ">=5.3.2" - }, - "time": "2013-06-21 12:11:28", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Doctrine\\Common\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" - } - ], - "description": "Common Library for Doctrine projects", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "collections", - "eventmanager", - "persistence", - "spl" - ] - }, { "name": "guzzle/common", "version": "v3.7.1", @@ -2116,5 +2040,82 @@ "docblock", "parser" ] + }, + { + "name": "doctrine/common", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0", + "reference": "ba2ad8a7db24adb37a33ff52ee64b02d59ccfee0", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "doctrine/collections": "1.*", + "doctrine/inflector": "1.*", + "doctrine/lexer": "1.*", + "php": ">=5.3.2" + }, + "time": "2013-12-03 21:02:18", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Doctrine\\Common\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "http://jmsyst.com", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Common Library for Doctrine projects", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ] } ] diff --git a/core/vendor/doctrine/common/.gitignore b/core/vendor/doctrine/common/.gitignore index 4815ac925972b5ec46cef0d44160656fd0da2c79..fc873f9bd7141f8124127c3df84fdcaf54d8b07e 100644 --- a/core/vendor/doctrine/common/.gitignore +++ b/core/vendor/doctrine/common/.gitignore @@ -5,3 +5,5 @@ dist/ tests/Doctrine/Tests/Common/Proxy/generated/ vendor/ .idea +doctrine-common-*.tar +doctrine-common-*.tar.gz diff --git a/core/vendor/doctrine/common/.travis.yml b/core/vendor/doctrine/common/.travis.yml index f7fe5c3586835e68e2b5efdd3ed4a0627c58f88f..333d36b3bdc432bf95732567b43b824db22280bf 100644 --- a/core/vendor/doctrine/common/.travis.yml +++ b/core/vendor/doctrine/common/.travis.yml @@ -1,8 +1,5 @@ language: php -env: - - OPCODE_CACHE=apc - php: - 5.3.3 - 5.3 @@ -11,4 +8,3 @@ php: before_script: - composer --prefer-source install - - php ./bin/travis-setup.php $OPCODE_CACHE diff --git a/core/vendor/doctrine/common/bin/travis-setup.php b/core/vendor/doctrine/common/bin/travis-setup.php deleted file mode 100644 index b51e26700f3265ad725265fa999b19507fbe2ff1..0000000000000000000000000000000000000000 --- a/core/vendor/doctrine/common/bin/travis-setup.php +++ /dev/null @@ -1,141 +0,0 @@ -<?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>. - */ - -/** - * Install PHP extensions required for testing by Travis CI. - * - * @author Victor Berchet <victor@suumit.com> - * @since 2.2 - */ -$installer = new PhpExtensions(); - -if (isset($argv[1]) && 'APC' === strtoupper($argv[1])) { - $installer->install('apc'); -} else { - $installer->install('xcache'); -} - -$installer->install('memcache'); -$installer->install('memcached'); - -class PhpExtensions -{ - protected $extensions; - protected $phpVersion; - protected $iniPath; - - public function __construct() - { - $this->phpVersion = phpversion(); - $this->iniPath = php_ini_loaded_file(); - $this->extensions = array( - 'memcache' => array( - 'url' => 'http://pecl.php.net/get/memcache-2.2.6.tgz', - 'php_version' => array(), - 'cfg' => array('--enable-memcache'), - 'ini' => array('extension=memcache.so'), - ), - 'memcached' => array( - 'url' => 'http://pecl.php.net/get/memcached-1.0.2.tgz', - 'php_version' => array( - // memcached 1.0.2 does not build on PHP 5.4 - array('<', '5.4'), - ), - 'cfg' => array(), - 'ini' => array('extension=memcached.so'), - ), - 'apc' => array( - 'url' => 'http://pecl.php.net/get/APC-3.1.9.tgz', - 'php_version' => array( - // apc 3.1.9 causes a segfault on PHP 5.4 - array('<', '5.4'), - ), - 'cfg' => array(), - 'ini' => array( - 'extension=apc.so', - 'apc.enabled=1', - 'apc.enable_cli=1' - ), - ), - 'xcache' => array( - 'url' => 'http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz', - 'php_version' => array( - // xcache does not build with Travis CI (as of 2012-01-09) - array('<', '5'), - ), - 'cfg' => array('--enable-xcache'), - 'ini' => array( - 'extension=xcache.so', - 'xcache.cacher=false', - 'xcache.admin.enable_auth=0', - 'xcache.var_size=1M', - ), - ), - ); - } - - public function install($name) - { - if (array_key_exists($name, $this->extensions)) { - $extension = $this->extensions[$name]; - - - echo "== extension: $name ==\n"; - - foreach ($extension['php_version'] as $version) { - if (!version_compare($this->phpVersion, $version[1], $version[0])) { - printf( - "=> not installed, requires a PHP version %s %s (%s installed)\n", - $version[0], - $version[1], - $this->phpVersion - ); - - return; - } - } - - $this->system(sprintf("wget %s > /dev/null 2>&1", $extension['url'])); - $file = basename($extension['url']); - $this->system(sprintf("tar -xzf %s > /dev/null 2>&1", $file)); - $folder = basename($file, ".tgz"); - $folder = basename($folder, ".tar.gz"); - $this->system(sprintf( - 'sh -c "cd %s && phpize && ./configure %s && make && sudo make install" > /dev/null 2>&1', - $folder, - implode(' ', $extension['cfg']) - )); - foreach ($extension['ini'] as $ini) { - $this->system(sprintf("echo %s >> %s", $ini, $this->iniPath)); - } - printf("=> installed (%s)\n", $folder); - } - } - - private function system($cmd) - { - $ret = 0; - system($cmd, $ret); - if (0 !== $ret) { - printf("=> Command '%s' failed !", $cmd); - - exit($ret); - } - } -} diff --git a/core/vendor/doctrine/common/build.properties b/core/vendor/doctrine/common/build.properties index ff311a45925fb3e911bb0012724d395b6bcd2635..ef51d207f65448cc27f5511a19525b834dccfebb 100644 --- a/core/vendor/doctrine/common/build.properties +++ b/core/vendor/doctrine/common/build.properties @@ -1,6 +1,3 @@ -# Project Name -project.name=DoctrineCommon - # Version class and file -project.version_class = Doctrine\Common\Version +project.version_class = Doctrine\\Common\\Version project.version_file = lib/Doctrine/Common/Version.php diff --git a/core/vendor/doctrine/common/build.xml b/core/vendor/doctrine/common/build.xml index 9d9100db5ae3e8a4fc028733f3f467ab1eaded05..429b7688fe307747806460497dfa75426df3dff0 100644 --- a/core/vendor/doctrine/common/build.xml +++ b/core/vendor/doctrine/common/build.xml @@ -1,59 +1,101 @@ <?xml version="1.0"?> -<project name="Doctrine2" default="build" basedir="."> - <taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" /> - <import file="${project.basedir}/lib/vendor/doctrine-build-common/packaging.xml" /> - +<project name="DoctrineCommon" default="build" basedir="."> <property file="build.properties" /> - - <!-- - Fileset for artifacts shared across all distributed packages. - --> - <fileset id="shared-artifacts" dir="."> - <include name="LICENSE"/> - <include name="COPYRIGHT"/> - <include name="CHANGELOG"/> - </fileset> - - <!-- - Fileset for the sources of the Doctrine Common package. - --> - <fileset id="common-sources" dir="./lib"> - <include name="Doctrine/Common/**"/> - </fileset> - - <!-- - Builds Common package, preparing it for distribution. - --> - <target name="copy-files" depends="prepare"> - <copy todir="${build.dir}/${project.name}-${version}"> - <fileset refid="shared-artifacts"/> - </copy> - <copy todir="${build.dir}/${project.name}-${version}"> - <fileset refid="common-sources"/> - </copy> - </target> - - <!-- - Builds distributable PEAR packages. - --> - <target name="define-pear-package" depends="copy-files"> - <d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${project.name}-${version}"> - <name>DoctrineCommon</name> - <summary>Doctrine Common PHP Extensions</summary> - <channel>pear.doctrine-project.org</channel> - <description>The Doctrine Common package contains shared code between the other packages.</description> - <lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" /> - <lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" /> - <lead user="romanb" name="Roman Borschel" email="roman@code-factory.org" /> - <lead user="beberlei" name="Benjamin Eberlei" email="kontakt@beberlei.de" /> - <license>MIT</license> - <version release="${pear.version}" api="${pear.version}" /> - <stability release="${pear.stability}" api="${pear.stability}" /> - <notes>-</notes> - <dependencies> - <php minimum_version="5.3.0" /> - <pear minimum_version="1.6.0" recommended_version="1.6.1" /> - </dependencies> - </d51pearpkg2> + + <target name="php"> + <exec executable="which" outputproperty="php_executable"> + <arg value="php" /> + </exec> + </target> + + <target name="prepare"> + <mkdir dir="build" /> + </target> + + <target name="build" depends="check-git-checkout-clean,prepare,php,composer"> + <exec executable="${php_executable}"> + <arg value="build/composer.phar" /> + <arg value="archive" /> + <arg value="--dir=build" /> + </exec> </target> + + <target name="composer" depends="php,composer-check,composer-download"> + <exec executable="${php_executable}"> + <arg value="build/composer.phar" /> + <arg value="install" /> + </exec> + </target> + + <target name="composer-check" depends="prepare"> + <available file="build/composer.phar" property="composer.present"/> + </target> + + <target name="composer-download" unless="composer.present"> + <exec executable="wget"> + <arg value="-Obuild/composer.phar" /> + <arg value="http://getcomposer.org/composer.phar" /> + </exec> + </target> + + <target name="make-release" depends="check-git-checkout-clean,prepare,php"> + <replace file="${project.version_file}" token="-DEV" value="" failOnNoReplacements="true" /> + <exec executable="${php_executable}" outputproperty="doctrine.current_version" failonerror="true"> + <arg value="-r" /> + <arg value="require_once '${project.version_file}';echo ${project.version_class}::VERSION;" /> + </exec> + <exec executable="${php_executable}" outputproperty="doctrine.next_version" failonerror="true"> + <arg value="-r" /> + <arg value="$parts = explode('.', str_ireplace(array('-DEV', '-ALPHA', '-BETA'), '', '${doctrine.current_version}')); + if (count($parts) != 3) { + throw new \InvalidArgumentException('Version is assumed in format x.y.z, ${doctrine.current_version} given'); + } + $parts[2]++; + echo implode('.', $parts); + " /> + </exec> + + <git-commit file="${project.version_file}" message="Release ${doctrine.current_version}" /> + <git-tag version="${doctrine.current_version}" /> + <replace file="${project.version_file}" token="${doctrine.current_version}" value="${doctrine.next_version}-DEV" /> + <git-commit file="${project.version_file}" message="Bump version to ${doctrine.next_version}" /> + </target> + + <target name="check-git-checkout-clean"> + <exec executable="git" failonerror="true"> + <arg value="diff-index" /> + <arg value="--quiet" /> + <arg value="HEAD" /> + </exec> + </target> + + <macrodef name="git-commit"> + <attribute name="file" default="NOT SET"/> + <attribute name="message" default="NOT SET"/> + + <sequential> + <exec executable="git"> + <arg value="add" /> + <arg value="@{file}" /> + </exec> + <exec executable="git"> + <arg value="commit" /> + <arg value="-m" /> + <arg value="@{message}" /> + </exec> + </sequential> + </macrodef> + + <macrodef name="git-tag"> + <attribute name="version" default="NOT SET" /> + + <sequential> + <exec executable="git"> + <arg value="tag" /> + <arg value="-m" /> + <arg value="v@{version}" /> + <arg value="v@{version}" /> + </exec> + </sequential> + </macrodef> </project> diff --git a/core/vendor/doctrine/common/composer.json b/core/vendor/doctrine/common/composer.json index 24f9a2ca79b5f193a3f11a7a89322539fef80dcc..41cef10bcef1e1db462638cc47d7527c14daaf85 100644 --- a/core/vendor/doctrine/common/composer.json +++ b/core/vendor/doctrine/common/composer.json @@ -25,7 +25,10 @@ }, "extra": { "branch-alias": { - "dev-master": "2.4.x-dev" + "dev-master": "2.5.x-dev" } + }, + "archive": { + "exclude": ["!vendor", "tests", "*phpunit.xml", ".travis.yml", "build.xml", "build.properties", "composer.phar"] } } diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php b/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php index fbbd2a8ae424da333879a4313fe77bc6f69f5e1d..69eb17ec693ff00b89c583405b73aef128a0da5d 100644 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php +++ b/core/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php @@ -127,7 +127,7 @@ public function removeEventListener($events, $listener) } /** - * Adds an EventSubscriber. The subscriber is asked for all the events he is + * Adds an EventSubscriber. The subscriber is asked for all the events it is * interested in and added as a listener for these events. * * @param \Doctrine\Common\EventSubscriber $subscriber The subscriber. diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php index bb29e438e19333f9c2530a6fb3e8e1c8c9beb50f..02208c9d5963bd6ad74f1d2de2705f1110f4eaea 100644 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php +++ b/core/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php @@ -30,7 +30,7 @@ interface ObjectManager { /** - * Finds a object by its identifier. + * Finds an object by its identifier. * * This is just a convenient shortcut for getRepository($className)->find($id). * diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php index b8ba6774804f6469912dedb8ec37f15a36a3fde6..dd1ae1b9b6979e623c00dfb6275ada0ddcf55703 100644 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php +++ b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php @@ -21,6 +21,7 @@ use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory; use Doctrine\Common\Proxy\Exception\InvalidArgumentException; +use Doctrine\Common\Proxy\Exception\OutOfBoundsException; use Doctrine\Common\Util\ClassUtils; use Doctrine\Common\Persistence\Mapping\ClassMetadata; @@ -31,6 +32,43 @@ */ abstract class AbstractProxyFactory { + /** + * Never autogenerate a proxy and rely that it was generated by some + * process before deployment. + * + * @var integer + */ + const AUTOGENERATE_NEVER = 0; + + /** + * Always generates a new proxy in every request. + * + * This is only sane during development. + * + * @var integer + */ + const AUTOGENERATE_ALWAYS = 1; + + /** + * Autogenerate the proxy class when the proxy file does not exist. + * + * This strategy causes a file exists call whenever any proxy is used the + * first time in a request. + * + * @var integer + */ + const AUTOGENERATE_FILE_NOT_EXISTS = 2; + + /** + * Generate the proxy classes using eval(). + * + * This strategy is only sane for development, and even then it gives me + * the creeps a little. + * + * @var integer + */ + const AUTOGENERATE_EVAL = 3; + /** * @var \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory */ @@ -54,13 +92,13 @@ abstract class AbstractProxyFactory /** * @param \Doctrine\Common\Proxy\ProxyGenerator $proxyGenerator * @param \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory $metadataFactory - * @param bool $autoGenerate + * @param bool|int $autoGenerate */ public function __construct(ProxyGenerator $proxyGenerator, ClassMetadataFactory $metadataFactory, $autoGenerate) { $this->proxyGenerator = $proxyGenerator; $this->metadataFactory = $metadataFactory; - $this->autoGenerate = $autoGenerate; + $this->autoGenerate = (int)$autoGenerate; } /** @@ -71,6 +109,8 @@ public function __construct(ProxyGenerator $proxyGenerator, ClassMetadataFactory * @param array $identifier * * @return \Doctrine\Common\Proxy\Proxy + * + * @throws \Doctrine\Common\Proxy\Exception\OutOfBoundsException */ public function getProxy($className, array $identifier) { @@ -81,6 +121,10 @@ public function getProxy($className, array $identifier) $proxy = new $fqcn($definition->initializer, $definition->cloner); foreach ($definition->identifierFields as $idField) { + if (! isset($identifier[$idField])) { + throw OutOfBoundsException::missingPrimaryKeyValue($className, $idField); + } + $definition->reflectionFields[$idField]->setValue($proxy, $identifier[$idField]); } @@ -158,11 +202,27 @@ private function getProxyDefinition($className) if ( ! class_exists($proxyClassName, false)) { $fileName = $this->proxyGenerator->getProxyFileName($className); - if ($this->autoGenerate) { - $this->proxyGenerator->generateProxyClass($classMetadata); + switch ($this->autoGenerate) { + case self::AUTOGENERATE_NEVER: + require $fileName; + break; + + case self::AUTOGENERATE_FILE_NOT_EXISTS: + if ( ! file_exists($fileName)) { + $this->proxyGenerator->generateProxyClass($classMetadata, $fileName); + } + require $fileName; + break; + + case self::AUTOGENERATE_ALWAYS: + $this->proxyGenerator->generateProxyClass($classMetadata, $fileName); + require $fileName; + break; + + case self::AUTOGENERATE_EVAL: + $this->proxyGenerator->generateProxyClass($classMetadata, false); + break; } - - require $fileName; } return $this->definitions[$className]; diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php new file mode 100644 index 0000000000000000000000000000000000000000..348cfcb2579f65b31d506658399e20ef78ad43a8 --- /dev/null +++ b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/OutOfBoundsException.php @@ -0,0 +1,43 @@ +<?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\Common\Proxy\Exception; + +use Doctrine\Common\Persistence\Proxy; +use OutOfBoundsException as BaseOutOfBoundsException; + +/** + * Proxy Invalid Argument Exception. + * + * @link www.doctrine-project.org + * @author Fredrik Wendel <fredrik_w@users.sourceforge.net> + */ +class OutOfBoundsException extends BaseOutOfBoundsException implements ProxyException +{ + /** + * @param string $className + * @param string $idField + * + * @return self + */ + public static function missingPrimaryKeyValue($className, $idField) + { + return new self(sprintf("Missing value for primary key %s on %s", $idField, $className)); + } +} diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php index 483ab67a9bf89fc22b594e52b3e0818bf7c96c1e..fd7649053b9f0fc141eb77608ed5651e59918af5 100644 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php +++ b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php @@ -254,11 +254,11 @@ public function setProxyClassTemplate($proxyClassTemplate) * Generates a proxy class file. * * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class Metadata for the original class. - * @param string $fileName Filename (full path) for the generated class. + * @param string|bool $fileName Filename (full path) for the generated class. If none is given, eval() is used. * * @throws UnexpectedValueException */ - public function generateProxyClass(ClassMetadata $class, $fileName = null) + public function generateProxyClass(ClassMetadata $class, $fileName = false) { preg_match_all('(<([a-zA-Z]+)>)', $this->proxyClassTemplate, $placeholderMatches); @@ -277,8 +277,18 @@ public function generateProxyClass(ClassMetadata $class, $fileName = null) } } - $proxyCode = strtr($this->proxyClassTemplate, $placeholders); - $fileName = $fileName ?: $this->getProxyFileName($class->getName()); + $proxyCode = strtr($this->proxyClassTemplate, $placeholders); + + if ( ! $fileName) { + $proxyClassName = $this->generateNamespace($class) . '\\' . $this->generateProxyShortClassName($class); + + if ( ! class_exists($proxyClassName)) { + eval(substr($proxyCode, 5)); + } + + return; + } + $parentDirectory = dirname($fileName); if ( ! is_dir($parentDirectory) && (false === @mkdir($parentDirectory, 0775, true))) { @@ -609,7 +619,13 @@ public function __sleep() /* @var $prop \ReflectionProperty */ foreach ($class->getReflectionClass()->getProperties() as $prop) { - $allProperties[] = $prop->getName(); + if ($prop->isStatic()) { + continue; + } + + $allProperties[] = $prop->isPrivate() + ? "\0" . $prop->getDeclaringClass()->getName() . "\0" . $prop->getName() + : $prop->getName(); } $lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class)); diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php index 8f25c9ab20c8fcce8d6ae73264b882126e87e981..0959ce5d5b5d41ba1b433d4765e8582f056d2d30 100644 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php +++ b/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php @@ -48,10 +48,17 @@ private function __construct() * @param mixed $var The variable to dump. * @param integer $maxDepth The maximum nesting level for object properties. * @param boolean $stripTags Whether output should strip HTML tags. + * @param boolean $echo Send the dumped value to the output buffer + * + * @return string */ - public static function dump($var, $maxDepth = 2, $stripTags = true) + public static function dump($var, $maxDepth = 2, $stripTags = true, $echo = true) { - ini_set('html_errors', 'On'); + $html = ini_get('html_errors'); + + if ($html !== true) { + ini_set('html_errors', true); + } if (extension_loaded('xdebug')) { ini_set('xdebug.var_display_max_depth', $maxDepth); @@ -61,12 +68,20 @@ public static function dump($var, $maxDepth = 2, $stripTags = true) ob_start(); var_dump($var); + $dump = ob_get_contents(); + ob_end_clean(); - echo ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump); + $dumpText = ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump); - ini_set('html_errors', 'Off'); + ini_set('html_errors', $html); + + if ($echo) { + echo $dumpText; + } + + return $dumpText; } /** diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php index f23a461ab2833cd23143aaca7e7dab8dff585a91..bc9e2bdde5c71289c93af42bab225db893de8e57 100644 --- a/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php +++ b/core/vendor/doctrine/common/lib/Doctrine/Common/Version.php @@ -34,7 +34,7 @@ class Version /** * Current Doctrine Version. */ - const VERSION = '2.4.1'; + const VERSION = '2.5.0-DEV'; /** * Compares a Doctrine version with the current one. diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php index 8aa966d9a14f6a3a0a6c35e495bf74851cb268c6..6ae9316383c1f02fdd76439bb752af7f3b4732ee 100644 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php +++ b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/AbstractProxyFactoryTest.php @@ -114,5 +114,33 @@ public function testDisallowsResettingInitializedProxy() $proxyFactory->resetUninitializedProxy($proxy); } + + public function testMissingPrimaryKeyValue() + { + $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); + $proxy = $this->getMock('Doctrine\Common\Proxy\Proxy'); + $definition = new ProxyDefinition(get_class($proxy), array('missingKey'), array(), null, null); + $proxyGenerator = $this->getMock('Doctrine\Common\Proxy\ProxyGenerator', array(), array(), '', false); + $metadataFactory = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory'); + + $metadataFactory + ->expects($this->once()) + ->method('getMetadataFor') + ->will($this->returnValue($metadata)); + + $proxyFactory = $this->getMockForAbstractClass( + 'Doctrine\Common\Proxy\AbstractProxyFactory', + array($proxyGenerator, $metadataFactory, true) + ); + + $proxyFactory + ->expects($this->any()) + ->method('createProxyDefinition') + ->will($this->returnValue($definition)); + + $this->setExpectedException('\OutOfBoundsException'); + + $generatedProxy = $proxyFactory->getProxy('Class', array()); + } } diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php index e0c21ee63a5985a93e3b139f7ed64409b98d90d2..45d45e5d6a377033fe5623f576b17cfa81992f64 100644 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php +++ b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php @@ -61,8 +61,7 @@ protected function setUp() return; } - $this->proxyGenerator->generateProxyClass($this->metadata); - require_once $this->proxyGenerator->getProxyFileName($this->metadata->getName()); + $this->generateAndRequire($this->proxyGenerator, $this->metadata); } public function testReferenceProxyRespectsMethodsParametersTypeHinting() @@ -107,14 +106,11 @@ public function testNonNamespacedProxyGeneration() public function testClassWithSleepProxyGeneration() { if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\SleepClass', false)) { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $reflClass = new ReflectionClass('Doctrine\Tests\Common\Proxy\SleepClass'); - $metadata->expects($this->any())->method('getReflectionClass')->will($this->returnValue($reflClass)); - $metadata->expects($this->any())->method('getIdentifierFieldNames')->will($this->returnValue(array('id'))); - $metadata->expects($this->any())->method('getName')->will($this->returnValue($reflClass->getName())); + $className = 'Doctrine\Tests\Common\Proxy\SleepClass'; + $metadata = $this->createClassMetadata($className, array('id')); $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - $proxyGenerator->generateProxyClass($metadata); - require_once $proxyGenerator->getProxyFileName($metadata->getName()); + + $this->generateAndRequire($proxyGenerator, $metadata); } $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxySleepClass.php'); @@ -122,6 +118,32 @@ public function testClassWithSleepProxyGeneration() $this->assertEquals(1, substr_count($classCode, 'parent::__sleep()')); } + /** + * Check that the proxy doesn't serialize static properties (in __sleep() method) + * @group DCOM-212 + */ + public function testClassWithStaticPropertyProxyGeneration() + { + if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\StaticPropertyClass', false)) { + $className = 'Doctrine\Tests\Common\Proxy\StaticPropertyClass'; + $metadata = $this->createClassMetadata($className, array()); + $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); + + $this->generateAndRequire($proxyGenerator, $metadata); + } + + $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyStaticPropertyClass.php'); + $this->assertEquals(1, substr_count($classCode, 'function __sleep')); + $this->assertNotContains('protectedStaticProperty', $classCode); + } + + private function generateAndRequire($proxyGenerator, $metadata) + { + $proxyGenerator->generateProxyClass($metadata, $proxyGenerator->getProxyFileName($metadata->getName())); + + require_once $proxyGenerator->getProxyFileName($metadata->getName()); + } + public function testClassWithCallableTypeHintOnProxiedMethod() { if (PHP_VERSION_ID < 50400) { @@ -129,16 +151,11 @@ public function testClassWithCallableTypeHintOnProxiedMethod() } if (!class_exists('Doctrine\Tests\Common\ProxyProxy\__CG__\CallableTypeHintClass', false)) { - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $reflClass = new ReflectionClass('Doctrine\Tests\Common\Proxy\CallableTypeHintClass'); - $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); - - $metadata->expects($this->any())->method('getReflectionClass')->will($this->returnValue($reflClass)); - $metadata->expects($this->any())->method('getIdentifierFieldNames')->will($this->returnValue(array('id'))); - $metadata->expects($this->any())->method('getName')->will($this->returnValue($reflClass->getName())); + $className = 'Doctrine\Tests\Common\Proxy\CallableTypeHintClass'; + $metadata = $this->createClassMetadata($className, array('id')); - $proxyGenerator->generateProxyClass($metadata); - require_once $proxyGenerator->getProxyFileName($metadata->getName()); + $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); + $this->generateAndRequire($proxyGenerator, $metadata); } $classCode = file_get_contents(__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyCallableTypeHintClass.php'); @@ -149,11 +166,7 @@ public function testClassWithCallableTypeHintOnProxiedMethod() public function testClassWithInvalidTypeHintOnProxiedMethod() { $className = 'Doctrine\Tests\Common\Proxy\InvalidTypeHintClass'; - $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); - $reflClass = new ReflectionClass($className); - $metadata->expects($this->any())->method('getReflectionClass')->will($this->returnValue($reflClass)); - $metadata->expects($this->any())->method('getIdentifierFieldNames')->will($this->returnValue(array())); - $metadata->expects($this->any())->method('getName')->will($this->returnValue($className)); + $metadata = $this->createClassMetadata($className, array('id')); $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); $this->setExpectedException( @@ -182,4 +195,34 @@ public function testInvalidPlaceholderThrowsException() $generator = new ProxyGenerator(__DIR__ . '/generated', 'SomeNamespace'); $generator->setPlaceholder('<somePlaceholder>', array()); } + + public function testUseEvalIfNoFilenameIsGiven() + { + $proxyGenerator = new ProxyGenerator(__DIR__ . '/generated', __NAMESPACE__ . 'Proxy', true); + + $className = __NAMESPACE__ . '\\EvalBase'; + + $metadata = $this->createClassMetadata($className, array('id')); + + $proxyGenerator->generateProxyClass($metadata); + + $reflClass = new ReflectionClass('Doctrine\Tests\Common\ProxyProxy\__CG__\Doctrine\Tests\Common\Proxy\EvalBase'); + + $this->assertContains("eval()'d code", $reflClass->getFileName()); + } + + private function createClassMetadata($className, array $ids) + { + $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); + $reflClass = new ReflectionClass($className); + $metadata->expects($this->any())->method('getReflectionClass')->will($this->returnValue($reflClass)); + $metadata->expects($this->any())->method('getIdentifierFieldNames')->will($this->returnValue($ids)); + $metadata->expects($this->any())->method('getName')->will($this->returnValue($className)); + + return $metadata; + } +} + +class EvalBase +{ } diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php index 935db31bcfb70dee5a276762b967791382d0df9e..1ed9d92a726bbbe5e4d2ba7265bde78a41484280 100644 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php +++ b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/ProxyMagicMethodsTest.php @@ -230,6 +230,26 @@ function ($proxy) { $this->assertTrue($cloned->cloned); } + /** + * @group DCOM-175 + */ + public function testClonesPrivateProperties() + { + $proxyClassName = $this->generateProxyClass(__NAMESPACE__ . '\\SerializedClass'); + /* @var $proxy SerializedClass */ + $proxy = new $proxyClassName(); + + $proxy->setFoo(1); + $proxy->setBar(2); + $proxy->setBaz(3); + + $unserialized = unserialize(serialize($proxy)); + + $this->assertSame(1, $unserialized->getFoo()); + $this->assertSame(2, $unserialized->getBar()); + $this->assertSame(3, $unserialized->getBaz()); + } + /** * @param $className * @@ -299,7 +319,7 @@ private function generateProxyClass($className) ->method('getTypeOfField') ->will($this->returnValue('string')); - $this->proxyGenerator->generateProxyClass($metadata); + $this->proxyGenerator->generateProxyClass($metadata, $this->proxyGenerator->getProxyFileName($className)); require_once $this->proxyGenerator->getProxyFileName($className); return $proxyClassName; diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php new file mode 100644 index 0000000000000000000000000000000000000000..a36c3bb74b52f1d8535757689fca30bd5f062fc5 --- /dev/null +++ b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/SerializedClass.php @@ -0,0 +1,72 @@ +<?php + +namespace Doctrine\Tests\Common\Proxy; + +/** + * Test asset class + */ +class SerializedClass +{ + /** + * @var mixed + */ + private $foo = 'foo'; + + /** + * @var mixed + */ + protected $bar = 'bar'; + + /** + * @var mixed + */ + public $baz = 'baz'; + + /** + * @param mixed $foo + */ + public function setFoo($foo) + { + $this->foo = $foo; + } + + /** + * @return mixed|string + */ + public function getFoo() + { + return $this->foo; + } + + /** + * @param $bar + */ + public function setBar($bar) + { + $this->bar = $bar; + } + + /** + * @return mixed|string + */ + public function getBar() + { + return $this->bar; + } + + /** + * @param $baz + */ + public function setBaz($baz) + { + $this->baz = $baz; + } + + /** + * @return mixed|string + */ + public function getBaz() + { + return $this->baz; + } +} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/StaticPropertyClass.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/StaticPropertyClass.php new file mode 100644 index 0000000000000000000000000000000000000000..ed4511b6e30d8de3d2facf4a7839931ab63eb4c7 --- /dev/null +++ b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Proxy/StaticPropertyClass.php @@ -0,0 +1,11 @@ +<?php + +namespace Doctrine\Tests\Common\Proxy; + +/** + * Test asset class + */ +class StaticPropertyClass +{ + protected static $protectedStaticProperty; +} diff --git a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php index f6fc069772d767e71e50976bda431e61b5524f7b..66e83376f9d1d424993c3775a93414edb0b35cfd 100644 --- a/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php +++ b/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php @@ -37,4 +37,29 @@ public function testExportArrayTraversable() $var = Debug::export($it, 5); $this->assertContains('foobar', $var->__STORAGE__); } + + public function testReturnsOutput() + { + ob_start(); + + $dump = Debug::dump('foo'); + $outputValue = ob_get_contents(); + + ob_end_clean(); + + $this->assertSame($outputValue, $dump); + } + + public function testDisablesOutput() + { + ob_start(); + + $dump = Debug::dump('foo', 2, true, false); + $outputValue = ob_get_contents(); + + ob_end_clean(); + + $this->assertEmpty($outputValue); + $this->assertNotSame($outputValue, $dump); + } }