X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2FNicknameTest.php;h=66e883c049f9cd40116e3f3971dd804a3c64e715;hb=7229533b0faff4e2532a67dff5c126e76b3a0f38;hp=f49aeba602421957dae8e6e20e7656a520a46bf9;hpb=749367e12f9742d7fd5ee028230fefa627599125;p=quix0rs-gnu-social.git diff --git a/tests/NicknameTest.php b/tests/NicknameTest.php index f49aeba602..66e883c049 100644 --- a/tests/NicknameTest.php +++ b/tests/NicknameTest.php @@ -33,9 +33,14 @@ class NicknameTest extends PHPUnit_Framework_TestCase if ($expected === false) { if ($expectedException) { + if ($exception) { + $stuff = get_class($exception) . ': ' . $exception->getMessage(); + } else { + $stuff = var_export($exception, true); + } $this->assertTrue($exception && $exception instanceof $expectedException, "invalid input '$input' expected to fail with $expectedException, " . - "got " . get_class($exception) . ': ' . $exception->getMessage()); + "got $stuff"); } else { $this->assertTrue($normalized == false, "invalid input '$input' expected to fail"); @@ -104,7 +109,7 @@ class NicknameTest extends PHPUnit_Framework_TestCase array('', false, 'NicknameEmptyException'), array('___', false, 'NicknameEmptyException'), array('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'), // 64 chars - array('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee_', 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'), // the _ will be trimmed off, remaining valid + array('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee_', false, 'NicknameTooLongException'), // the _ is too long... array('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', false, 'NicknameTooLongException'), // 65 chars -- too long ); }