-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add 'array_random' helper with tests * replace array_rand usage with new array_random helper * Make random test more resilient
- Loading branch information
1 parent
8d54d7f
commit 75554ce
Showing
4 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -399,6 +399,14 @@ public function testPull() | |
$this->assertEquals(['emails' => ['[email protected]' => 'Joe', 'jane@localhost' => 'Jane']], $array); | ||
} | ||
|
||
public function testRandom() | ||
{ | ||
$randomValue = Arr::random(['foo', 'bar', 'baz']); | ||
|
||
$this->assertInternalType('string', $randomValue); | ||
$this->assertContains($randomValue, ['foo', 'bar', 'baz']); | ||
} | ||
|
||
public function testSet() | ||
{ | ||
$array = ['products' => ['desk' => ['price' => 100]]]; | ||
|