Skip to content

Commit 59e84ba

Browse files
committed
Merge branch '1.5' into 1.6
2 parents c99cdcf + 9402959 commit 59e84ba

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

Tests/AutoloadAliasTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Propel\Bundle\PropelBundle\Tests;
4+
5+
class AutoloadAliasTest extends \PHPUnit_Framework_TestCase
6+
{
7+
public function testOldNamespaceWorks()
8+
{
9+
$inflector = new \Propel\PropelBundle\Util\PropelInflector();
10+
11+
static::assertInstanceOf('Propel\PropelBundle\Util\PropelInflector', $inflector);
12+
static::assertInstanceOf('Propel\Bundle\PropelBundle\Util\PropelInflector', $inflector);
13+
}
14+
}

autoload_aliases.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
function autoload_propel_aliases($className) {
4+
if (0 === strpos($className, 'Propel\PropelBundle')) {
5+
class_alias(str_replace('Propel\PropelBundle', 'Propel\Bundle\PropelBundle', $className), $className);
6+
}
7+
}
8+
9+
spl_autoload_register('autoload_propel_aliases', false, true);

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
"autoload": {
1313
"psr-4": { "Propel\\Bundle\\PropelBundle\\": "" },
14+
"files": ["autoload_aliases.php"],
1415
"exclude-from-classmap": [ "Tests/" ]
1516
},
1617

0 commit comments

Comments
 (0)