-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from bim-g/v3
V3-beta
- Loading branch information
Showing
47 changed files
with
1,369 additions
and
1,001 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":1,"defects":{"Test\\Schema\\SCHStringTest::testStringObject":4,"Test\\Schema\\SCHStringTest::testStringObjectIsNotKey":3,"Test\\Schema\\SCHStringTest::testStringEmailKey":3,"Test\\Schema\\SCHStringTest::testStringObjectIsKey":4,"Test\\Schema\\StringSchemaTest::testStringURLKey":4,"Test\\Schema\\StringSchemaTest::testStringMatchKey":4,"Test\\Schema\\StringSchemaTest::testStringMinimumKey":4,"Test\\Schema\\NumberSchemaTest::testStringIsObject":4,"Test\\Schema\\NumberSchemaTest::testRequiredKey":4,"Test\\Schema\\DateSchemaTest::testDateTodayKey":4,"Test\\Schema\\BooleanSchemaTest::testBooleanIsRequireddKey":4,"Test\\Script\\StringValidationTest::testStringIsObject":4,"Test\\Script\\StringValidationTest::testStringObjectException":4,"Test\\Script\\StringValidationTest::testException":3,"Test\\Script\\StringValidationTest::testStringMin":3,"Test\\Script\\StringValidationTest::testStringMaxError":4,"Test\\Script\\StringValidationTest::testStringMaxSuccess":3,"Test\\Script\\StringValidationTest::testStringValidationSourceDataException":4,"Test\\Script\\StringValidationTest::testStringValidationSchemaException":4,"Test\\Script\\StringValidationTest::testStringMinError":4,"Test\\Script\\StringValidationTest::testStringMinSuccess":3,"Test\\Script\\StringValidationTest::testStringEmailError":3,"Test\\Script\\StringValidationTest::testStringURLSuccess":4,"Test\\Script\\StringValidationTest::testStringRequiredSuccess":4,"Test\\Script\\StringValidationTest::testStringRequiredErrors":3,"Test\\Script\\StringValidationTest::testStringRequiredErrorsUnknown":4,"Test\\Script\\StringValidationTest::testStringMatchSuccess":3,"Test\\Script\\StringValidationTest::testStringMatchErrors":3,"Test\\Schema\\StringSchemaTest::testStringIsObject":4,"Test\\Schema\\StringSchemaTest::testStringObjectIsKey":4,"Test\\Schema\\StringSchemaTest::testStringEmailKey":4,"Test\\Schema\\StringSchemaTest::testStringMaximumKey":4,"Test\\Schema\\DateSchemaTest::testStringIsObject":4,"Test\\Schema\\DateSchemaTest::testStringObjectIsKey":4,"Test\\Schema\\DateSchemaTest::testDateNowKey":4,"Test\\Schema\\NumberSchemaTest::testStringObjectIsKey":4,"Test\\Schema\\NumberSchemaTest::testNumberPositiveKey":4,"Test\\Schema\\BooleanSchemaTest::testBooleanIsObject":4,"Test\\Schema\\BooleanSchemaTest::testStringObjectIsKey":4,"Test\\Schema\\BooleanSchemaTest::testBooleanIsValidKey":3,"Test\\ValidationTest::testValidationStringObject":3,"Test\\ValidationTest::testValidationStringErrorObject":3},"times":{"Test\\Schema\\SCHStringTest::testStringObject":0.021,"Test\\Schema\\SCHStringTest::testStringObjectIsKey":0,"Test\\Schema\\SCHStringTest::testStringObjectIsNotKey":0.01,"Test\\Schema\\SCHStringTest::testStringEmailKey":0.001,"Test\\Schema\\SCHStringTest::testStringIsObject":0.008,"Test\\Schema\\StringSchemaTest::testStringIsObject":0.005,"Test\\Schema\\StringSchemaTest::testStringObjectIsKey":0,"Test\\Schema\\StringSchemaTest::testStringEmailKey":0,"Test\\Schema\\StringSchemaTest::testStringURLKey":0,"Test\\Schema\\StringSchemaTest::testStringMatchKey":0,"Test\\Schema\\StringSchemaTest::testStringMinimumKey":0,"Test\\Schema\\StringSchemaTest::testStringMaximumKey":0,"Test\\Schema\\NumberSchemaTest::testStringIsObject":0.005,"Test\\Schema\\NumberSchemaTest::testStringObjectIsKey":0,"Test\\Schema\\NumberSchemaTest::testRequiredKey":0,"Test\\Schema\\NumberSchemaTest::testNumberPositiveKey":0,"Test\\Schema\\DateSchemaTest::testStringIsObject":0.006,"Test\\Schema\\DateSchemaTest::testStringObjectIsKey":0,"Test\\Schema\\DateSchemaTest::testDateNowKey":0,"Test\\Schema\\DateSchemaTest::testDateTodayKey":0,"Test\\Schema\\BooleanSchemaTest::testBooleanIsObject":0.005,"Test\\Schema\\BooleanSchemaTest::testStringObjectIsKey":0,"Test\\Schema\\BooleanSchemaTest::testBooleanIsRequireddKey":0,"Test\\Schema\\BooleanSchemaTest::testBooleanIsValidKey":0,"Test\\Script\\StringValidationTest::testStringIsObject":0,"Test\\Script\\StringValidationTest::testStringObjectException":0.006,"Test\\Script\\StringValidationTest::testException":0.007,"Test\\Script\\StringValidationTest::testStringMin":0.001,"Test\\Script\\StringValidationTest::testStringValidationException":0.006,"Test\\Script\\StringValidationTest::testStringValidationSchemaException":0,"Test\\Script\\StringValidationTest::testStringValidationSourceDataException":0.007,"Test\\Script\\StringValidationTest::testStringMinError":0,"Test\\Script\\StringValidationTest::testStringMinSuccess":0,"Test\\Script\\StringValidationTest::testStringMaxError":0,"Test\\Script\\StringValidationTest::testStringMaxSuccess":0,"Test\\Script\\StringValidationTest::testStringEmailError":0.001,"Test\\Script\\StringValidationTest::testStringEmailSuccess":0,"Test\\Script\\StringValidationTest::testStringUrlError":0.008,"Test\\Script\\StringValidationTest::testStringURLError":0,"Test\\Script\\StringValidationTest::testStringURLSuccess":0.008,"Test\\Script\\StringValidationTest::testStringRequiredSuccess":0.001,"Test\\Script\\StringValidationTest::testStringRequiredErrors":0,"Test\\Script\\StringValidationTest::testStringRequiredErrorsUnknow":0,"Test\\Script\\StringValidationTest::testStringRequiredErrorsUnknown":0,"Test\\Script\\StringValidationTest::testStringMatchErrors":0,"Test\\Script\\StringValidationTest::testStringMatchSuccess":0,"Test\\Script\\StringValidationTest::testStringValidationFieldNotDefinedException":0,"Test\\ValidationTest::testValidationObject":0.016,"Test\\ValidationTest::testValidationStringObject":0.005,"Test\\ValidationTest::testValidationStringErrorObject":0.009}} | ||
{"version":1,"defects":{"Test\\Schema\\SCHStringTest::testStringObject":4,"Test\\Schema\\SCHStringTest::testStringObjectIsNotKey":3,"Test\\Schema\\SCHStringTest::testStringEmailKey":3,"Test\\Schema\\SCHStringTest::testStringObjectIsKey":4,"Test\\Schema\\StringSchemaTest::testStringURLKey":3,"Test\\Schema\\StringSchemaTest::testStringMatchKey":3,"Test\\Schema\\StringSchemaTest::testStringMinimumKey":3,"Test\\Schema\\NumberSchemaTest::testStringIsObject":4,"Test\\Schema\\NumberSchemaTest::testRequiredKey":3,"Test\\Schema\\DateSchemaTest::testDateTodayKey":3,"Test\\Schema\\BooleanSchemaTest::testBooleanIsRequireddKey":3,"Test\\Script\\StringValidationTest::testStringIsObject":4,"Test\\Script\\StringValidationTest::testStringObjectException":4,"Test\\Script\\StringValidationTest::testException":3,"Test\\Script\\StringValidationTest::testStringMin":3,"Test\\Script\\StringValidationTest::testStringMaxError":4,"Test\\Script\\StringValidationTest::testStringMaxSuccess":4,"Test\\Script\\StringValidationTest::testStringValidationSourceDataException":4,"Test\\Script\\StringValidationTest::testStringValidationSchemaException":4,"Test\\Script\\StringValidationTest::testStringMinError":4,"Test\\Script\\StringValidationTest::testStringMinSuccess":4,"Test\\Script\\StringValidationTest::testStringEmailError":4,"Test\\Script\\StringValidationTest::testStringURLSuccess":4,"Test\\Script\\StringValidationTest::testStringRequiredSuccess":4,"Test\\Script\\StringValidationTest::testStringRequiredErrors":4,"Test\\Script\\StringValidationTest::testStringRequiredErrorsUnknown":4,"Test\\Script\\StringValidationTest::testStringMatchSuccess":4,"Test\\Script\\StringValidationTest::testStringMatchErrors":4,"Test\\Schema\\StringSchemaTest::testStringIsObject":4,"Test\\Schema\\StringSchemaTest::testStringObjectIsKey":3,"Test\\Schema\\StringSchemaTest::testStringEmailKey":3,"Test\\Schema\\StringSchemaTest::testStringMaximumKey":3,"Test\\Schema\\DateSchemaTest::testStringIsObject":4,"Test\\Schema\\DateSchemaTest::testStringObjectIsKey":3,"Test\\Schema\\DateSchemaTest::testDateNowKey":3,"Test\\Schema\\NumberSchemaTest::testStringObjectIsKey":3,"Test\\Schema\\NumberSchemaTest::testNumberPositiveKey":3,"Test\\Schema\\BooleanSchemaTest::testBooleanIsObject":4,"Test\\Schema\\BooleanSchemaTest::testStringObjectIsKey":3,"Test\\Schema\\BooleanSchemaTest::testBooleanIsValidKey":3,"Test\\ValidationTest::testValidationStringObject":3,"Test\\ValidationTest::testValidationStringErrorObject":3,"Test\\Script\\StringValidationTest::testStringValidationFieldNotDefinedException":4,"Test\\Script\\StringValidationTest::testStringEmailSuccess":4,"Test\\Script\\StringValidationTest::testStringURLError":4,"Test\\SchemaTest::testSchemaStringObject":3,"Test\\SchemaTest::testSchemaNumberObject":3,"Test\\SchemaTest::testSchemaDateObject":3},"times":{"Test\\Schema\\SCHStringTest::testStringObject":0.021,"Test\\Schema\\SCHStringTest::testStringObjectIsKey":0,"Test\\Schema\\SCHStringTest::testStringObjectIsNotKey":0.01,"Test\\Schema\\SCHStringTest::testStringEmailKey":0.001,"Test\\Schema\\SCHStringTest::testStringIsObject":0.008,"Test\\Schema\\StringSchemaTest::testStringIsObject":0.007,"Test\\Schema\\StringSchemaTest::testStringObjectIsKey":0.001,"Test\\Schema\\StringSchemaTest::testStringEmailKey":0.001,"Test\\Schema\\StringSchemaTest::testStringURLKey":0,"Test\\Schema\\StringSchemaTest::testStringMatchKey":0,"Test\\Schema\\StringSchemaTest::testStringMinimumKey":0,"Test\\Schema\\StringSchemaTest::testStringMaximumKey":0,"Test\\Schema\\NumberSchemaTest::testStringIsObject":0.007,"Test\\Schema\\NumberSchemaTest::testStringObjectIsKey":0,"Test\\Schema\\NumberSchemaTest::testRequiredKey":0.001,"Test\\Schema\\NumberSchemaTest::testNumberPositiveKey":0,"Test\\Schema\\DateSchemaTest::testStringIsObject":0.009,"Test\\Schema\\DateSchemaTest::testStringObjectIsKey":0.008,"Test\\Schema\\DateSchemaTest::testDateNowKey":0.001,"Test\\Schema\\DateSchemaTest::testDateTodayKey":0,"Test\\Schema\\BooleanSchemaTest::testBooleanIsObject":0.007,"Test\\Schema\\BooleanSchemaTest::testStringObjectIsKey":0.001,"Test\\Schema\\BooleanSchemaTest::testBooleanIsRequireddKey":0.001,"Test\\Schema\\BooleanSchemaTest::testBooleanIsValidKey":0,"Test\\Script\\StringValidationTest::testStringIsObject":0.001,"Test\\Script\\StringValidationTest::testStringObjectException":0.006,"Test\\Script\\StringValidationTest::testException":0.007,"Test\\Script\\StringValidationTest::testStringMin":0.001,"Test\\Script\\StringValidationTest::testStringValidationException":0.006,"Test\\Script\\StringValidationTest::testStringValidationSchemaException":0.001,"Test\\Script\\StringValidationTest::testStringValidationSourceDataException":0.076,"Test\\Script\\StringValidationTest::testStringMinError":0.001,"Test\\Script\\StringValidationTest::testStringMinSuccess":0.001,"Test\\Script\\StringValidationTest::testStringMaxError":0.001,"Test\\Script\\StringValidationTest::testStringMaxSuccess":0.001,"Test\\Script\\StringValidationTest::testStringEmailError":0.001,"Test\\Script\\StringValidationTest::testStringEmailSuccess":0.001,"Test\\Script\\StringValidationTest::testStringUrlError":0.008,"Test\\Script\\StringValidationTest::testStringURLError":0.001,"Test\\Script\\StringValidationTest::testStringURLSuccess":0.001,"Test\\Script\\StringValidationTest::testStringRequiredSuccess":0.001,"Test\\Script\\StringValidationTest::testStringRequiredErrors":0.001,"Test\\Script\\StringValidationTest::testStringRequiredErrorsUnknow":0,"Test\\Script\\StringValidationTest::testStringRequiredErrorsUnknown":0.001,"Test\\Script\\StringValidationTest::testStringMatchErrors":0.001,"Test\\Script\\StringValidationTest::testStringMatchSuccess":0.001,"Test\\Script\\StringValidationTest::testStringValidationFieldNotDefinedException":0.001,"Test\\ValidationTest::testValidationObject":0.016,"Test\\ValidationTest::testValidationStringObject":0.005,"Test\\ValidationTest::testValidationStringErrorObject":0.262,"Test\\SchemaTest::testSchemaObject":0.008,"Test\\SchemaTest::testSchemaStringObject":0.002,"Test\\SchemaTest::testSchemaStringErrorObject":0.003,"Test\\SchemaTest::testSchemaNumberObject":0.007,"Test\\SchemaTest::testSchemaNumberErrorObject":0.011,"Test\\SchemaTest::testSchemaDateErrorObject":0.012,"Test\\SchemaTest::testSchemaDateObject":0.007}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2022. Wepesi validation. | ||
* @author Boss Ibrahim Mussa | ||
*/ | ||
$validate = new \Wepesi\App\Validate(); | ||
$schema = new \Wepesi\App\Schema(); | ||
|
||
$data_source = [ | ||
'status' => false, | ||
'activated' => "" | ||
]; | ||
//define the schema model for validation | ||
$rules=[ | ||
"status" => $schema->boolean()->required()->max(true)->isValid('TRUE')->generate(), | ||
"activated" => $schema->boolean()->required()->min(false)->isValid('FALSE')->generate(), | ||
]; | ||
|
||
$validate->check($data_source,$rules); | ||
// check if the validation passed or not | ||
var_dump($validate->passed()); | ||
var_dump($validate->errors()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2022. Wepesi validation. | ||
* @author Boss Ibrahim Mussa | ||
*/ | ||
$validate = new \Wepesi\App\Validate(); | ||
$schema = new \Wepesi\App\Schema(); | ||
|
||
$data_source = [ | ||
'birth_day' => '2021-05-23', | ||
'date_created' => '2021-05-23' | ||
]; | ||
$rules=[ | ||
"birth_day" => $schema->date()->min("-18years")->required()->generate(), | ||
"date_created" => $schema->date()->now()->max("100years")->required()->generate() | ||
]; | ||
$validate->check($data_source,$rules); | ||
|
||
var_dump($validate->passed()); | ||
var_dump($validate->errors()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2022. Wepesi validation. | ||
* @author Boss Ibrahim Mussa | ||
*/ | ||
|
||
$data_source = [ | ||
"name" => "ibrahim", | ||
"age" => 12, | ||
"country" => "DRC", | ||
"state" => "North Kivu", | ||
"password"=>"1234567", | ||
"new_password"=>123456, | ||
"city" => "Goma", | ||
"email"=>"[email protected]", | ||
"link"=> "https://github.com/bim-g/wepesi_validation/", | ||
"status"=> true, | ||
"birth_day"=>"2021-05-23", | ||
"date_created"=>"2021-05-23" | ||
]; | ||
|
||
// include_once __DIR__."/string.php"; | ||
// include __DIR__."/number.php"; | ||
// include __DIR__."/date.php"; | ||
include __DIR__."/boolean.php"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2022. Wepesi validation. | ||
* @author Boss Ibrahim Mussa | ||
*/ | ||
|
||
$validate = new \Wepesi\App\Validate(); | ||
$schema = new \Wepesi\App\Schema(); | ||
$data_source = [ | ||
"age" => 20, | ||
"length" => 0, | ||
"height" =>"35", | ||
"width" =>"", | ||
"direction" => -7 | ||
]; | ||
$rules=[ | ||
"age" => $schema->number()->min(8)->max(15)->required()->generate(), | ||
"length" => $schema->number()->min(1)->max(10)->required()->generate(), | ||
"height" => $schema->number()->min(18)->max(50)->required()->generate(), | ||
"width" => $schema->number()->min(3)->max(50)->required()->generate(), | ||
"direction" => $schema->number()->min(3)->max(50)->positive()->required()->generate(), | ||
]; | ||
$validate->check($data_source,$rules); | ||
|
||
var_dump($validate->passed()); | ||
var_dump($validate->errors()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2022. Wepesi validation. | ||
* @author Boss Ibrahim Mussa | ||
*/ | ||
/** | ||
* Validate string | ||
*/ | ||
|
||
use Wepesi\App\Schema; | ||
use Wepesi\App\Validate; | ||
|
||
$schema = new Schema(); | ||
$validate = new Validate(); | ||
$source = [ | ||
'name' => 'ibrahim', | ||
'country' => "", | ||
'password' => '1234567', | ||
'new_password' => 123456, | ||
'email' => '[email protected]', | ||
'link' => 'https://github.com/bim-g/wepesi_validation/' | ||
]; | ||
$rules = [ | ||
"name" => $schema->string()->email()->min(35)->max(50)->required()->generate(), | ||
"country" => $schema->string()->min(3)->max(40)->required()->generate(), | ||
"password" => $schema->string()->min(3)->max(40)->generate(), | ||
"new_password" => $schema->string()->min(3)->max(40)->match("password")->generate(), | ||
"email" => $schema->string()->min(3)->max(40)->email()->generate(), | ||
"link" => $schema->string()->min(3)->max(40)->url()->generate(), | ||
]; | ||
$validate->check($source, $rules); | ||
//// check if the validation passed or not | ||
var_dump($validate->passed()); | ||
var_dump($validate->errors()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<?php | ||
/* | ||
* Copyright (c) 2022. Wepesi validation. | ||
* @author Boss Ibrahim Mussa | ||
*/ | ||
|
||
require_once "./vendor/autoload.php"; | ||
include('./shared/global.php'); | ||
include('./test/index.php'); | ||
require_once __DIR__."/vendor/autoload.php"; | ||
include __DIR__.'/example/index.php'; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.