public function testCombineRuleCreationMethods() { $simpleString = "Intenté Español Pingüino"; $slugifier = new Slugifier(); $slugifier->setRules(array("é" => "e")); $slugifier->addRule("ñ", "n"); $slugifier->addRules(array("ü" => "u")); $slug = $slugifier->slugify($simpleString); $this->assertEquals("intente-espanol-pinguino", $slug); }
/** * @test */ public function shouldCreateSlugWithCustomSeparator() { $slug = Slugifier::slugify('Wikipedia style', '_'); $this->assertEquals('wikipedia_style', $slug); }