Skip to content

Instantly share code, notes, and snippets.

@xicond
Created November 22, 2017 19:40
Show Gist options
  • Save xicond/f5949c87a8ad4b384f9cc1bb891fa00c to your computer and use it in GitHub Desktop.
Save xicond/f5949c87a8ad4b384f9cc1bb891fa00c to your computer and use it in GitHub Desktop.

Revisions

  1. xicond created this gist Nov 22, 2017.
    9 changes: 9 additions & 0 deletions test
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    public function testSlugifyDashSpace() {
    $faker = Faker\Factory::create();
    $faker->addProvider(new Faker\Provider\Lorem($faker));
    $str1 = $faker->word;
    $str2 = $faker->word;
    $this->assertEquals($str1.' '.$str2, TextHelper::slugifyDashSpace($str1.' '.$str2));
    Yii::$app->params['slugifyDashSpace'][Yii::$app->params['projectCode']] = true;
    $this->assertEquals($str1.' '.$str2, TextHelper::slugifyDashSpace($str1.'-'.$str2));
    }