Skip to content

Commit

Permalink
[#14213] - References corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Jul 4, 2019
1 parent 95d3c38 commit d5a0b0b
Show file tree
Hide file tree
Showing 30 changed files with 61 additions and 67 deletions.
1 change: 0 additions & 1 deletion tests/_data/fixtures/models/Abonnes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Phalcon\Messages\Message;
use Phalcon\Mvc\Model;
use Phalcon\Validation;
use Phalcon\Validation\Validator\Email as EmailValidator;
use Phalcon\Validation\Validator\ExclusionIn as ExclusionInValidator;
use Phalcon\Validation\Validator\InclusionIn as InclusionInValidator;
Expand Down
1 change: 0 additions & 1 deletion tests/_data/fixtures/models/Subscriptores.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Phalcon\Messages\Message;
use Phalcon\Mvc\Model;
use Phalcon\Validation;
use Phalcon\Validation\Validator\Email as EmailValidator;
use Phalcon\Validation\Validator\ExclusionIn as ExclusionInValidator;
use Phalcon\Validation\Validator\InclusionIn as InclusionInValidator;
Expand Down
1 change: 0 additions & 1 deletion tests/_data/fixtures/models/Validation/Robots.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Phalcon\Mvc\Model;
use Phalcon\Mvc\Model\Resultset\Simple;
use Phalcon\Test\Models\RobotsParts;
use Phalcon\Validation;
use Phalcon\Validation\Validator\StringLength;

/**
Expand Down
1 change: 0 additions & 1 deletion tests/_data/fixtures/models/Validation/Subscriptores.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Phalcon\Messages\Message;
use Phalcon\Mvc\Model;
use Phalcon\Validation;
use Phalcon\Validation\Validator\Email;
use Phalcon\Validation\Validator\ExclusionIn;
use Phalcon\Validation\Validator\InclusionIn;
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/Cli/Dispatcher/DispatchCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
namespace Phalcon\Test\Cli\Cli\Dispatcher;

use CliTester;
use Exception;
use Phalcon\Cli\Dispatcher;
use Phalcon\Cli\Dispatcher\Exception;
use Phalcon\Test\Fixtures\Traits\DiTrait;

class DispatchCest
Expand Down Expand Up @@ -58,7 +58,7 @@ public function testFakeNamespace(CliTester $I)
$I->expectThrowable(
new Exception(
'Dummy\MainTask handler class cannot be loaded',
Dispatcher::EXCEPTION_HANDLER_NOT_FOUND
Exception::EXCEPTION_HANDLER_NOT_FOUND
),
function () use ($dispatcher) {
$dispatcher->dispatch();
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/Cli/Dispatcher/GetHandlerSuffixCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function cliDispatcherGetHandlerSuffix(CliTester $I)
$I->expectThrowable(
new Exception(
'IndexBleh handler class cannot be loaded',
Dispatcher::EXCEPTION_HANDLER_NOT_FOUND
Exception::EXCEPTION_HANDLER_NOT_FOUND
),
function () use ($dispatcher) {
$dispatcher->dispatch();
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/Db/Adapter/Pdo/Mysql/QueryCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace Phalcon\Test\Integration\Db\Adapter\Pdo\Mysql;

use IntegrationTester;
use Phalcon\Db;
use Phalcon\Db\Enum;
use Phalcon\Test\Fixtures\Traits\DiTrait;

class QueryCest
Expand Down Expand Up @@ -75,7 +75,7 @@ public function dbAdapterPdoMysqlQuery(IntegrationTester $I)


$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_NUM);
$result->setFetchMode(Enum::FETCH_NUM);
$row = $result->fetch();
$I->assertInternalType('array', $row);
$I->assertCount(11, $row);
Expand All @@ -86,7 +86,7 @@ public function dbAdapterPdoMysqlQuery(IntegrationTester $I)


$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_ASSOC);
$result->setFetchMode(Enum::FETCH_ASSOC);
$row = $result->fetch();
$I->assertInternalType('array', $row);
$I->assertCount(11, $row);
Expand All @@ -97,15 +97,15 @@ public function dbAdapterPdoMysqlQuery(IntegrationTester $I)


$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_OBJ);
$result->setFetchMode(Enum::FETCH_OBJ);
$row = $result->fetch();
$I->assertInternalType('object', $row);
$I->assertTrue(isset($row->cedula));



$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_BOTH);
$result->setFetchMode(Enum::FETCH_BOTH);
$result->dataSeek(4);
$row = $result->fetch();
$row = $result->fetch();
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/Db/Adapter/Pdo/Postgresql/QueryCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace Phalcon\Test\Integration\Db\Adapter\Pdo\Postgresql;

use IntegrationTester;
use Phalcon\Db;
use Phalcon\Db\Enum;
use Phalcon\Test\Fixtures\Traits\DiTrait;

class QueryCest
Expand Down Expand Up @@ -75,7 +75,7 @@ public function dbAdapterPdoPostgresqlQuery(IntegrationTester $I)


$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_NUM);
$result->setFetchMode(Enum::FETCH_NUM);
$row = $result->fetch();
$I->assertInternalType('array', $row);
$I->assertCount(11, $row);
Expand All @@ -86,7 +86,7 @@ public function dbAdapterPdoPostgresqlQuery(IntegrationTester $I)


$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_ASSOC);
$result->setFetchMode(Enum::FETCH_ASSOC);
$row = $result->fetch();
$I->assertInternalType('array', $row);
$I->assertCount(11, $row);
Expand All @@ -97,15 +97,15 @@ public function dbAdapterPdoPostgresqlQuery(IntegrationTester $I)


$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_OBJ);
$result->setFetchMode(Enum::FETCH_OBJ);
$row = $result->fetch();
$I->assertInternalType('object', $row);
$I->assertTrue(isset($row->cedula));



$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_BOTH);
$result->setFetchMode(Enum::FETCH_BOTH);
$result->dataSeek(4);
$row = $result->fetch();
$row = $result->fetch();
Expand Down
9 changes: 4 additions & 5 deletions tests/integration/Db/Adapter/Pdo/Sqlite/QueryCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
namespace Phalcon\Test\Integration\Db\Adapter\Pdo\Sqlite;

use IntegrationTester;
use Phalcon\Db;
use Phalcon\Test\Fixtures\Traits\DiTrait;

class QueryCest
Expand Down Expand Up @@ -70,7 +69,7 @@ public function dbAdapterPdoSqliteQuery(IntegrationTester $I)


$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_NUM);
$result->setFetchMode(Enum::FETCH_NUM);
$row = $result->fetch();
$I->assertInternalType('array', $row);
$I->assertCount(11, $row);
Expand All @@ -81,7 +80,7 @@ public function dbAdapterPdoSqliteQuery(IntegrationTester $I)


$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_ASSOC);
$result->setFetchMode(Enum::FETCH_ASSOC);
$row = $result->fetch();
$I->assertInternalType('array', $row);
$I->assertCount(11, $row);
Expand All @@ -92,15 +91,15 @@ public function dbAdapterPdoSqliteQuery(IntegrationTester $I)


$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_OBJ);
$result->setFetchMode(Enum::FETCH_OBJ);
$row = $result->fetch();
$I->assertInternalType('object', $row);
$I->assertTrue(isset($row->cedula));



$result = $connection->query('SELECT * FROM personas LIMIT 5');
$result->setFetchMode(Db::FETCH_BOTH);
$result->setFetchMode(Enum::FETCH_BOTH);
$result->dataSeek(4);
$row = $result->fetch();
$row = $result->fetch();
Expand Down
14 changes: 7 additions & 7 deletions tests/integration/Db/DbCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Codeception\Example;
use IntegrationTester;
use PDO;
use Phalcon\Db;
use Phalcon\Db\Enum;
use Phalcon\Db\RawValue;
use Phalcon\Test\Fixtures\Traits\DiTrait;

Expand Down Expand Up @@ -223,7 +223,7 @@ public function db(IntegrationTester $I, Example $example)

$row = $connection->fetchOne(
'select count(*) as cnt from prueba where nombre=? and estado=?',
Db::FETCH_ASSOC,
Enum::FETCH_ASSOC,
[
'LOL array syntax 2', 'X',
]
Expand Down Expand Up @@ -252,7 +252,7 @@ public function db(IntegrationTester $I, Example $example)

$row = $connection->fetchOne(
'select count(*) as cnt from prueba where nombre=? and estado=?',
Db::FETCH_ASSOC,
Enum::FETCH_ASSOC,
[
'LOL array syntax 3', 'E',
]
Expand All @@ -272,7 +272,7 @@ public function db(IntegrationTester $I, Example $example)

$row = $connection->fetchOne(
'select count(*) as cnt from prueba where nombre=? and estado=?',
Db::FETCH_ASSOC,
Enum::FETCH_ASSOC,
[
'LOL insertAsDict', 'E',
]
Expand All @@ -292,7 +292,7 @@ public function db(IntegrationTester $I, Example $example)

$row = $connection->fetchOne(
'select count(*) as cnt from prueba where nombre=? and estado=?',
Db::FETCH_ASSOC,
Enum::FETCH_ASSOC,
[
'LOL updateAsDict', 'X',
]
Expand All @@ -319,7 +319,7 @@ public function db(IntegrationTester $I, Example $example)

$I->assertCount(
11,
$connection->fetchOne('SELECT * FROM personas', Db::FETCH_NUM)
$connection->fetchOne('SELECT * FROM personas', Enum::FETCH_NUM)
);

$I->assertCount(
Expand All @@ -329,7 +329,7 @@ public function db(IntegrationTester $I, Example $example)

$rows = $connection->fetchAll(
'SELECT * FROM personas LIMIT 10',
Db::FETCH_NUM
Enum::FETCH_NUM
);
$I->assertCount(10, $rows);
$I->assertCount(11, $rows[0]);
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/Firewall/Adapter/Acl/AfterBindingCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use function ob_end_clean;
use function ob_start;
use Phalcon\Acl\Adapter\Memory;
use Phalcon\Acl as PhAcl;
use Phalcon\Acl\Enum;
use Phalcon\Events\Manager;
use Phalcon\Firewall\Adapter\Acl;
use Phalcon\Mvc\Dispatcher;
Expand Down Expand Up @@ -96,7 +96,7 @@ public function firewallAdapterAclAfterBinding(IntegrationTester $I, Example $ex
$I->wantToTest('Firewall\Adapter\Acl - afterBinding()');

$acl = new Memory();
$acl->setDefaultAction(PhAcl::DENY);
$acl->setDefaultAction(Enum::DENY);
$acl->addComponent('Four', ['first', 'second']);
$acl->addRole('ROLE1');
$acl->addRole('ROLE2');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use function ob_end_clean;
use function ob_start;
use Phalcon\Acl\Adapter\Memory;
use Phalcon\Acl as PhAcl;
use Phalcon\Acl\Enum;
use Phalcon\Events\Manager;
use Phalcon\Firewall\Adapter\Acl;
use Phalcon\Mvc\Dispatcher;
Expand Down Expand Up @@ -100,7 +100,7 @@ public function firewallAdapterAclBeforeExecuteRoute(IntegrationTester $I)

$acl = new Memory();

$acl->setDefaultAction(PhAcl::DENY);
$acl->setDefaultAction(Enum::DENY);

$acl->addComponent('One', ['firstRole', 'secondRole']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace Phalcon\Test\Integration\Firewall\Adapter\Acl;

use IntegrationTester;
use Phalcon\Acl as PhAcl;
use Phalcon\Acl\Enum;
use Phalcon\Firewall\Adapter\Acl;

class GetSetDefaultAccessCest
Expand All @@ -29,9 +29,9 @@ public function firewallAdapterAclGetDefaultAccess(IntegrationTester $I)
$I->wantToTest('Firewall\Adapter\Acl - getDefaultAccess()');

$firewall = new Acl('acl');
$firewall->setDefaultAccess(PhAcl::ALLOW);
$firewall->setDefaultAccess(Enum::ALLOW);

$actual = $firewall->getDefaultAccess();
$I->assertEquals(PhAcl::ALLOW, $actual);
$I->assertEquals(Enum::ALLOW, $actual);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use function ob_end_clean;
use function ob_start;
use Phalcon\Acl\Adapter\Memory;
use Phalcon\Acl as PhAcl;
use Phalcon\Acl\Enum;
use Phalcon\Events\Manager;
use Phalcon\Firewall\Adapter\Acl;
use Phalcon\Mvc\Dispatcher;
Expand Down Expand Up @@ -93,7 +93,7 @@ public function firewallAdapterAclSetBoundModelsKeyMap(IntegrationTester $I)
$I->wantToTest('Firewall\Adapter\Acl - setBoundModelsKeyMap()');

$acl = new Memory();
$acl->setDefaultAction(PhAcl::DENY);
$acl->setDefaultAction(Enum::DENY);
$acl->addComponent('Four', ['first', 'second']);
$acl->addRole('ROLE2');
$acl->allow(
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/Firewall/Adapter/Acl/SetCacheCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use function ob_end_clean;
use function ob_start;
use Phalcon\Acl\Adapter\Memory;
use Phalcon\Acl as PhAcl;
use Phalcon\Acl\Enum;
use Phalcon\Cache\AdapterFactory;
use Phalcon\Events\Manager;
use Phalcon\Firewall\Adapter\Acl;
Expand Down Expand Up @@ -95,7 +95,7 @@ public function firewallAdapterAclSetCache(IntegrationTester $I)
$I->wantToTest('Firewall\Adapter\Acl - setCache()');

$acl = new Memory();
$acl->setDefaultAction(PhAcl::DENY);
$acl->setDefaultAction(Enum::DENY);
$acl->addComponent('Four', ['first', 'second']);
$acl->addComponent('Three', ['deny',]);
$acl->addRole('ROLE1');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use function ob_end_clean;
use function ob_start;
use Phalcon\Acl\Adapter\Memory;
use Phalcon\Acl as PhAcl;
use Phalcon\Acl\Enum;
use Phalcon\Events\Manager;
use Phalcon\Firewall\Adapter\Acl;
use Phalcon\Mvc\Dispatcher;
Expand Down Expand Up @@ -90,7 +90,7 @@ public function firewallAdapterAclUseMultiModuleConfiguration(IntegrationTester
$I->wantToTest('Firewall\Adapter\Acl - useMultiModuleConfiguration()');

$acl = new Memory();
$acl->setDefaultAction(PhAcl::DENY);
$acl->setDefaultAction(Enum::DENY);
$acl->addComponent('Module1:One', ['firstRole', 'secondRole']);
$acl->addComponent('Module2:One', ['firstRole', 'secondRole']);
$acl->addRole('ROLE1');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace Phalcon\Test\Integration\Firewall\Adapter\Annotations;

use IntegrationTester;
use Phalcon\Acl as PhAcl;
use Phalcon\Acl\Enum;
use Phalcon\Annotations\Adapter\Memory;
use Phalcon\Firewall\Adapter\Annotations;

Expand All @@ -31,9 +31,9 @@ public function firewallAdapterAnnotationsGetSetDefaultAccess(IntegrationTester
$I->wantToTest('Firewall\Adapter\Annotations - getDefaultAccess()/setDefaultAccess()');

$firewall = new Annotations(new Memory());
$firewall->setDefaultAccess(PhAcl::ALLOW);
$firewall->setDefaultAccess(Enum::ALLOW);

$actual = $firewall->getDefaultAccess();
$I->assertEquals(PhAcl::ALLOW, $actual);
$I->assertEquals(Enum::ALLOW, $actual);
}
}
Loading

0 comments on commit d5a0b0b

Please sign in to comment.