Commit Graph

2875 Commits

Author SHA1 Message Date
Klimov Paul
a4bd0edeaa unit test for yii\base\Widget added 2017-09-01 17:10:32 +03:00
Klimov Paul
9e6f9e3b6d Fixed serialization of yii\db\Connection instance closes database connection 2017-09-01 13:30:56 +03:00
Carsten Brandt
431c1b01a7 added test case for merging empty arrays
issue #14617
2017-09-01 10:58:45 +02:00
Carsten Brandt
711498f93a Cache user assignments to avoid unnecessary DB queries (#14696)
* Cache user assignments to avoid unnecessary DB queries

alternative to #9138 and #10981, only cache on `checkAccess` call which is usually
called on every request. Cache is not necessary in RBAC management.

Similar to #14061 but includes proper cache invalidation and test.

`getAssignments()` always queries the DB. The cache is only applied on
`checkAccess` calls, and invalidated as soon as the RBAC structure is
modified through the manager component (verified by the test case).

Regarding [concerns of memory usage](https://github.com/yiisoft/yii2/pull/14061#issuecomment-297982502)
if used in batch mode on multiple users, you can call
`invalidateCache()` method if this really causes a problem.

fixes #7743
close #9138
close #14061
close #10981

See also
- https://github.com/yiisoft/yii2/issues/7626#issuecomment-77745166
- https://github.com/yiisoft/yii2/pull/14061#issuecomment-319645488

* improve test naming

* fix tests

* fix assignment cache for non-scalar user-ids
2017-09-01 10:50:36 +02:00
Carsten Brandt
f7942c0398 make cache test more robust 2017-09-01 10:03:30 +02:00
Kolyunya
f866edcfba Fix console cache controller
Fixed a bug in a `yii\console\controllers\CacheController` when caches
defined via a closure were not detected.

fixes #13969
close #14586
2017-09-01 09:34:56 +02:00
Paul Klimov
d68789a195 Fixes #13779, fixes #5786
- #13779: Fixed `yii\db\ActiveRecord::joinWith()` unable to use relation defined via attached behavior.
- #5786: Allowed to use custom constructors in ActiveRecord-based classes.
2017-08-29 15:13:28 +03:00
bscheshirwork
8987957f06 Fixes #14697: Fixed console\widgets\Table rendering when there's no data supplied 2017-08-28 01:27:54 +03:00
Robert Korulczyk
771a9faed2 Fixed invalid tests (#14716) 2017-08-24 17:26:20 +03:00
Sam
4081a4b203 Fixes #14184: Module service locator now falls back to its parent module service locator in case component isn't found 2017-08-23 00:38:39 +03:00
SilverFire - Dmitry Naumenko
0e2b6c41b8 Simplified API of Formatter::asWeight() and Formatter::asLength() methods 2017-08-21 13:10:19 +03:00
Robert Korulczyk
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
Robert Korulczyk
1501c659ac Add empty lines before return statements. (#14682) [skip ci] 2017-08-21 01:58:49 +03:00
Robert Korulczyk
0c0942d6e2 Enable phpdoc_add_missing_param_annotation rule in php-cs-fixer config. (#14681) [skip ci] 2017-08-21 01:57:23 +03:00
Robert Korulczyk
4d5aa9a6cf Fix self-ignored .gitignore files. 2017-08-20 13:39:06 +02:00
Herbert Maschke
58792cdac5 Fixes #14664: Add migrate/fresh command to truncate database and apply migrations again 2017-08-20 01:00:41 +03:00
Robert Korulczyk
9b118aafa0 Enable non_printable_character rule in php-cs-fixer config (#14667)
* Use "\u{00a0}" as nbsp.

* Enable non_printable_character rule.

* Fix test for PHP 5.
2017-08-18 13:59:57 +02:00
Robert Korulczyk
b99e955627 Fix CS (#14665)
* Run php-cs-fixer.

* Enable phpdoc_types rule.
2017-08-18 12:10:42 +02:00
Tomáš Votruba
7ad94a0107 [cs] remove unused use statements (#14661) [skip ci] 2017-08-18 01:24:43 +03:00
Alone
4b9d7a6bdd Fixes #14596: Fix event call on init in yii\widgets\BaseListView 2017-08-17 18:18:51 +03:00
Alexander Makarov
0ebff0a7ab Fixed ListView test to run properly on Windows 2017-08-17 17:34:41 +03:00
Sam
0017d9c660 Fixes #13780: Added support for trusted proxies in yii\web\Request 2017-08-17 13:14:51 +03:00
SilverFire - Dmitry Naumenko
87f988fe54 One more try to fix tests on Travis 2017-08-16 11:44:49 +03:00
SilverFire - Dmitry Naumenko
6424acf67f One more try to fix tests on Travis 2017-08-16 08:33:25 +03:00
SilverFire - Dmitry Naumenko
b9f582dbf3 Try to fix tests on Travis 2017-08-16 08:04:35 +03:00
SilverFire - Dmitry Naumenko
7c73b0b79d Enhanced tests, updated CHNAGELOG 2017-08-15 23:13:59 +03:00
SilverFire - Dmitry Naumenko
b577e302f7 Enhanced PHPDocs, added tests 2017-08-14 23:48:33 +03:00
SilverFire - Dmitry Naumenko
4028c69ed5 Merge branch 'master' into nineinchnick-9703-si-formatters
Conflicts:
	framework/i18n/Formatter.php
2017-08-14 22:55:45 +03:00
Carsten Brandt
3dbc07f8dd fix test to work around PDO bug
This test is failing on PHP 7.0.7 on travis but seems fine
on PHP 7.1.x > 7.1.0-alpha

See:

- cda3089623
- https://gist.github.com/cebe/badfec47a8c3fcc4ffcf1625ca8e0655
2017-08-14 12:33:11 +02:00
Alexander Makarov
e9fad56381 #14151: Added attribute name to AttributesBehavior callback signature
See 6ffa5fb087 (commitcomment-23630375)
2017-08-14 12:11:59 +03:00
Alexander Makarov
7cac7f131d Set back original locale in #14448 test 2017-08-14 02:34:23 +03:00
bscheshirwork
2b9b0c7166 Fixes #14151: Added AttributesBehavior that assigns values specified to one or multiple attributes of an AR object when certain events happen 2017-08-14 01:03:10 +03:00
Carsten Brandt
cda3089623 Fixed batchInsert casting of double values according to locale (#14448)
fixes #6526
2017-08-13 22:15:04 +02:00
SilverFire - Dmitry Naumenko
368540f8d0 Added tests 2017-08-13 21:15:06 +03:00
Alexander Makarov
648971a82b Fixes #14542: Ensured only ASCII characters are in CSRF cookie value since binary data causes issues with ModSecurity and some browsers 2017-08-07 13:55:10 +03:00
Alexander Makarov
6fdeba501d Adjusted tests after 1761a10c13 2017-08-04 00:51:27 +03:00
bscheshirwork
0c0cc1074d fix current time in formatter (#14203)
* fix current time in formatter

* expand testAsDatetime

* Update FormatterDateTest.php

* Update CHANGELOG.md
2017-08-03 10:20:37 +02:00
Bizley
d6578f83ba Codeclimate rules update (#13915) 2017-08-02 16:16:51 +03:00
Dmitry Dorogin
f7fb7cdd87 Fixes #14022: Added posibility to use aliases in yii\web\UrlManager::setBaseUrl() (#14540) 2017-07-31 13:32:08 +02:00
Dmitry Dorogin
e18e98ffb3 Fixes #14363: Added yii\widgets\LinkPager::$linkContainerOptions and possibility to override tag in yii\widgets\LinkPager::$options 2017-07-30 13:27:32 +03:00
Alexey Rogachev
8f2d9baf98 Fixes #14186, Fixes #14510: yiiActiveForm regressions
- #14186: Forced validation in `yiiActiveForm` do not trigger `afterValidate` event
- #14510: The state of a form is always "not validated" when using forced validation in `yiiActiveForm`
2017-07-29 14:37:29 +03:00
Michaël Arnauts
e472b4e29c Fixes #14525: Fixed 2.0.12 regression of loading of global fixtures trough yii fixture/load 2017-07-26 14:35:20 +03:00
Dmitry Dorogin
a731fd4142 Fixes #14318: Trigger yiiActiveForm.events.afterValidateAttribute after updating attribute 2017-07-24 23:25:47 +03:00
Dmitry Dorogin
d4ded67f69 Fixes #14513: Updated phpdoc and added tests for yii\rbac\ManagerInterface::assign and yii\rbac\ManagerInterface::revoke functions (#14528) 2017-07-24 23:20:03 +03:00
Dmitry Dorogin
1ee29c630d Fixes #14493: Fixed getting permissions in yii\rbac\Dbmanger::getPermissionsByUser by user with id equals 0 2017-07-24 18:42:40 +03:00
Dmitry Dorogin
e2ba94abd6 Fixes #7823: Added yii\filters\AjaxFilter filter 2017-07-24 17:25:16 +03:00
Klimov Paul
578b2caf42 Added yii\web\MultipartFormDataParser::$force option allowing to enforce parsing even on 'POST' request 2017-07-24 15:28:22 +03:00
Dmitry Dorogin
8ae2223c6a Fixes #14370: Fixed creating built-in validator in model with same function name 2017-07-23 17:17:20 +03:00
Robert Korulczyk
6782ad96f0 Reduce Segmentation fault errors for PHP 5.4 tests on travis. (#14092) 2017-07-21 21:29:40 +03:00
Dmitry Dorogin
6d2e0aff82 Fixes #14406: Fixed caching rules in yii\web\UrlManager with different ruleConfig configuration 2017-07-19 23:45:03 +03:00