Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

recreating TextHelperTest

  • Loading branch information...
commit fbd3f87be69ebc3f7afb7f74c21e8cd7a7abdea4 1 parent 8074959
@rchavik rchavik authored
Showing with 25 additions and 0 deletions.
  1. +25 −0 lib/Cake/Test/Case/View/Helper/TextHelperTest.php
View
25 lib/Cake/Test/Case/View/Helper/TextHelperTest.php
@@ -20,6 +20,14 @@
App::uses('View', 'View');
App::uses('TextHelper', 'View/Helper');
+class TextHelperTestObject extends TextHelper {
+
+ public function attach(String $string) {
+ $this->_String = $string;
+ }
+
+}
+
/**
* TextHelperTest class
*
@@ -48,6 +56,23 @@ public function tearDown() {
}
/**
+ * test String class methods are called correctly
+ */
+ public function testTextHelperProxyMethodCalls() {
+ $this->String = $this->getMock('String');
+ unset($this->Text);
+ $this->Text = new TextHelperTestObject($this->View);
+ $this->Text->attach($this->String);
+ $methods = array(
+ 'highlight', 'stripLinks', 'truncate', 'excerpt', 'toList',
+ );
+ foreach ($methods as $method) {
+ $this->String->expects($this->at(0))->method($method);
+ $this->Text->{$method}('who', 'what', 'when', 'where', 'how');
+ }
+ }
+
+/**
* testAutoLink method
*
* @return void
Please sign in to comment.
Something went wrong with that request. Please try again.