From 54a5fc6a74695e4424635e87096d26ed47811f8b Mon Sep 17 00:00:00 2001 From: ajshort Date: Tue, 19 Apr 2011 13:52:20 +1000 Subject: [PATCH] BUGFIX: Fixed the manifest not parsing interfaces which extended from multiple interfaces. --- core/manifest/ClassManifest.php | 8 +------- tests/core/manifest/TokenisedRegularExpressionTest.php | 8 ++++++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/core/manifest/ClassManifest.php b/core/manifest/ClassManifest.php index 9221a2e56..f4f512038 100644 --- a/core/manifest/ClassManifest.php +++ b/core/manifest/ClassManifest.php @@ -60,13 +60,7 @@ class SS_ClassManifest { return new TokenisedRegularExpression(array( 0 => T_INTERFACE, 1 => T_WHITESPACE, - 2 => array(T_STRING, 'can_jump_to' => 7, 'save_to' => 'interfaceName'), - 3 => T_WHITESPACE, - 4 => T_EXTENDS, - 5 => T_WHITESPACE, - 6 => array(T_STRING, 'save_to' => 'extends'), - 7 => array(T_WHITESPACE, 'optional' => true), - 8 => '{', + 2 => array(T_STRING, 'save_to' => 'interfaceName') )); } diff --git a/tests/core/manifest/TokenisedRegularExpressionTest.php b/tests/core/manifest/TokenisedRegularExpressionTest.php index 473b5710b..509c1e211 100644 --- a/tests/core/manifest/TokenisedRegularExpressionTest.php +++ b/tests/core/manifest/TokenisedRegularExpressionTest.php @@ -43,6 +43,10 @@ implements InterfaceA, InterfaceB { } +interface InterfaceC extends InterfaceA, InterfaceB { +} +interface InterfaceD extends InterfaceA, InterfaceB, InterfaceC { +} ?> PHP ); @@ -88,8 +92,8 @@ PHP if($matches) foreach($matches as $match) $interfaces[$match['interfaceName']] = $match; $this->assertArrayHasKey('InterfaceA', $interfaces); - $this->assertArrayHasKey('InterfaceB', $interfaces); - $this->assertEquals('Something', $interfaces['InterfaceB']['extends']); + $this->assertArrayHasKey('InterfaceC', $interfaces); + $this->assertArrayHasKey('InterfaceD', $interfaces); } } \ No newline at end of file