Skip to content

Commit

Permalink
Added tests for the Arr::shuffle() method
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Oct 17, 2017
1 parent 34292c8 commit 682881b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/Arr/ShuffleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Yetii\Tests\Arr;

use PHPUnit\Framework\TestCase;
use YeTii\General\Arr;

/**
* Class ShuffleTest
*/
class ShuffleTest extends TestCase
{
/**
* @var array
*/
public $testData = [
'apples',
'oranges',
'apples',
];

/**
* Test whether it returns a shuffled array
*/
public function testCanShuffleTheArray()
{
$array = new Arr($this->testData);
$result = $array->shuffle();
$this->assertInstanceOf(Arr::class, $result);
$this->assertInternalType('array', $result->toArray());
$this->assertFalse($result === $this->testData);
}
}

0 comments on commit 682881b

Please sign in to comment.