Skip to content

Commit

Permalink
Fixing failures from merging.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 23, 2011
1 parent 91a1cf8 commit 3e4388d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
Expand Up @@ -519,8 +519,8 @@ public function testDeleteRemovesChildren() {
* @return void
*/
function testDeleteChildrenNotExist() {
$this->assertNull($this->Controller->Cookie->delete('NotFound'));
$this->assertNull($this->Controller->Cookie->delete('Not.Found'));
$this->assertNull($this->Cookie->delete('NotFound'));
$this->assertNull($this->Cookie->delete('Not.Found'));
}

/**
Expand Down
13 changes: 9 additions & 4 deletions lib/Cake/Test/Case/View/MediaViewTest.php
Expand Up @@ -370,11 +370,16 @@ function testRenderUpperExtesnion() {
'extension' => 'JPG',
);

$result = $this->MediaView->render();
$this->MediaView->response->expects($this->any())
->method('type')
->with('jpg')
->will($this->returnArgument(0));

$fileName = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'img' . DS . 'test_2.JPG';
$file = file_get_contents($fileName, 'r');
$this->assertEqual(base64_encode($output), base64_encode($file));
$this->MediaView->expects($this->at(0))
->method('_isActive')
->will($this->returnValue(true));

$this->MediaView->render();
}

}
4 changes: 4 additions & 0 deletions lib/Cake/Utility/Validation.php
Expand Up @@ -18,6 +18,10 @@
*/

App::uses('Multibyte', 'I18n');
// Load multibyte if the extension is missing.
if (!function_exists('mb_strlen')) {
class_exists('Multibyte');
}

/**
* Offers different validation methods.
Expand Down
4 changes: 4 additions & 0 deletions lib/Cake/View/Helper/TextHelper.php
Expand Up @@ -224,6 +224,10 @@ public function truncate($text, $length = 100, $options = array()) {
$options = array_merge($default, $options);
extract($options);

if (!function_exists('mb_strlen')) {
class_exists('Multibyte');
}

if ($html) {
if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {
return $text;
Expand Down

0 comments on commit 3e4388d

Please sign in to comment.