Skip to content
Snippets Groups Projects
Commit 90a48a9f authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1764342 by Rob Loach: Update Symfony and Doctrine to RC2.

parent c69d5cf9
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Showing
with 423 additions and 184 deletions
......@@ -3,35 +3,35 @@
"packages": [
{
"package": "doctrine/common",
"version": "2.3.0-RC1"
"version": "2.3.0-RC2"
},
{
"package": "symfony/class-loader",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/dependency-injection",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/event-dispatcher",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/http-foundation",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/http-kernel",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/routing",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/yaml",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "twig/twig",
......
# SimpleTest breaks with the following files, so avoid adding them.
symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php
symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/php5.4/traits.php
symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php
<?php
// autoload.php generated by Composer
if (!class_exists('Composer\\Autoload\\ClassLoader', false)) {
require __DIR__ . '/composer' . '/ClassLoader.php';
}
return call_user_func(function() {
$loader = new \Composer\Autoload\ClassLoader();
$composerDir = __DIR__ . '/composer';
require_once __DIR__ . '/composer' . '/autoload_real.php';
$map = require $composerDir . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->add($namespace, $path);
}
$classMap = require $composerDir . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
$loader->register();
return $loader;
});
return ComposerAutoloaderInit::getLoader();
......@@ -201,5 +201,7 @@ public function findFile($class)
if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) {
return $file;
}
$this->classMap[$class] = false;
}
}
<?php
// autoload_namespace.php generated by Composer
// autoload_namespaces.php generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
......
<?php
// autoload_real.php generated by Composer
require __DIR__ . '/ClassLoader.php';
class ComposerAutoloaderInit
{
public static function getLoader()
{
$loader = new \Composer\Autoload\ClassLoader();
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->add($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
$loader->register();
return $loader;
}
}
......@@ -3,7 +3,7 @@
"name": "twig/twig",
"version": "v1.8.3",
"version_normalized": "1.8.3.0",
"time": "2012-06-18 15:48:16",
"time": "2012-06-18 19:48:16",
"source": {
"type": "git",
"url": "git://github.com/fabpot/Twig.git",
......@@ -55,19 +55,19 @@
},
{
"name": "symfony/class-loader",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/ClassLoader",
"time": "2012-07-15 17:13:51",
"time": "2012-08-27 15:51:49",
"source": {
"type": "git",
"url": "https://github.com/symfony/ClassLoader",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/ClassLoader/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/ClassLoader/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -110,19 +110,19 @@
},
{
"name": "symfony/dependency-injection",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/DependencyInjection",
"time": "2012-08-03 19:44:30",
"time": "2012-08-28 07:54:42",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -133,8 +133,8 @@
"symfony/config": "2.1.*"
},
"suggest": {
"symfony/yaml": "v2.1.0-RC1",
"symfony/config": "v2.1.0-RC1"
"symfony/yaml": "v2.1.0-RC2",
"symfony/config": "v2.1.0-RC2"
},
"type": "library",
"extra": {
......@@ -168,21 +168,97 @@
}
}
},
{
"name": "doctrine/common",
"version": "2.3.0-RC2",
"version_normalized": "2.3.0.0-RC2",
"time": "2012-08-29 14:06:32",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common",
"reference": "2.3.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/common/zipball/2.3.0-RC2",
"reference": "2.3.0-RC2",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
},
"installation-source": "dist",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/",
"role": null
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": null,
"role": null
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org",
"homepage": null,
"role": null
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de",
"homepage": null,
"role": null
},
{
"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": [
"collections",
"spl",
"eventmanager",
"annotations",
"persistence"
],
"autoload": {
"psr-0": {
"Doctrine\\Common": "lib/"
}
}
},
{
"name": "symfony/http-foundation",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/HttpFoundation",
"time": "2012-08-04 16:18:38",
"time": "2012-08-22 13:48:41",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -223,19 +299,19 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/EventDispatcher",
"time": "2012-07-20 06:18:14",
"time": "2012-08-22 13:48:41",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -245,8 +321,8 @@
"symfony/dependency-injection": "2.1.*"
},
"suggest": {
"symfony/dependency-injection": "v2.1.0-RC1",
"symfony/http-kernel": "v2.1.0-RC1"
"symfony/dependency-injection": "v2.1.0-RC2",
"symfony/http-kernel": "v2.1.0-RC2"
},
"type": "library",
"extra": {
......@@ -282,19 +358,19 @@
},
{
"name": "symfony/http-kernel",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/HttpKernel",
"time": "2012-08-04 16:32:21",
"time": "2012-08-28 08:00:18",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpKernel/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/HttpKernel/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -313,12 +389,12 @@
"symfony/routing": "2.1.*"
},
"suggest": {
"symfony/browser-kit": "v2.1.0-RC1",
"symfony/class-loader": "v2.1.0-RC1",
"symfony/config": "v2.1.0-RC1",
"symfony/console": "v2.1.0-RC1",
"symfony/dependency-injection": "v2.1.0-RC1",
"symfony/finder": "v2.1.0-RC1"
"symfony/browser-kit": "v2.1.0-RC2",
"symfony/class-loader": "v2.1.0-RC2",
"symfony/config": "v2.1.0-RC2",
"symfony/console": "v2.1.0-RC2",
"symfony/dependency-injection": "v2.1.0-RC2",
"symfony/finder": "v2.1.0-RC2"
},
"type": "library",
"extra": {
......@@ -354,19 +430,19 @@
},
{
"name": "symfony/routing",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/Routing",
"time": "2012-07-31 21:14:37",
"time": "2012-08-28 07:54:42",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Routing/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/Routing/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -379,8 +455,8 @@
"doctrine/common": ">=2.2,<2.4-dev"
},
"suggest": {
"symfony/config": "v2.1.0-RC1",
"symfony/yaml": "v2.1.0-RC1",
"symfony/config": "v2.1.0-RC2",
"symfony/yaml": "v2.1.0-RC2",
"doctrine/common": ">=2.2,<2.4-dev"
},
"type": "library",
......@@ -417,19 +493,19 @@
},
{
"name": "symfony/yaml",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/Yaml",
"time": "2012-07-15 17:13:51",
"time": "2012-08-22 13:48:41",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Yaml/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/Yaml/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -466,81 +542,5 @@
"Symfony\\Component\\Yaml": ""
}
}
},
{
"name": "doctrine/common",
"version": "2.3.0-RC1",
"version_normalized": "2.3.0.0-RC1",
"time": "2012-07-29 10:44:28",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common",
"reference": "2.3.0-RC1"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/common/zipball/2.3.0-RC1",
"reference": "2.3.0-RC1",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
},
"installation-source": "dist",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/",
"role": null
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": null,
"role": null
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org",
"homepage": null,
"role": null
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de",
"homepage": null,
"role": null
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": null
}
],
"description": "Common Library for Doctrine projects",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"collections",
"spl",
"eventmanager",
"annotations",
"persistence"
],
"autoload": {
"psr-0": {
"Doctrine\\Common": "lib/"
}
}
}
]
{
"name": "doctrine/common",
"type": "library","version":"2.3.0-RC1",
"type": "library","version":"2.3.0-RC2",
"description": "Common Library for Doctrine projects",
"keywords": ["collections", "spl", "eventmanager", "annotations", "persistence"],
"homepage": "http://www.doctrine-project.org",
......
......@@ -68,7 +68,8 @@ class AnnotationReader implements Reader
'codeCoverageIgnore' => true, 'codeCoverageIgnoreStart' => true, 'codeCoverageIgnoreEnd' => true,
'Required' => true, 'Attribute' => true, 'Attributes' => true,
'Target' => true, 'SuppressWarnings' => true,
'ingroup' => true, 'code' => true, 'endcode' => true
'ingroup' => true, 'code' => true, 'endcode' => true,
'package_version' => true,
);
/**
......
......@@ -496,15 +496,5 @@ public function matching(Criteria $criteria)
return new static($filtered);
}
/**
* Return the expression builder.
*
* @return ExpressionBuilder
*/
public function expr()
{
return new ExpressionBuilder();
}
}
......@@ -20,6 +20,7 @@
namespace Doctrine\Common\Collections;
use Doctrine\Common\Collections\Expr\Expression;
use Doctrine\Common\Collections\Expr\CompositeExpression;
/**
* Criteria for filtering Selectable collections.
......@@ -39,6 +40,11 @@ class Criteria
*/
const DESC = 'DESC';
/**
* @var \Doctrine\Common\Collections\ExpressionBuilder
*/
private static $expressionBuilder;
/**
* @var \Doctrine\Common\Collections\Expr\Expression
*/
......@@ -59,6 +65,29 @@ class Criteria
*/
private $maxResults;
/**
* Creates an instance of the class.
*
* @return Criteria
*/
public static function create()
{
return new static();
}
/**
* Return the expression builder.
*
* @return \Doctrine\Common\Collections\ExpressionBuilder
*/
public static function expr()
{
if (self::$expressionBuilder === null) {
self::$expressionBuilder = new ExpressionBuilder();
}
return self::$expressionBuilder;
}
/**
* Construct new criteria
*
......@@ -87,6 +116,46 @@ public function where(Expression $expression)
return $this;
}
/**
* Append the where expression to evaluate when this criteria is searched for
* using an AND with previous expression.
*
* @param Expression
* @return Criteria
*/
public function andWhere(Expression $expression)
{
if ($this->expression === null) {
return $this->where($expression);
}
$this->expression = new CompositeExpression(CompositeExpression::TYPE_AND, array(
$this->expression, $expression
));
return $this;
}
/**
* Append the where expression to evaluate when this criteria is searched for
* using an OR with previous expression.
*
* @param Expression
* @return Criteria
*/
public function orWhere(Expression $expression)
{
if ($this->expression === null) {
return $this->where($expression);
}
$this->expression = new CompositeExpression(CompositeExpression::TYPE_OR, array(
$this->expression, $expression
));
return $this;
}
/**
* Get the expression attached to this criteria.
*
......
......@@ -44,12 +44,5 @@ interface Selectable
* @return Collection
*/
function matching(Criteria $criteria);
/**
* Return the expression builder.
*
* @return \Doctrine\Common\Collections\ExpressionBuilder
*/
function expr();
}
......@@ -36,7 +36,7 @@ class Version
/**
* Current Doctrine Version
*/
const VERSION = '2.3.0-RC1';
const VERSION = '2.3.0-RC2';
/**
* Compares a Doctrine version with the current one.
......
......@@ -212,7 +212,7 @@ public function testMatching()
{
$this->fillMatchingFixture();
$col = $this->_coll->matching(new Criteria($this->_coll->expr()->eq("foo", "bar")));
$col = $this->_coll->matching(new Criteria(Criteria::expr()->eq("foo", "bar")));
$this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col);
$this->assertNotSame($col, $this->_coll);
$this->assertEquals(1, count($col));
......
......@@ -3,9 +3,17 @@
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\Expr\Comparison;
use Doctrine\Common\Collections\Expr\CompositeExpression;
class CriteriaTest extends \PHPUnit_Framework_TestCase
{
public function testCreate()
{
$criteria = Criteria::create();
$this->assertInstanceOf("Doctrine\Common\Collections\Criteria", $criteria);
}
public function testConstructor()
{
$expr = new Comparison("field", "=", "value");
......@@ -27,12 +35,48 @@ public function testWhere()
$this->assertSame($expr, $criteria->getWhereExpression());
}
public function testOrderings()
public function testAndWhere()
{
$expr = new Comparison("field", "=", "value");
$criteria = new Criteria();
$criteria->orderBy(array("foo" => "ASC"));
$criteria->where($expr);
$expr = $criteria->getWhereExpression();
$criteria->andWhere($expr);
$where = $criteria->getWhereExpression();
$this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $where);
$this->assertEquals(CompositeExpression::TYPE_AND, $where->getType());
$this->assertSame(array($expr, $expr), $where->getExpressionList());
}
public function testOrWhere()
{
$expr = new Comparison("field", "=", "value");
$criteria = new Criteria();
$criteria->where($expr);
$expr = $criteria->getWhereExpression();
$criteria->orWhere($expr);
$where = $criteria->getWhereExpression();
$this->assertInstanceOf('Doctrine\Common\Collections\Expr\CompositeExpression', $where);
$this->assertEquals(CompositeExpression::TYPE_OR, $where->getType());
$this->assertSame(array($expr, $expr), $where->getExpressionList());
}
public function testOrderings()
{
$criteria = Criteria::create()
->orderBy(array("foo" => "ASC"));
$this->assertEquals(array("foo" => "ASC"), $criteria->getOrderings());
}
public function testExpr()
{
$this->assertInstanceOf('Doctrine\Common\Collections\ExpressionBuilder', Criteria::expr());
}
}
......@@ -15,6 +15,28 @@
class ClassLoaderTest extends \PHPUnit_Framework_TestCase
{
public function testGetPrefixes()
{
$loader = new ClassLoader();
$loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$prefixes = $loader->getPrefixes();
$this->assertArrayHasKey('Foo', $prefixes);
$this->assertArrayNotHasKey('Foo1', $prefixes);
$this->assertArrayHasKey('Bar', $prefixes);
$this->assertArrayHasKey('Bas', $prefixes);
}
public function testGetFallbackDirs()
{
$loader = new ClassLoader();
$loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$fallback_dirs = $loader->getFallbackDirs();
$this->assertCount(2, $fallback_dirs);
}
/**
* @dataProvider getLoadClassTests
*/
......@@ -37,6 +59,35 @@ public function getLoadClassTests()
);
}
/**
* @dataProvider getLoadNonexistentClassTests
*/
public function testLoadNonexistentClass($className, $testClassName, $message)
{
$loader = new ClassLoader();
$loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->loadClass($testClassName);
$this->assertFalse(class_exists($className), $message);
}
public function getLoadNonexistentClassTests()
{
return array(
array('\\Pearlike3_Bar', '\\Pearlike3_Bar', '->loadClass() loads non exising Pearlike3_Bar class with a leading slash'),
);
}
public function testAddPrefix()
{
$loader = new ClassLoader();
$loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$prefixes = $loader->getPrefixes();
$this->assertArrayHasKey('Foo', $prefixes);
$this->assertCount(2, $prefixes['Foo']);
}
public function testUseIncludePath()
{
$loader = new ClassLoader();
......
......@@ -15,6 +15,50 @@
class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
{
/**
* @var string $workspace
*/
private $workspace = null;
public function prepare_workspace()
{
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().rand(0, 1000);
mkdir($this->workspace, 0777, true);
$this->workspace = realpath($this->workspace);
}
/**
* @param string $file
*/
private function clean($file)
{
if (is_dir($file) && !is_link($file)) {
$dir = new \FilesystemIterator($file);
foreach ($dir as $childFile) {
$this->clean($childFile);
}
rmdir($file);
} else {
unlink($file);
}
}
/**
* @dataProvider getTestCreateMapTests
*/
public function testDump($directory, $expected)
{
$this->prepare_workspace();
$file = $this->workspace.'/file';
$generator = new ClassMapGenerator();
$generator->dump($directory, $file);
$this->assertFileExists($file);
$this->clean($this->workspace);
}
/**
* @dataProvider getTestCreateMapTests
......
......@@ -56,6 +56,32 @@ public function testUseIncludePath()
set_include_path($includePath);
}
public function testGetNamespaces()
{
$loader = new UniversalClassLoader();
$loader->registerNamespace('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerNamespace('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$namespaces = $loader->getNamespaces();
$this->assertArrayHasKey('Foo', $namespaces);
$this->assertArrayNotHasKey('Foo1', $namespaces);
$this->assertArrayHasKey('Bar', $namespaces);
$this->assertArrayHasKey('Bas', $namespaces);
}
public function testGetPrefixes()
{
$loader = new UniversalClassLoader();
$loader->registerPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$loader->registerPrefix('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
$prefixes = $loader->getPrefixes();
$this->assertArrayHasKey('Foo', $prefixes);
$this->assertArrayNotHasKey('Foo1', $prefixes);
$this->assertArrayHasKey('Bar', $prefixes);
$this->assertArrayHasKey('Bas', $prefixes);
}
/**
* @dataProvider getLoadClassFromFallbackTests
*/
......
......@@ -26,6 +26,7 @@
"psr-0": { "Symfony\\Component\\ClassLoader": "" }
},
"target-dir": "Symfony/Component/ClassLoader",
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
......
......@@ -694,7 +694,13 @@ private function addFrozenConstructor()
*/
public function __construct()
{
\$this->parameters = \$this->getDefaultParameters();
EOF;
if ($this->container->getParameterBag()->all()) {
$code .= "\n \$this->parameters = \$this->getDefaultParameters();\n";
}
$code .= <<<EOF
\$this->services =
\$this->scopedServices =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment