Skip to content

Commit dfdf77b

Browse files
committed
Added some unit tests for quiqkRandom and random methods in SupportStrTest.php #5381
1 parent 87ad909 commit dfdf77b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/Support/SupportStrTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,22 @@ public function testIs()
105105
$this->assertTrue(Str::is('*/foo', 'blah/baz/foo'));
106106
}
107107

108+
109+
public function testQuickRandom()
110+
{
111+
$randomInteger = mt_rand(1, 100);
112+
$this->assertEquals($randomInteger, strlen(Str::quickRandom($randomInteger)));
113+
$this->assertInternalType('string', Str::quickRandom());
114+
$this->assertEquals(16, strlen(Str::quickRandom()));
115+
}
116+
117+
118+
public function testRandom()
119+
{
120+
$this->assertEquals(16, strlen(Str::random()));
121+
$randomInteger = mt_rand(1, 100);
122+
$this->assertEquals($randomInteger, strlen(Str::random($randomInteger)));
123+
$this->assertInternalType('string', Str::random());
124+
}
125+
108126
}

0 commit comments

Comments
 (0)