* Refactor validateAttribute method in UniqueValidator
Extract prepareParams and prepareQuery from validateAttribute,
so they can be tested separately.
* Added issue number to changelog
* Eliminated unneeded variable
* Renamed methods and parameters, update PHPDocs
* Added JS tests for yii.captcha.js (#12840), fixes#13159
* Sinon needs to be imported in similar fashion in other test files
* Added according line to CHANGELOG [skip ci]
* Update CHANGELOG.md
* Try to run tests with default timeout in Travis
* Added note about JS tests to the docs [skip ci]
* Simplified tests for multiple elements (init, destroy methods)
* Closes#6242: Access to validator in inline validation
* Updated PHPDoc according to PR review [skip ci]
* Imrpoved PHPDoc, updated guide info [skip ci]
* Fixes related with PR review
* Corrected CHANGELOG [skip ci]
* Update input-validation.md
added version info
* refactores getQueryTableName:
* replaces the $query argument with a $this implementation
* exposes getQueryTableName to be public instead of private. Fixes#12878
* added unit tests for exposed method
* updated changelog
* - methodname changed to 'getTableNameAndAlias'
- scope back to private
- added @internal tag to emphasize that the method is used purely for the internal workings of this piece of software.
- removed changelog (as the API has not changed)
* update tests
Fixed inconsistency, `Yii::$app->controller` is available
after handling the request since 2.0.10, this is now also the case for
`Yii::$app->controller->action`.
fixes#12795
* Added the RadioButtonColumn class and updated the changelog.
* - several enhancements:
- unit tests added
- changelog fixed
* Update CHANGELOG.md
* small markdown fixes
* fix travis: custom ID
suggestion is based on two principles:
- first suggest commands the begin with the unknown name, to suggest
commands after accidentally hitting enter
- second find similar commands by computing the levenshtein distance
which is a measurement on how many changes need to be made to convert
one string into another. This is perfect for finding typos.
Added `QueryInterface::emulateExecution()`, which allows preventing of
the actual query execution.
This allows to cancel `DataProvider` preventing search query execution
in case search model is invalid:
``` php
public function search($params)
{
$query = Item::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
$query->where('0=1');
$query->emulateExecution(); // No SQL execution will be done
return $dataProvider;
}
```
This also fix unecessary query in case of `via()` usage. See #12390.
fixes#12390fixes#6373close#12708
fixes#12840
Used @nkovacs draft as starting
point(https://github.com/yiisoft/yii2/issues/11037#issuecomment-193356450).
I also fixed some bugs in `yii.validation.js` and did some refactoring.
Implemented tests:
- yii.validation.js
Running tests:
- Install Node.js. I used the latest version available at the moment -
`v7.1.0`. Note that used `jsdom` dependent library version requires
`Node.js >= 4`.
- Run `npm install` to install dependencies.
- Execute `npm test` for running tests.