Skip to content

Commit

Permalink
Text\MulitByte - add InvalidArgumentException
Browse files Browse the repository at this point in the history
  • Loading branch information
sasezaki committed Mar 15, 2012
1 parent a8be175 commit 2c17b50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions library/Zend/Text/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Zend\Text\Exception;

use Zend\Text\Exception;

class InvalidArgumentException
extends \InvalidArgumentException
implements Exception
{}
6 changes: 6 additions & 0 deletions tests/Zend/Text/MultiByteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,10 @@ public function testRightPad()
$text = Text\MultiByte::strPad('äääöö', 5, 'ö', STR_PAD_RIGHT);
$this->assertEquals('äääöö', $text);
}

public function testWordWrapInvalidArgument()
{
$this->setExpectedException('Zend\Text\Exception\InvalidArgumentException', "Can't force cut when width is zero");
Text\MultiByte::wordWrap('a', 0, "\n", true);
}
}

0 comments on commit 2c17b50

Please sign in to comment.