Skip to content
Permalink
Browse files

recreating TextHelperTest

  • Loading branch information...
rchavik committed Feb 6, 2012
1 parent 8074959 commit fbd3f87be69ebc3f7afb7f74c21e8cd7a7abdea4
Showing with 25 additions and 0 deletions.
  1. +25 −0 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
*
@@ -47,6 +55,23 @@ public function tearDown() {
unset($this->View, $this->Text);
}
/**
* 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
*

0 comments on commit fbd3f87

Please sign in to comment.
You can’t perform that action at this time.