Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Console "extract i18n from sources" to handle quotes in Model::va…
…lidate parameters correctly
- Loading branch information
joostdekeijzer
committed
Jan 29, 2014
1 parent
9b4c2f3
commit 42daa25
Showing
3 changed files
with
49 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* Test App Extract Model | ||
* | ||
* CakePHP : Rapid Development Framework (http://cakephp.org) | ||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://cakephp.org CakePHP Project | ||
* @package Cake.Test.TestApp.Model | ||
* @since CakePHP v 2.4 | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
|
||
/** | ||
* Class Extract | ||
* | ||
* For testing Console i18n validation message extraction with quotes | ||
* | ||
* @package Cake.Test.TestApp.Model | ||
*/ | ||
class Extract extends AppModel { | ||
|
||
public $useTable = false; | ||
|
||
public $validate = array( | ||
'title' => array( | ||
'custom' => array( | ||
'rule' => array('custom', '.*'), | ||
'allowEmpty' => true, | ||
'required' => false, | ||
'message' => 'double "quoted" validation' | ||
), | ||
'between' => array( | ||
'rule' => array('between', 5, 15), | ||
'message' => "single 'quoted' validation" | ||
) | ||
), | ||
); | ||
|
||
} |