예제 #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;
 }
예제 #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);
 }
예제 #3
0
 public function testCamelToRegularCase()
 {
     $this->assertEquals(Str::camelToRegularCase("helloWorldThisIsATest"), "hello world this is a test");
 }