/** * Get a safe cache key. * * @return string The cache key */ private function cacheKey() { return 'views.' . Str::slug($this->name); }
/** * Tests conversion of naughty strings to slugs. * * @dataProvider bigListOfNaughtyStrings * * @covers Molovo\Str\Str::slug */ public function testSlugWithNaughtyStrings($string) { $string = Str::slug(base64_decode($string)); if (!empty($string)) { verify($string)->regExp('/[a-zA-Z0-9-]/'); } }