From 7d609f24c9283a4f6c62880429423a3d6359e278 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 11 Feb 2011 14:55:03 +1300 Subject: [PATCH 1/2] MINOR Replaced assertType() calls with assertInstanceOf(), deprecated in PHPUnit 3.6 (throws warnings as of 3.5.10) --- tests/CMSMainTest.php | 8 ++++---- tests/CMSMenuTest.php | 6 +++--- tests/LeftAndMainTest.php | 2 +- tests/MemberTableFieldTest.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/CMSMainTest.php b/tests/CMSMainTest.php index cca5c155..ffe03e66 100644 --- a/tests/CMSMainTest.php +++ b/tests/CMSMainTest.php @@ -150,7 +150,7 @@ class CMSMainTest extends FunctionalTest { $response = $this->get('admin/cms/getitem?ID=' . $pageID . '&ajax=1'); $livePage = Versioned::get_one_by_stage("SiteTree", "Live", "\"SiteTree\".\"ID\" = $pageID"); - $this->assertType('SiteTree', $livePage); + $this->assertInstanceOf('SiteTree', $livePage); $this->assertTrue($livePage->canDelete()); // Check that the 'restore' button exists as a simple way of checking that the correct page is returned. @@ -174,12 +174,12 @@ class CMSMainTest extends FunctionalTest { $this->assertNull($cmsMain->getRecord('asdf')); // Pages that are on draft and aren't on draft should both work - $this->assertType('Page', $cmsMain->getRecord($page1ID)); - $this->assertType('Page', $cmsMain->getRecord($this->idFromFixture('Page','page2'))); + $this->assertInstanceOf('Page', $cmsMain->getRecord($page1ID)); + $this->assertInstanceOf('Page', $cmsMain->getRecord($this->idFromFixture('Page','page2'))); // This functionality isn't actually used any more. $newPage = $cmsMain->getRecord('new-Page-5'); - $this->assertType('Page', $newPage); + $this->assertInstanceOf('Page', $newPage); $this->assertEquals('5', $newPage->ParentID); } diff --git a/tests/CMSMenuTest.php b/tests/CMSMenuTest.php index ef3387e9..75fe7e45 100644 --- a/tests/CMSMenuTest.php +++ b/tests/CMSMenuTest.php @@ -16,7 +16,7 @@ class CMSMenuTest extends SapphireTest implements TestOnly { CMSMenu::add_controller('CMSMain'); $menuItems = CMSMenu::get_menu_items(); $menuItem = $menuItems['CMSMain']; - $this->assertType('CMSMenuItem', $menuItem, 'Controller menu item is of class CMSMenuItem'); + $this->assertInstanceOf('CMSMenuItem', $menuItem, 'Controller menu item is of class CMSMenuItem'); $this->assertEquals($menuItem->url, singleton('CMSMain')->Link(), 'Controller menu item has the correct link'); $this->assertEquals($menuItem->controller, 'CMSMain', 'Controller menu item has the correct controller class'); $this->assertEquals($menuItem->priority, singleton('CMSMain')->stat('menu_priority'), 'Controller menu item has the correct priority'); @@ -26,7 +26,7 @@ class CMSMenuTest extends SapphireTest implements TestOnly { CMSMenu::add_link('LinkCode', 'link title', 'http://www.example.com'); $menuItems = CMSMenu::get_menu_items(); $menuItem = $menuItems['LinkCode']; - $this->assertType('CMSMenuItem', $menuItem, 'Link menu item is of class CMSMenuItem'); + $this->assertInstanceOf('CMSMenuItem', $menuItem, 'Link menu item is of class CMSMenuItem'); $this->assertEquals($menuItem->title, 'link title', 'Link menu item has the correct title'); $this->assertEquals($menuItem->url,'http://www.example.com', 'Link menu item has the correct link'); $this->assertNull($menuItem->controller, 'Link menu item has no controller class'); @@ -53,7 +53,7 @@ class CMSMenuTest extends SapphireTest implements TestOnly { CMSMenu::clear_menu(); CMSMenu::populate_menu(); $menuItem = CMSMenu::get_menu_item('CMSMain'); - $this->assertType('CMSMenuItem', $menuItem, 'CMSMain menu item exists'); + $this->assertInstanceOf('CMSMenuItem', $menuItem, 'CMSMain menu item exists'); $this->assertEquals($menuItem->url, singleton('CMSMain')->Link(), 'Menu item has the correct link'); $this->assertEquals($menuItem->controller, 'CMSMain', 'Menu item has the correct controller class'); $this->assertEquals( diff --git a/tests/LeftAndMainTest.php b/tests/LeftAndMainTest.php index 96752eb7..0c0a76af 100644 --- a/tests/LeftAndMainTest.php +++ b/tests/LeftAndMainTest.php @@ -49,7 +49,7 @@ class LeftAndMainTest extends FunctionalTest { $response = $this->get($link); - $this->assertType('SS_HTTPResponse', $response, "$link should return a response object"); + $this->assertInstanceOf('SS_HTTPResponse', $response, "$link should return a response object"); $this->assertEquals(200, $response->getStatusCode(), "$link should return 200 status code"); // Check that a HTML page has been returned $this->assertRegExp('/]*>/i', $response->getBody(), "$link should contain tag"); diff --git a/tests/MemberTableFieldTest.php b/tests/MemberTableFieldTest.php index 253d99c7..03666dae 100644 --- a/tests/MemberTableFieldTest.php +++ b/tests/MemberTableFieldTest.php @@ -67,7 +67,7 @@ class MemberTableFieldTest extends SapphireTest { $this->assertNotContains($member1->ID, $group1->Members()->column('ID'), 'Member relation to group is removed' ); - $this->assertType( + $this->assertInstanceOf( 'DataObject', DataObject::get_by_id('Member', $member1->ID), 'Member record still exists' From 3495fc0b7c86b551eb8bf3447e9520d449d75261 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 22 Feb 2011 00:28:26 +1300 Subject: [PATCH 2/2] BUGFIX Fixing TinyMCE path enumeration which throws off its 'template' plugin by invalid spaces (fixes #6407, thanks drombolaget_fredric) --- code/LeftAndMain.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index e84d420b..0d1dd05e 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -184,8 +184,8 @@ class LeftAndMain extends Controller { $theme = false; } - if($theme) $cssFiles .= ', ' . THEMES_DIR . "/{$theme}/css/editor.css"; - else if(project()) $cssFiles .= ', ' . project() . '/css/editor.css'; + if($theme) $cssFiles .= ',' . THEMES_DIR . "/{$theme}/css/editor.css"; + else if(project()) $cssFiles .= ',' . project() . '/css/editor.css'; $htmlEditorConfig->setOption('content_css', $cssFiles); }