-
-
Notifications
You must be signed in to change notification settings - Fork 339
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 #751 from phalcon/3.1.x
3.1.1
- Loading branch information
Showing
16 changed files
with
656 additions
and
44 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
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
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
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 |
---|---|---|
|
@@ -3,13 +3,13 @@ | |
"type": "library", | ||
"description": "Adapters, prototypes or functionality that can be potentially incorporated to the C-framework.", | ||
"keywords": ["framework", "phalcon", "incubator"], | ||
"homepage": "http://phalconphp.com", | ||
"homepage": "https://phalconphp.com", | ||
"license": "BSD-3-Clause", | ||
"authors": [ | ||
{ | ||
"name": "Phalcon Team", | ||
"email": "[email protected]", | ||
"homepage": "http://phalconphp.com/en/team" | ||
"homepage": "https://phalconphp.com/en/team" | ||
}, | ||
{ | ||
"name": "Contributors", | ||
|
@@ -23,13 +23,13 @@ | |
}, | ||
"require": { | ||
"php": ">=5.5", | ||
"ext-phalcon": "^3.0", | ||
"ext-phalcon": "^3.1", | ||
"swiftmailer/swiftmailer": "~5.2" | ||
}, | ||
"require-dev": { | ||
"phpdocumentor/reflection-docblock": "2.0.4", | ||
"phpunit/phpunit": "^4.8", | ||
"squizlabs/php_codesniffer": "^2.7", | ||
"squizlabs/php_codesniffer": "^2.8", | ||
"codeception/codeception": "^2.2", | ||
"codeception/mockery-module": "^0.2", | ||
"codeception/aerospike-module": "^1.0", | ||
|
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 | ||
|
||
namespace Phalcon\Test\Collections; | ||
|
||
use Phalcon\Mvc\MongoCollection; | ||
|
||
/** | ||
* Robots Collection | ||
* | ||
* @method static Robots[] find(array $parameters = null) | ||
* @method static Robots findFirst(array $parameters = null) | ||
* | ||
* @property \MongoId _id | ||
* @property string name | ||
* @property string type | ||
* @property int year | ||
* @property string datetime | ||
* @property string deleted | ||
* @property string text | ||
* | ||
* @package Phalcon\Test\Collections | ||
*/ | ||
class Robots extends MongoCollection | ||
{ | ||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace Phalcon\Test\Collections; | ||
|
||
use Phalcon\Mvc\MongoCollection; | ||
use Phalcon\Validation; | ||
use Phalcon\Validation\Validator\Email; | ||
use Phalcon\Validation\Validator\ExclusionIn; | ||
use Phalcon\Validation\Validator\InclusionIn; | ||
use Phalcon\Validation\Validator\PresenceOf; | ||
use Phalcon\Validation\Validator\Regex; | ||
use Phalcon\Validation\Validator\StringLength; | ||
use Phalcon\Validation\Validator\Uniqueness; | ||
|
||
class Users extends MongoCollection | ||
{ | ||
public function validation() | ||
{ | ||
$validator = new Validation(); | ||
$validator | ||
->add('created_at', new PresenceOf()) | ||
|
||
->add('email', new StringLength(['min' => '7', 'max' => '50'])) | ||
->add('email', new Email()) | ||
->add('email', new Uniqueness()) | ||
|
||
->add('status', new ExclusionIn(['domain' => ['P', 'I', 'w']])) | ||
->add('status', new InclusionIn(['domain' => ['A', 'y', 'Z']])) | ||
->add('status', new Regex(['pattern' => '/[A-Z]/'])); | ||
|
||
return $this->validate($validator); | ||
} | ||
} |
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,38 @@ | ||
<?php | ||
|
||
namespace Helper; | ||
|
||
use Codeception\Actor; | ||
use Phalcon\Mvc\Collection\Manager; | ||
use Phalcon\Db\Adapter\MongoDB\Client; | ||
use Phalcon\Di; | ||
|
||
/** | ||
* Collection Initializer | ||
* | ||
* @package Helper | ||
*/ | ||
trait CollectionTrait | ||
{ | ||
/** | ||
* Executed before each test | ||
*/ | ||
protected function setupMongo(Actor $I) | ||
{ | ||
if (!extension_loaded('mongodb')) { | ||
$I->markTestSkipped('mongodb extension not loaded'); | ||
} | ||
|
||
Di::reset(); | ||
|
||
$di = new Di(); | ||
$di->set('mongo', function() { | ||
$dsn = 'mongodb://' . env('TEST_MONGODB_HOST', '127.0.0.1') . ':' . env('TEST_MONGODB_PORT', 27017); | ||
$mongo = new Client($dsn); | ||
|
||
return $mongo->selectDatabase(env('TEST_MONGODB_NAME', 'incubator')); | ||
}); | ||
|
||
$di->set('collectionManager', Manager::class); | ||
} | ||
} |
Oops, something went wrong.