From 2b7572e21ad1acce0ebc36e615aaabeae57702e0 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 11 Aug 2009 08:50:32 +0000 Subject: [PATCH] BUGFIX: Removed some code that needed Extension to extend from Object. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84162 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/RequestHandler.php | 2 +- tests/ObjectTest.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/control/RequestHandler.php b/core/control/RequestHandler.php index bfcde5934..19b064590 100644 --- a/core/control/RequestHandler.php +++ b/core/control/RequestHandler.php @@ -183,7 +183,7 @@ class RequestHandler extends ViewableData { // merge in any $allowed_actions from extensions if($this->extension_instances) foreach($this->extension_instances as $extension) { - if($extAccess = $extension->stat('allowed_actions')) { + if($extAccess = Object::get_static($extension->class, 'allowed_actions')) { $allowedActions = array_merge($allowedActions, $extAccess); } } diff --git a/tests/ObjectTest.php b/tests/ObjectTest.php index 06dcb228a..aa4bbbb38 100755 --- a/tests/ObjectTest.php +++ b/tests/ObjectTest.php @@ -147,21 +147,21 @@ class ObjectTest extends SapphireTest { */ public function testUseCustomClass() { $obj1 = Object::create('ObjectTest_CreateTest'); - $this->assertTrue($obj1->is_a('ObjectTest_CreateTest')); + $this->assertTrue($obj1 instanceof ObjectTest_CreateTest); Object::useCustomClass('ObjectTest_CreateTest', 'ObjectTest_CreateTest2'); $obj2 = Object::create('ObjectTest_CreateTest'); - $this->assertTrue($obj2->is_a('ObjectTest_CreateTest2')); + $this->assertTrue($obj2 instanceof ObjectTest_CreateTest2); $obj2_2 = Object::strong_create('ObjectTest_CreateTest'); - $this->assertTrue($obj2_2->is_a('ObjectTest_CreateTest')); + $this->assertTrue($obj2_2 instanceof ObjectTest_CreateTest); Object::useCustomClass('ObjectTest_CreateTest', 'ObjectTest_CreateTest3', true); $obj3 = Object::create('ObjectTest_CreateTest'); - $this->assertTrue($obj3->is_a('ObjectTest_CreateTest3')); + $this->assertTrue($obj3 instanceof ObjectTest_CreateTest3); $obj3_2 = Object::strong_create('ObjectTest_CreateTest'); - $this->assertTrue($obj3_2->is_a('ObjectTest_CreateTest3')); + $this->assertTrue($obj3_2 instanceof ObjectTest_CreateTest3); } public function testGetExtensions() { @@ -290,8 +290,8 @@ class ObjectTest extends SapphireTest { } public function testIsA() { - $this->assertTrue(Object::create('ObjectTest_MyObject')->is_a('Object')); - $this->assertTrue(Object::create('ObjectTest_MyObject')->is_a('ObjectTest_MyObject')); + $this->assertTrue(Object::create('ObjectTest_MyObject') instanceof Object); + $this->assertTrue(Object::create('ObjectTest_MyObject') instanceof ObjectTest_MyObject); } /** @@ -301,7 +301,7 @@ class ObjectTest extends SapphireTest { $obj = new ObjectTest_ExtensionTest2(); $this->assertTrue($obj->hasExtension('ObjectTest_Extension')); - $this->assertTrue($obj->extInstance('ObjectTest_Extension')->is_a('ObjectTest_Extension')); + $this->assertTrue($obj->extInstance('ObjectTest_Extension') instanceof ObjectTest_Extension); } public function testCacheToFile() {