Ejemplo n.º 1
0
 /**
  * Compare two properties for equality
  * @param $property string The first property to compare
  * @param $value string The second property to compare
  * @return $this Validator Current validator for chaining
  */
 public function isSameAs($property, $value)
 {
     if ($this->hasProperty($value) && $this->data[$value] != $this->data[$property]) {
         $this->addError($property, "must be the same as " . Str::camelToTitleCase($value));
     }
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Format the validation message
  * @param $property string Property to format
  * @return string Formatted validation message
  */
 protected function formatValidationMessage($property)
 {
     return Str::camelToTitleCase($property) . " " . $this->extractValidationMessage($property);
 }
Ejemplo n.º 3
0
 public function testCamelToRegularCase()
 {
     $this->assertEquals(Str::camelToRegularCase("helloWorldThisIsATest"), "hello world this is a test");
 }