Skip to content

Commit

Permalink
[#13208] - Corrected more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Jun 21, 2019
1 parent d7bab7e commit 162fc84
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 44 deletions.
2 changes: 1 addition & 1 deletion tests/integration/Validation/AddCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function validationAdd(IntegrationTester $I)

$I->assertEquals(
[
'name' => [
'name' => [
$alpha,
$presenceOf,
],
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Validation/ConstructCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function validationConstruct(IntegrationTester $I)
$I->wantToTest('Validation - __construct()');

$validators = [
'date' => [
'date' => [
new Date(),
],
'email' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Validation/RuleCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function validationRule(IntegrationTester $I)

$I->assertEquals(
[
'name' => [
'name' => [
$alpha,
$presenceOf,
],
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Validation/RulesCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function validationRules(IntegrationTester $I)

$I->assertEquals(
[
'name' => [
'name' => [
$alpha,
$presenceOf,
],
Expand Down
1 change: 0 additions & 1 deletion tests/integration/Validation/SetFiltersCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public function validationSetFilters(IntegrationTester $I)
);



$messages = $validation->validate(
[
'name' => ' ',
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Validation/SetValidatorsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function validationSetValidators(IntegrationTester $I)
$I->wantToTest('Validation - setValidators()');

$validators = [
'date' => [
'date' => [
new Date(),
],
'email' => [
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/Validation/Validator/DateCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ public function validationValidatorMultipleField(IntegrationTester $I)
/**
* Tests detect valid dates
*
* @author Gustavo Verzola <verzola@gmail.com>
* @since 2015-03-09
* @author Gustavo Verzola <verzola@gmail.com>
* @since 2015-03-09
*
* @dataProvider shouldDetectValidDatesProvider
*/
Expand Down Expand Up @@ -177,8 +177,8 @@ public function shouldDetectValidDates(IntegrationTester $I, Example $example)
/**
* Tests detect invalid dates
*
* @author Gustavo Verzola <verzola@gmail.com>
* @since 2015-03-09
* @author Gustavo Verzola <verzola@gmail.com>
* @since 2015-03-09
*
* @dataProvider shouldDetectInvalidDatesProvider
*/
Expand Down
5 changes: 0 additions & 5 deletions tests/integration/Validation/Validator/EmailCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function validationValidatorSingleField(IntegrationTester $I)
);



$messages = $validation->validate(
[
'email' => 'test@somemail.com',
Expand All @@ -48,7 +47,6 @@ public function validationValidatorSingleField(IntegrationTester $I)
);



$messages = $validation->validate(
[
'email' => 'rootlocalhost',
Expand Down Expand Up @@ -102,7 +100,6 @@ public function validationValidatorMultipleField(IntegrationTester $I)
);



$messages = $validation->validate(
[
'email' => 'test@somemail.com',
Expand All @@ -116,7 +113,6 @@ public function validationValidatorMultipleField(IntegrationTester $I)
);



$messages = $validation->validate(
[
'email' => 'rootlocalhost',
Expand All @@ -135,7 +131,6 @@ public function validationValidatorMultipleField(IntegrationTester $I)
);



$messages = $validation->validate(
[
'email' => 'rootlocalhost',
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/Validation/Validator/ExclusionInCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ public function validationValidatorCustomMessage(IntegrationTester $I)
);



$messages = $validation->validate(
[
'status' => 'A',
Expand All @@ -223,7 +222,6 @@ public function validationValidatorCustomMessage(IntegrationTester $I)
$I->assertEquals($expected, $messages);



$messages = $validation->validate(
[
'status' => 'A',
Expand All @@ -233,7 +231,6 @@ public function validationValidatorCustomMessage(IntegrationTester $I)
$I->assertEquals($expected, $messages);



$messages = $validation->validate(
[
'status' => 'X',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ class ValidateCest
*
* @dataProvider getExamples
*
* @author Phalcon Team <team@phalconphp.com>
* @since 2018-11-13
* @author Phalcon Team <team@phalconphp.com>
* @since 2018-11-13
*/
public function validationValidatorNumericalityValidate(IntegrationTester $I, Example $example)
{
$I->wantToTest('Validation\Validator\Numericality - validate() ' . $example[0]);

$entity = new stdClass();
$entity = new stdClass();
$entity->price = $example[0];

$validation = new Validation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@

namespace Phalcon\Test\Integration\Validation\Validator\StringLength\Max;

use IntegrationTester;
use Phalcon\Test\Fixtures\Traits\ValidationTrait;
use Phalcon\Validation\Validator\StringLength\Max;
use Phalcon\Validation\ValidatorInterface;
use IntegrationTester;

class ConstructCest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function validationValidatorStringLengthMaxGetTemplates(IntegrationTester
$I->assertTrue(is_array($validator->getTemplates()), 'Templates have to be a array');
$I->assertCount(0, $validator->getTemplates(), 'templates count 0');

$messageLastName = "We don't like really long last names";
$messageLastName = "We don't like really long last names";
$messageFirstName = "We don't like really long first names";

$validator = new Max(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public function validationValidatorStringLengthMaxMessageFactory(IntegrationTest

$validator = new Max([
"max" => [
"last_name" => 10
]
"last_name" => 10,
],
]);

$validation = new Validation();
$validation->add(
[
"last_name"
"last_name",
],
$validator
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
namespace Phalcon\Test\Integration\Validation\Validator\StringLength\Max;

use IntegrationTester;
use Phalcon\Messages\Message;
use Phalcon\Messages\Messages;
use Phalcon\Validation;
use Phalcon\Validation\Validator\StringLength\Max;

Expand All @@ -29,8 +27,6 @@ class ValidateCest
public function validationValidatorStringLengthMaxValidate(IntegrationTester $I)
{
$I->wantToTest('Validation\Validator\StringLength\Max - validate()');


}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@

namespace Phalcon\Test\Integration\Validation\Validator\StringLength\Min;

use IntegrationTester;
use Phalcon\Test\Fixtures\Traits\ValidationTrait;
use Phalcon\Validation\Validator\StringLength\Min;
use Phalcon\Validation\ValidatorInterface;
use IntegrationTester;

class ConstructCest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function validationValidatorStringLengthMinGetTemplates(IntegrationTester
$I->assertTrue(is_array($validator->getTemplates()), 'Templates have to be an array');
$I->assertCount(0, $validator->getTemplates(), 'templates count 0');

$messageLastName = "We don't like really long last names";
$messageLastName = "We don't like really long last names";
$messageFirstName = "We don't like really long first names";

$validator = new Min(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public function validationValidatorStringLengthMinMessageFactory(IntegrationTest

$validator = new Min([
"min" => [
"last_name" => 20
]
"last_name" => 20,
],
]);

$validation = new Validation();
$validation->add(
[
"last_name"
"last_name",
],
$validator
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
namespace Phalcon\Test\Integration\Validation\Validator\StringLength\Min;

use IntegrationTester;
use Phalcon\Messages\Message;
use Phalcon\Messages\Messages;
use Phalcon\Validation;
use Phalcon\Validation\Validator\StringLength\Min;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

namespace Phalcon\Test\Unit\Validation\Validator\StringLength;

use UnitTester;
use Phalcon\Validation\Validator\StringLength;
use UnitTester;

class SetTemplateCest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

namespace Phalcon\Test\Unit\Validation\Validator\StringLength;

use UnitTester;
use Phalcon\Validation\Validator\StringLength;
use UnitTester;

class SetTemplatesCest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Test\Integration\Validation\Validator\StringLength2;
namespace Phalcon\Test\Integration\Validation\Validator\StringLength;

use IntegrationTester;
use Phalcon\Messages\Message;
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/Validation/Validator/Url/ValidateCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
namespace Phalcon\Test\Integration\Validation\Validator\Url;

use Codeception\Example;
use const FILTER_FLAG_PATH_REQUIRED;
use const FILTER_FLAG_QUERY_REQUIRED;
use IntegrationTester;
use Phalcon\Messages\Message;
use Phalcon\Messages\Messages;
use Phalcon\Validation;
use Phalcon\Validation\Validator\Url;
use const FILTER_FLAG_PATH_REQUIRED;
use const FILTER_FLAG_QUERY_REQUIRED;

/**
* Class ValidateCest
Expand Down

0 comments on commit 162fc84

Please sign in to comment.