Skip to content
Permalink
Browse files
PHPCS
  • Loading branch information
niden committed Feb 3, 2020
1 parent 74aa882 commit 07d9f1e0fcd6196b97bc2dbb0a4b9c7a593d2ceb
Showing 74 changed files with 223 additions and 247 deletions.
@@ -8,6 +8,7 @@
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
</rule>
<file>tests/cli</file>
<file>tests/database</file>
<file>tests/integration</file>
<file>tests/unit</file>
</ruleset>
@@ -15,12 +15,9 @@

use DatabaseTester;
use Phalcon\Test\Fixtures\Migrations\InvoicesMigration;
use Phalcon\Test\Fixtures\Migrations\ObjectsMigration;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models\Invoices;
use Phalcon\Test\Models\Objects;
use Phalcon\Test\Models\Personas;
use Phalcon\Test\Models\Users;

use function uniqid;

class AssignCest
@@ -34,7 +31,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -48,9 +45,9 @@ public function mvcModelAssign(DatabaseTester $I)
{
$I->wantToTest('Mvc\Model - assign()');

$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');
$data = [
$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');
$data = [
'inv_id' => 1,
'inv_cst_id' => 2,
'inv_status_flag' => 3,
@@ -20,10 +20,6 @@
use Phalcon\Test\Fixtures\Traits\RecordsTrait;
use Phalcon\Test\Models\Invoices;
use Phalcon\Test\Models\InvoicesMap;
use Phalcon\Test\Models\Personnes;
use Phalcon\Test\Models\Pessoas;
use function uniqid;
use function var_dump;

class CountCest
{
@@ -37,7 +33,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -58,7 +54,7 @@ public function mvcModelCount(DatabaseTester $I)
if ('sqlite' !== $driver) {
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);

$this->insertDataInvoices($migration, 7, 2, 'ccc');
$this->insertDataInvoices($migration, 1, 3, 'aaa');
@@ -128,7 +124,7 @@ public function mvcModelCountColumnMap(DatabaseTester $I)
if ('sqlite' !== $driver) {
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);

$this->insertDataInvoices($migration, 7, 2, 'ccc');
$this->insertDataInvoices($migration, 1, 3, 'aaa');
@@ -16,9 +16,8 @@
use DatabaseTester;
use Phalcon\Test\Fixtures\Migrations\InvoicesMigration;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models\AlbumORama\Artists;

use Phalcon\Test\Models\Invoices;

use function date;
use function uniqid;

@@ -36,7 +35,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -50,9 +49,9 @@ public function mvcModelCreate(DatabaseTester $I)
{
$I->wantToTest('Mvc\Model - create()');

$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');
$invoice = new Invoices();
$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');
$invoice = new Invoices();
$invoice->inv_id = 1;
$invoice->inv_cst_id = 2;
$invoice->inv_status_flag = 3;
@@ -16,9 +16,8 @@
use DatabaseTester;
use Phalcon\Test\Fixtures\Migrations\InvoicesMigration;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models\AlbumORama\Artists;

use Phalcon\Test\Models\Invoices;

use function date;
use function uniqid;

@@ -36,7 +35,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -50,9 +49,9 @@ public function mvcModelDelete(DatabaseTester $I)
{
$I->wantToTest('Mvc\Model - delete()');

$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');
$invoice = new Invoices();
$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');
$invoice = new Invoices();
$invoice->inv_id = 1;
$invoice->inv_cst_id = 2;
$invoice->inv_status_flag = 3;
@@ -38,7 +38,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new ObjectsMigration($connection);
$migration = new ObjectsMigration($connection);
$migration->clear();
}

@@ -54,7 +54,7 @@ public function mvcModelFind(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new ObjectsMigration($connection);
$migration = new ObjectsMigration($connection);
$migration->insert(1, 'random data', 1);

$data = Objects::find();
@@ -81,7 +81,7 @@ public function mvcModelFindWithCache(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new ObjectsMigration($connection);
$migration = new ObjectsMigration($connection);
$migration->insert(1, 'random data', 1);

$options = [
@@ -35,7 +35,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -52,7 +52,7 @@ public function mvcModelGetEventsManager(DatabaseTester $I)
$title = uniqid('inv-');
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->insert(4, null, 0, $title);

$invoice = Invoices::findFirst();
@@ -17,8 +17,7 @@
use Phalcon\Test\Fixtures\Migrations\InvoicesMigration;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Models\Invoices;
use Phalcon\Test\Models\Personas;
use function date;

use function uniqid;

class RefreshCest
@@ -32,7 +31,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -46,7 +45,7 @@ public function mvcModelRefresh(DatabaseTester $I)
$title = uniqid('inv-');
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->insert(4, null, 0, $title);

$invoice = Invoices::findFirst();
@@ -37,7 +37,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -51,9 +51,9 @@ public function mvcModelSerialize(DatabaseTester $I)
{
$I->wantToTest('Mvc\Model - serialize()');

$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');
$data = [
$title = uniqid('inv-');
$date = date('Y-m-d H:i:s');
$data = [
'inv_id' => 1,
'inv_cst_id' => 2,
'inv_status_flag' => 3,
@@ -35,7 +35,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -52,7 +52,7 @@ public function paginatorAdapterModelConstruct(DatabaseTester $I)
$title = uniqid('inv-');
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->insert(4, null, 0, $title);

$paginator = new Model(
@@ -21,8 +21,6 @@
use Phalcon\Test\Fixtures\Traits\RecordsTrait;
use Phalcon\Test\Models\Invoices;

use function uniqid;

class PaginateCest
{
use DiTrait;
@@ -35,15 +33,15 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

public function paginatorAdapterModelPaginate(DatabaseTester $I)
{
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$this->insertDataInvoices($migration, 17, 2, 'ccc');
$this->insertDataInvoices($migration, 11, 3, 'aaa');
$this->insertDataInvoices($migration, 31, 1, 'aaa');
@@ -96,7 +94,7 @@ public function paginatorAdapterModelPaginateBind(DatabaseTester $I)
{
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$this->insertDataInvoices($migration, 17, 2, 'ccc');
$this->insertDataInvoices($migration, 11, 3, 'aaa');
$this->insertDataInvoices($migration, 31, 1, 'aaa');
@@ -137,7 +135,7 @@ public function paginatorAdapterModelPaginateParametersString(DatabaseTester $I)
{
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$this->insertDataInvoices($migration, 17, 2, 'ccc');
$this->insertDataInvoices($migration, 11, 3, 'aaa');
$this->insertDataInvoices($migration, 31, 1, 'aaa');
@@ -169,7 +167,7 @@ public function paginatorAdapterModelPaginateParametersArrayString(DatabaseTeste
{
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$this->insertDataInvoices($migration, 17, 2, 'ccc');
$this->insertDataInvoices($migration, 11, 3, 'aaa');
$this->insertDataInvoices($migration, 31, 1, 'aaa');
@@ -179,7 +177,7 @@ public function paginatorAdapterModelPaginateParametersArrayString(DatabaseTeste
[
'model' => Invoices::class,
'parameters' => [
'inv_cst_id >= 2'
'inv_cst_id >= 2',
],
'limit' => 5,
'page' => 1,
@@ -198,5 +196,4 @@ public function paginatorAdapterModelPaginateParametersArrayString(DatabaseTeste
$I->assertEquals(5, $page->getLimit());
$I->assertEquals(1, $page->getCurrent());
}

}
@@ -15,12 +15,10 @@

use DatabaseTester;
use Phalcon\Paginator\Adapter\Model;
use Phalcon\Paginator\Repository;
use Phalcon\Test\Fixtures\Migrations\InvoicesMigration;
use Phalcon\Test\Fixtures\Traits\DiTrait;
use Phalcon\Test\Fixtures\Traits\RecordsTrait;
use Phalcon\Test\Models\Invoices;
use Phalcon\Test\Models\Personnes;

/**
* Class SetGetLimitCest
@@ -37,7 +35,7 @@ public function _before(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -53,7 +51,7 @@ public function paginatorAdapterModelGetLimit(DatabaseTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$this->insertDataInvoices($migration, 17, 2, 'ccc');
$this->insertDataInvoices($migration, 11, 3, 'aaa');
$this->insertDataInvoices($migration, 31, 1, 'aaa');
@@ -56,7 +56,7 @@ function () {
function ($event, $dispatcher, $exception) {
$dispatcher->forward(
[
'namespace' => 'Phalcon\Test\Controllers',
'namespace' => 'Phalcon\Test\Controllers',
'controller' => 'exception',
'action' => 'second',
]
@@ -36,7 +36,7 @@ public function _before(IntegrationTester $I)

/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->clear();
}

@@ -53,7 +53,7 @@ public function mvcModelFindFirst(IntegrationTester $I)
$title = uniqid('inv-');
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->insert(4, null, 0, $title);

$invoice = Invoices::findFirst();
@@ -128,7 +128,7 @@ public function mvcModelFindFirstExtended(IntegrationTester $I)
$title = uniqid('inv-');
/** @var PDO $connection */
$connection = $I->getConnection();
$migration = new InvoicesMigration($connection);
$migration = new InvoicesMigration($connection);
$migration->insert(4, null, 0, $title);

$invoice = InvoicesExtended::findFirst(4);

0 comments on commit 07d9f1e

Please sign in to comment.