Skip to content

Commit

Permalink
Added some unit tests for quiqkRandom and random methods in SupportSt…
Browse files Browse the repository at this point in the history
…rTest.php laravel#5381
  • Loading branch information
faridmovsumov committed Aug 8, 2014
1 parent 87ad909 commit dfdf77b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/Support/SupportStrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}

0 comments on commit dfdf77b

Please sign in to comment.