Skip to content

Commit

Permalink
Merge pull request laravel#5382 from faridmovsumov/bug/added-unit-tes…
Browse files Browse the repository at this point in the history
…ts-for-str-class

Added some unit tests for quickRandom and random methods in  SupportStrTest.php
  • Loading branch information
taylorotwell committed Aug 22, 2014
2 parents 4b6ff60 + dfdf77b commit dbe372d
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 dbe372d

Please sign in to comment.