-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Confirmed valid traits; Paginator db tests; New models
- Loading branch information
Showing
61 changed files
with
1,127 additions
and
978 deletions.
There are no files selected for viewing
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
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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
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,77 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon\Test\Fixtures\Traits; | ||
|
||
use DatabaseTester; | ||
use PDO; | ||
use Phalcon\Annotations\Adapter\Memory as AnnotationsMemory; | ||
use Phalcon\Cache\Adapter\Libmemcached as StorageLibmemcached; | ||
use Phalcon\Cache\Adapter\Stream as StorageStream; | ||
use Phalcon\Cli\Console as CliConsole; | ||
use Phalcon\Crypt; | ||
use Phalcon\Db\Adapter\PdoFactory; | ||
use Phalcon\Di; | ||
use Phalcon\Di\DiInterface; | ||
use Phalcon\Di\FactoryDefault; | ||
use Phalcon\Di\FactoryDefault\Cli as CliFactoryDefault; | ||
use Phalcon\Escaper; | ||
use Phalcon\Events\Manager as EventsManager; | ||
use Phalcon\Filter; | ||
use Phalcon\Http\Request; | ||
use Phalcon\Http\Response; | ||
use Phalcon\Mvc\Model\Manager as ModelsManager; | ||
use Phalcon\Mvc\Model\Metadata\Memory as MetadataMemory; | ||
use Phalcon\Mvc\View; | ||
use Phalcon\Mvc\View\Simple; | ||
use Phalcon\Session\Adapter\Libmemcached as SessionLibmemcached; | ||
use Phalcon\Session\Adapter\Noop as SessionNoop; | ||
use Phalcon\Session\Adapter\Redis as SessionRedis; | ||
use Phalcon\Session\Adapter\Stream as SessionFiles; | ||
use Phalcon\Session\Manager as SessionManager; | ||
use Phalcon\Storage\SerializerFactory; | ||
use Phalcon\Test\Fixtures\Migrations\InvoicesMigration; | ||
use Phalcon\Url; | ||
use function dataDir; | ||
use function getOptionsLibmemcached; | ||
use function getOptionsMysql; | ||
use function getOptionsPostgresql; | ||
use function getOptionsRedis; | ||
use function getOptionsSqlite; | ||
use function uniqid; | ||
|
||
trait RecordsTrait | ||
{ | ||
/** | ||
* @param InvoicesMigration $migration | ||
* @param int $count | ||
* @param int $custId | ||
* @param string $prefix | ||
*/ | ||
private function insertDataInvoices( | ||
InvoicesMigration $migration, | ||
int $count, | ||
int $custId, | ||
string $prefix | ||
) { | ||
$title = uniqid($prefix . '-'); | ||
for ($counter = 1; $counter <= $count; $counter++) { | ||
$migration->insert( | ||
null, | ||
$custId, | ||
1, | ||
$title | ||
); | ||
} | ||
} | ||
} |
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Phalcon\Test\Models; | ||
|
||
use Phalcon\Mvc\Model; | ||
|
||
/** | ||
* Class InvoicesMap | ||
* | ||
* @property int $inv_id | ||
* @property int $inv_cst_id | ||
* @property int $inv_status_flag | ||
* @property string $inv_title | ||
* @property float $inv_total | ||
* @property string $inv_created_at | ||
*/ | ||
class InvoicesMap extends Model | ||
{ | ||
public $inv_id; | ||
public $inv_cst_id; | ||
public $inv_status_flag; | ||
public $inv_title; | ||
public $inv_total; | ||
public $inv_created_at; | ||
|
||
public function initialize() | ||
{ | ||
$this->setSource('co_invoices'); | ||
} | ||
|
||
public function columnMap() | ||
{ | ||
return [ | ||
'inv_id' => 'id', | ||
'inv_cst_id' => 'cst_id', | ||
'inv_status_flag' => 'status_flag', | ||
'inv_title' => 'title', | ||
'inv_total' => 'total', | ||
'inv_created_at' => 'created_at', | ||
]; | ||
} | ||
} |
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,56 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Phalcon Framework. | ||
* | ||
* (c) Phalcon Team <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Phalcon\Test\Database\Mvc\Model; | ||
|
||
use DatabaseTester; | ||
use Phalcon\Mvc\Model; | ||
use Phalcon\Mvc\ModelInterface; | ||
use Phalcon\Test\Fixtures\Traits\DiTrait; | ||
use Phalcon\Test\Models\Invoices; | ||
|
||
/** | ||
* Class ConstructCest | ||
*/ | ||
class ConstructCest | ||
{ | ||
use DiTrait; | ||
|
||
public function _before(DatabaseTester $I) | ||
{ | ||
$this->setNewFactoryDefault(); | ||
$this->setDatabase($I); | ||
} | ||
|
||
/** | ||
* Tests Phalcon\Mvc\Model :: __construct() | ||
* | ||
* @author Phalcon Team <[email protected]> | ||
* @since 2018-11-13 | ||
*/ | ||
public function mvcModelConstruct(DatabaseTester $I) | ||
{ | ||
$I->wantToTest('Mvc\Model - __construct()'); | ||
|
||
$invoice = new Invoices(); | ||
|
||
$I->assertInstanceOf( | ||
Model::class, | ||
$invoice | ||
); | ||
$I->assertInstanceOf( | ||
ModelInterface::class, | ||
$invoice | ||
); | ||
} | ||
} |
Oops, something went wrong.