10000 merged 2.0 · lsmith77/symfony@5803146 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5803146

Browse files
committed
merged 2.0
2 parents a4edc1b + ebc9979 commit 5803146

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ public function refreshUser(UserInterface $user)
100100
*/
101101
public function supportsClass($class)
102102
{
103-
return $class === $this->class;
103+
return $class === $this->class || is_subclass_of($class, $this->class);
104104
}
105105
}

src/Symfony/Bundle/DoctrineBundle/Mapping/MetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ public function getClassMetadata($class, $path = null)
7777
if (class_exists($class)) {
7878
$r = $all[0]->getReflectionClass();
7979
$path = $this->getBasePathForClass($class, $r->getNamespacename(), dirname($r->getFilename()));
80+
$metadata->setNamespace($r->getNamespacename());
8081
} elseif (!$path) {
8182
throw new \RuntimeException(sprintf('Unable to determine where to save the "%s" class (use the --path option).', $class));
8283
}
8384

8485
$metadata->setPath($path);
85-
$metadata->setNamespace($r->getNamespacename());
8686

8787
return $metadata;
8888
}

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- START of Symfony2 Web Debug Toolbar -->
2-
{% if position != 'normal' %}
2+
{% if 'normal' != position %}
33
<div style="clear: both; height: 40px;"></div>
44
{% endif %}
55

tests/Symfony/Tests/Bridge/Doctrine/Security/User/EntityUserProviderTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,23 @@ public function testRefreshInvalidUser()
7575
$provider->refreshUser($user2);
7676
}
7777

78+
public function testSupportProxy()
79+
{
80+
$em = $this->createTestEntityManager();
81+
$this->createSchema($em);
82+
83+
$user1 = new CompositeIdentEntity(1, 1, 'user1');
84+
85+
$em->persist($user1);
86+
$em->flush();
87+
$em->clear();
88+
89+
$provider = new EntityUserProvider($em, 'Symfony\Tests\Bridge\Doctrine\Fixtures\CompositeIdentEntity', 'name');
90+
91+
$user2 = $em->getReference('Symfony\Tests\Bridge\Doctrine\Fixtures\CompositeIdentEntity', array('id1' => 1, 'id2' => 1));
92+
$this->assertTrue($provider->supportsClass(get_class($user2)));
93+
}
94+
7895
private function createSchema($em)
7996
{
8097
$schemaTool = new SchemaTool($em);

tests/Symfony/Tests/Component/Process/PhpExecutableFinderTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase
2323
*/
2424
public function testFindWithPHP_PATH()
2525
{
26+
if (defined('PHP_BINARY')) {
27+
$this->markTestSkipped('The PHP binary is easily available as of PHP 5.4');
28+
}
29+
2630
$f = new PhpExecutableFinder();
2731

2832
$current = $f->find();
@@ -41,6 +45,10 @@ public function testFindWithPHP_PATH()
4145
*/
4246
public function testFindWithSuffix()
4347
{
48+
if (defined('PHP_BINARY')) {
49+
$this->markTestSkipped('The PHP binary is easily available as of PHP 5.4');
50+
}
51+
4452
putenv('PHP_PATH=');
4553
putenv('PHP_PEAR_PHP_BIN=');
4654
$f = new PhpExecutableFinder();

0 commit comments

Comments
 (0)
0