From dfdf77ba33efc99adb0e76d7885a7773f6106b91 Mon Sep 17 00:00:00 2001 From: faridmovsumov Date: Sat, 9 Aug 2014 00:21:40 +0300 Subject: [PATCH] Added some unit tests for quiqkRandom and random methods in SupportStrTest.php #5381 --- tests/Support/SupportStrTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/Support/SupportStrTest.php b/tests/Support/SupportStrTest.php index 515d7fbd95e8..da3d0717d0cb 100755 --- a/tests/Support/SupportStrTest.php +++ b/tests/Support/SupportStrTest.php @@ -105,4 +105,22 @@ public function testIs() $this->assertTrue(Str::is('*/foo', 'blah/baz/foo')); } + + public function testQuickRandom() + { + $randomInteger = mt_rand(1, 100); + $this->assertEquals($randomInteger, strlen(Str::quickRandom($randomInteger))); + $this->assertInternalType('string', Str::quickRandom()); + $this->assertEquals(16, strlen(Str::quickRandom())); + } + + + public function testRandom() + { + $this->assertEquals(16, strlen(Str::random())); + $randomInteger = mt_rand(1, 100); + $this->assertEquals($randomInteger, strlen(Str::random($randomInteger))); + $this->assertInternalType('string', Str::random()); + } + }