public function testUnique() { $collection = new Collection(['a', 'b', 'a', null, 'b', 10, '10']); $unique = $collection->unique(); $this->assertNotSame($collection, $unique); /** Without strict */ $expected = ['a', 'b', null, 10]; $this->assertSame($expected, $unique->toArray()); /** With strict */ $expected = ['a', 'b', null, 10, '10']; $this->assertSame($expected, $collection->unique(true)->toArray()); }