コード例 #1
0
 public function testRandom()
 {
     $data = new Collection([1, 2, 3, 4, 5, 6]);
     $random = $data->random();
     $this->assertInternalType('integer', $random);
     $this->assertContains($random, $data->all());
     $random = $data->random(3);
     $this->assertInstanceOf('Collection\\Collection', $random);
     $this->assertCount(3, $random);
 }