From 3f8a2a95c2d7f11f21be078a71a8d03bce8ac394 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 19 Mar 2008 20:38:58 +0000 Subject: [PATCH] Merged revisions 51461 via svnmerge from svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2 ........ r51461 | sminnee | 2008-03-19 17:27:06 +1300 (Wed, 19 Mar 2008) | 1 line Test for hasMethod ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@51467 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/ObjectTest.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 tests/ObjectTest.php diff --git a/tests/ObjectTest.php b/tests/ObjectTest.php new file mode 100755 index 000000000..89c430ad9 --- /dev/null +++ b/tests/ObjectTest.php @@ -0,0 +1,23 @@ +assertTrue($st->hasMethod('publish'), "Test SiteTree has publish"); + $this->assertTrue($st->hasMethod('migrateVersion'), "Test SiteTree has migrateVersion"); + + // Check for different casing + $this->assertTrue($st->hasMethod('PuBliSh'), "Test SiteTree has PuBliSh"); + $this->assertTrue($st->hasMethod('MiGratEVersIOn'), "Test SiteTree has MiGratEVersIOn"); + + // Check that SiteTree methods exist on ContentController (test failover) + $this->assertTrue($cc->hasMethod); + $this->assertTrue($cc->hasMethod('canView'), "Test ContentController has canView"); + $this->assertTrue($cc->hasMethod('linkorcurrent'), "Test ContentController has linkorcurrent"); + $this->assertTrue($cc->hasMethod('MiGratEVersIOn'), "Test ContentController has MiGratEVersIOn"); + } + +} \ No newline at end of file