Example #1
0
 public function testValidNumericRandom()
 {
     // Default is size 10
     $s = new Stringizer("");
     $randomNum1 = $s->randomNumeric()->getString();
     // Default is size 10
     $this->assertEquals(10, $s->length());
     // Confirm is Number, this potentially can fail because
     // a value with zero up front would make the value a string
     //$this->assertEquals(true, $s->isNumber());
     $s2 = new Stringizer(intval($s->getString()));
     $this->assertEquals(true, $s2->isNumber());
     $randonNum2 = $s->randomNumeric()->getString();
     $this->assertNotEquals($randomNum1, $randonNum2);
     // Test non default size
     $s->randomNumeric(20)->getString();
     $this->assertEquals(20, $s->length());
 }
 public function execute()
 {
     $s = new Stringizer($this->getValue());
     $s->replaceAccents();
     return ctype_lower($s->getString());
 }
Example #3
0
 public function drawTextTitle($text)
 {
     $this->drawText($text);
     $v = $this->verticalBar() . " ";
     $textLength = (new Stringizer($text))->length();
     $s = new Stringizer("-");
     $s->padRight("-", $textLength)->padRight(" ", $this->numColumns - self::$wallOffset - self::$leftMargin);
     $v .= $s->getString();
     $v .= $this->verticalBar();
     echo $v . PHP_EOL;
 }
Example #4
0
 public function execute()
 {
     $s = new Stringizer($this->getValue());
     $s->replace(array("_", "-"), array(" ", " "))->lowercase()->uppercaseWords()->replace(" ", "")->lowercaseFirst(true);
     return $s->getString();
 }
Example #5
0
 public function execute()
 {
     $s = new Stringizer($this->getValue());
     $s->removeWhitespace();
     return empty(trim($s->getString()));
 }