public function testCanConfigureSlugResult()
 {
     $monkeyFighter = new MonkeyFighter('F**k MotherF*!ker S#!t P*$$! P**s Muthf#$!ing C**KSUCKER NI**** N***A N*$@ah T**s T$$%Yf**! A-- B--CH D***', array('/F[UCK!@#$%&*-]{3}/' => 'FUGG', '/([Ff])[uck!@#$%&*-]{3}/' => '$1ugg'));
     $monkeyFighter->vulgarize();
     $dirty = $monkeyFighter->__toString();
     assertequals('Fugg MotherFugger S#!t P*$$! P**s Muthfugging C**KSUCKER NI**** N***A N*$@ah T**s T$$%Yfugg A-- B--CH D***', $dirty);
 }
示例#2
0
 public function testCanConfigureSlugResult()
 {
     $slugifier = new Slugifier();
     $slugifier->setLimit(40);
     $slugifier->setDelimiter('_');
     $slugifier->setLowercase(false);
     $slugifier->setReplacements(array('/\\b(an)\\b/i' => 'a', '/\\b(example)\\b/i' => 'Test'));
     $slug = $slugifier->slugify('This is an Example String. What\'s Going to Happen to Me?');
     assertequals('This_is_a_Test_String_What_s_Going_to_Ha', $slug);
 }
示例#3
0
 /**
  * @Then /^the session "([^"]*)" should have a score of (\d+)$/
  */
 public function theSessionShouldHaveAScoreOf($session, $score)
 {
     $sesPh = $this->phabric->getEntity('session');
     $sessionId = $sesPh->getNamedItemId($session);
     $sql = 'SELECT sum(vote) as votes FROM vote WHERE session_id = :id';
     $stmt = self::$db->prepare($sql);
     $stmt->bindValue(':id', $sessionId);
     $stmt->execute();
     $result = $stmt->fetchAll(PDO::FETCH_COLUMN);
     assertequals($score, $result[0]);
 }
示例#4
0
 public function testCanConfigureSlugResult()
 {
     $sluggo = new Sluggo('Brooks & Dunn at Comerica Theatre', array('prefix' => 'order_', 'suffix' => '_tickets', 'maxLength' => 45, 'separator' => '_'));
     $slug = $sluggo->getSlug();
     assertequals('order_brooks_and_dunn_at_comerica_tickets', $slug);
 }