forked from schmittjoh/object-routing
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix merging of routes for subclasses (#1)
* Fix merging of routes for subclasses * Fix PHPUnit 5.x deprecation warnings
- Loading branch information
Showing
5 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,12 @@ | |
"psr-0": { | ||
"JMS": "src/" | ||
} | ||
}, | ||
|
||
"autoload-dev": { | ||
"psr-0": { | ||
"JMS\\Tests": "tests/" | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/JMS/Tests/ObjectRouting/Metadata/ClassMetadataTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace JMS\Tests\ObjectRouting\Metadata; | ||
|
||
use JMS\ObjectRouting\Metadata\ClassMetadata; | ||
|
||
class ClassMetadataTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testMerge() | ||
{ | ||
$base = new ClassMetadata(\PHPUnit_Framework_TestCase::class); | ||
$base->addRoute('test', 'base-route'); | ||
|
||
$merged = new ClassMetadata(self::class); | ||
$merged->addRoute('test', 'merged-route'); | ||
|
||
$base->merge($merged); | ||
|
||
$this->assertEquals(self::class, $base->name); | ||
$this->assertEquals(['test' => ['name' => 'merged-route', 'params' => []]], $base->routes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters