Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

merged 2.0

  • Loading branch information...
commit 5803146a9e50b5f0283a7505a7e939cc2b0b4eaf 2 parents a4edc1b + ebc9979
@fabpot fabpot authored
View
2  src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php
@@ -100,6 +100,6 @@ public function refreshUser(UserInterface $user)
*/
public function supportsClass($class)
{
- return $class === $this->class;
+ return $class === $this->class || is_subclass_of($class, $this->class);
}
}
View
2  src/Symfony/Bundle/DoctrineBundle/Mapping/MetadataFactory.php
@@ -77,12 +77,12 @@ public function getClassMetadata($class, $path = null)
if (class_exists($class)) {
$r = $all[0]->getReflectionClass();
$path = $this->getBasePathForClass($class, $r->getNamespacename(), dirname($r->getFilename()));
+ $metadata->setNamespace($r->getNamespacename());
} elseif (!$path) {
throw new \RuntimeException(sprintf('Unable to determine where to save the "%s" class (use the --path option).', $class));
}
$metadata->setPath($path);
- $metadata->setNamespace($r->getNamespacename());
return $metadata;
}
View
2  src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig
@@ -1,5 +1,5 @@
<!-- START of Symfony2 Web Debug Toolbar -->
-{% if position != 'normal' %}
+{% if 'normal' != position %}
<div style="clear: both; height: 40px;"></div>
{% endif %}
View
17 tests/Symfony/Tests/Bridge/Doctrine/Security/User/EntityUserProviderTest.php
@@ -75,6 +75,23 @@ public function testRefreshInvalidUser()
$provider->refreshUser($user2);
}
+ public function testSupportProxy()
+ {
+ $em = $this->createTestEntityManager();
+ $this->createSchema($em);
+
+ $user1 = new CompositeIdentEntity(1, 1, 'user1');
+
+ $em->persist($user1);
+ $em->flush();
+ $em->clear();
+
+ $provider = new EntityUserProvider($em, 'Symfony\Tests\Bridge\Doctrine\Fixtures\CompositeIdentEntity', 'name');
+
+ $user2 = $em->getReference('Symfony\Tests\Bridge\Doctrine\Fixtures\CompositeIdentEntity', array('id1' => 1, 'id2' => 1));
+ $this->assertTrue($provider->supportsClass(get_class($user2)));
+ }
+
private function createSchema($em)
{
$schemaTool = new SchemaTool($em);
View
8 tests/Symfony/Tests/Component/Process/PhpExecutableFinderTest.php
@@ -23,6 +23,10 @@ class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase
*/
public function testFindWithPHP_PATH()
{
+ if (defined('PHP_BINARY')) {
+ $this->markTestSkipped('The PHP binary is easily available as of PHP 5.4');
+ }
+
$f = new PhpExecutableFinder();
$current = $f->find();
@@ -41,6 +45,10 @@ public function testFindWithPHP_PATH()
*/
public function testFindWithSuffix()
{
+ if (defined('PHP_BINARY')) {
+ $this->markTestSkipped('The PHP binary is easily available as of PHP 5.4');
+ }
+
putenv('PHP_PATH=');
putenv('PHP_PEAR_PHP_BIN=');
$f = new PhpExecutableFinder();
Please sign in to comment.
Something went wrong with that request. Please try again.