join() public method

Join values of an array with a separator
public join ( array $array, string $separator = ',' ) : string
$array array Array with values to join
$separator string A separator for the values
return string A string with the joined values separated by the separator
 /**
  * @test
  * @dataProvider joinExamples
  */
 public function joinWorks($array, $separator, $expected)
 {
     $helper = new ArrayHelper();
     if ($separator !== null) {
         $result = $helper->join($array, $separator);
     } else {
         $result = $helper->join($array);
     }
     $this->assertEquals($expected, $result);
 }