Commit Graph

8965 Commits

Author SHA1 Message Date
Elvira Sheina
0df8020dd0 Fix for #13485 2017-02-01 13:20:32 +01:00
Carsten Brandt
603c422938 resort changelog 2017-01-31 14:25:00 +01:00
Carsten Brandt
1531e19969 fixed misplaced CHANGELOG lines 2017-01-31 14:09:01 +01:00
Alexander Makarov
2c5ab1e07b Used non-regex solution for trimming slashes 2017-01-31 13:42:38 +01:00
Alexander Makarov
f9e83008f4 Prefer strpos to substr 2017-01-31 13:42:37 +01:00
ErickSkrauch
c641513583 Implementation of support UrlRule with relative host definition
close #12697
fixes #12691
2017-01-31 13:42:31 +01:00
Carsten Brandt
1e4484748b Merge pull request #13477 from yiisoft/urlmanager-test
Refactored UrlManagerTest to cover more use cases
2017-01-31 11:54:03 +01:00
Elvira Sheina
d39c491022 Fix BC breaking #13475 (#13478) 2017-01-31 11:56:46 +03:00
Carsten Brandt
8faedcbd7c Refactored UrlManagerTest to cover more use cases
UrlManager is a complex class with a large bunch of options that needs
to be tested
and we had a few regressions in the past even though there are already a
lot of tests
covering it. Test coverage measured by lines does not help us determine
how good it is tested,
we need test coverage for every major path through the code.

I have refactored the UrlManager tests to reflect the different options
and cases to
have a better overview of which cases are covered and which are not.

UrlManager has two main operation modes:

- "default" url format, which is the simple case. These are covered by
  methods in `UrlManagerTest`.

- "pretty" url format. This is the complex case, which involves UrlRules
  and url parsing.
  I have created two separate classes for this case:
  Url creation for "pretty" url format is covered by
`UrlManagerCreateUrlTest`.
  Url parsing for "pretty" url format is covered by
`UrlManagerParseUrlTest`.

Each of the test classes have a `getUrlManager` method that creates a
UrlManager instance
with a specific configuration and certain variations in options.
It is also tested that options that are not relevant in a certain
operation mode have no effect on the result.

To make sure to not remove tests that have existed before, here is a map
of where code has been moved.
The following test methods existed in the [old test
class](4187718c14/tests/framework/web/UrlManagerTest.php):

- `testCreateUrl()` split between UrlManagerTest and
  UrlManagerCreateUrlTest variations should all be covered by
`variationsProvider()`.
- `testCreateUrlWithNullParams()` covered by UrlManagerCreateUrlTest by
  `testWithNullParams()`
- `testCreateUrlWithEmptyPattern()`
- `testCreateAbsoluteUrl()` covered in UrlManagerCreateUrlTest by new
  tests via `variationsProvider()`.
- `testCreateAbsoluteUrlWithSuffix()` covered in UrlManagerCreateUrlTest
  by `testAbsolutePatterns`.

- `testParseRequest()` covered by UrlManagerParseUrlTest, UrlNormalizer
  related parts moved to UrlNormalizerTest.
- `testParseRESTRequest()` moved to UrlManagerParseUrlTest
- `testHash()` covered in different tests in UrlManagerCreateUrlTest.
- `testMultipleHostsRules($host)` kept as is.

Before:

    $ vendor/bin/phpunit tests/framework/web/UrlManagerTest.php
    ...
    OK (12 tests, 89 assertions)

After:

    $ vendor/bin/phpunit tests/framework/web/UrlManager*.php
    ...
    OK (72 tests, 648 assertions)
2017-01-31 02:38:35 +01:00
Brandon Kelly
5609e918de Fixed some malformed @var tags (#13468) [skip ci] 2017-01-30 11:42:52 +03:00
PowerGamer1
37b8cbb2d0 Fixes #12758: Added the ability to use instances of \yii\db\Query class as values in the \yii\db\QueryBuilder::insert() method 2017-01-29 00:54:46 +03:00
voroks
25f08afc96 Fixes #8293: yii\db\Query can be passed to insert method in yii\db\QueryBuilder 2017-01-28 23:47:26 +03:00
Elvira Sheina
240bca515a Use low-level query in UniqueValidator (#13461)
Fixes #13453, relates to #13098
2017-01-28 18:38:06 +03:00
Alexander Makarov
920877c815 Fixed WidgetEvent construction 2017-01-28 11:55:24 +03:00
user57376
7c1693479f Fixes #12000: Added EVENT_INIT to widget 2017-01-28 01:27:05 +03:00
Alexander Makarov
767400da19 Fixes for #13457 as commented by @cebe 2017-01-28 01:22:48 +03:00
Alexander Makarov
bede9feba5 Fixes #13453: Reverted #10896 commit 729ddc5b76
It was causing side effects: https://github.com/yiisoft/yii2/issues/13453
2017-01-28 01:16:14 +03:00
Dmitriy Bashkarev
be4ebdd049 Fixes #13134: Added logging URL rules (bashkarev) 2017-01-27 19:03:45 +03:00
Alexander Makarov
f20c0177af Fixes #7435: Added EVENT_BEFORE_RUN, EVENT_AFTER_RUN and corresponding methods to yii\base\Widget 2017-01-27 18:56:22 +03:00
Alexey Rogachev
37f19a0256 Fixes #13300, #13307, #13310, #13312
- Bug #13300: Allow pjax with "data-pjax" with no value in `yii.js`.
- Bug #13307: Preventing of race conditions in script filter in `yii.js` works incorrectly.
- Bug #13310: Handle relative and absolute URLs coincidence in CSS filter in `yii.js`.
- Bug #13312: `skipOuterContainers` option was incorrectly passed to pjax in `handleAction` in `yii.js`.
- Partially fixes #13299.

Adds tests for #8014, #11921, #10974, #11494, #10358, #10097.
2017-01-25 11:00:13 +03:00
Yuriy Stovbur
d35d957ac6 fix pr in changelog 2017-01-24 13:48:55 +00:00
Yuriy Stovbur
4d7658ed71 Merge branch 'master' of git://github.com/yiisoft/yii2 into 13425-fix-url-rules-cache 2017-01-24 13:13:09 +00:00
Revin Roman
d3bde96852 Fix Russian messages (#13438) [skip ci] 2017-01-24 15:03:31 +03:00
Alexander Makarov
c8e467f919 Removed changelog entry for reverted #13393 2017-01-24 14:03:41 +03:00
Alexander Makarov
eab3489ec7 Reverted #13393: Removed redundant call to yii\helpers\Url::to() in yii\web\Controller::redirect() (reverted from commit e5d169beb8) 2017-01-24 13:09:57 +03:00
Yuriy Stovbur
69ab2bbeca Merge branch 'master' of git://github.com/yiisoft/yii2 into 13425-fix-url-rules-cache 2017-01-24 08:42:27 +00:00
Carsten Brandt
73f61b4f6b Update UPGRADE.md 2017-01-23 18:56:32 +01:00
Yuriy Stovbur
b2267b8442 Merge branch 'master' of git://github.com/yiisoft/yii2 into 13425-fix-url-rules-cache
Modify URL Rules caching #13425
2017-01-23 17:43:10 +00:00
Yuriy Stovbur
46e7faddd0 Modify URL Rules caching #13425 2017-01-23 17:42:23 +00:00
Klimov Paul
c73de31a90 Fixed yii\web\MultipartFormDataParser adds an extra newline to every value 2017-01-23 13:18:31 +02:00
Alexander Makarov
3f4771b1de Phpdoc adjustments [skip ci] 2017-01-23 12:42:35 +03:00
Alexander Makarov
cc37cd626f Fixes #12599: Fixed MSSQL fail to work with nvarbinary. Enhanced SQL scripts compatibility with older versions 2017-01-23 10:31:52 +03:00
Robert Korulczyk
507cc52658 Allow omit default params on URL creation
Fixes #10970
2017-01-22 22:19:13 +02:00
Yuriy Stovbur
307252a447 Merge branch 'master' of git://github.com/yiisoft/yii2 into 13425-fix-url-rules-cache
Cache dynamically added rules with `yii\web\UrlManager::addRules()`
2017-01-22 17:34:31 +00:00
Yuriy Stovbur
6de6e0f895 Cache dynamically added rules with yii\web\UrlManager::addRules() #13425 2017-01-22 17:33:59 +00:00
Andrew Nester
21faee5504 Fixes #13212: Fixed DbSession::regenerateID() failure when session_regenerate_id() fails 2017-01-22 20:15:36 +03:00
Elvira Sheina
b82caa97e8 Fixes #7820: Add or relation for targetAttribute in yii\validators\UniqueValidator 2017-01-22 19:45:18 +03:00
Vladimir Kuprienko
e5d169beb8 Fixes #13393: Removed redundant call to yii\helpers\Url::to() in yii\web\Controller::redirect() 2017-01-22 11:56:52 +03:00
Leandro Gehlen
736cd7bc80 Fixes #13417: Allow customizing yii\data\ActiveDataProvider in yii\rest\IndexAction 2017-01-22 11:46:47 +03:00
Dmitry Naumenko
28325f2e0d Update BaseYii.php 2017-01-21 12:30:07 +02:00
Maksim Pestov
e6424b190e Append phpdoc for log methods 2017-01-21 12:15:21 +04:00
Alexander Makarov
97171a0db7 Fixes #13401: Fixed lack of escaping of request dump at exception screens 2017-01-18 01:05:50 +03:00
Klimov Paul
862a5dd6b7 Added support for field yii\console\controllers\BaseMigrateController::$migrationNamespaces setup from CLI 2017-01-16 16:48:44 +02:00
Alexander Makarov
913b51b0b9 Adjusted changelog
See 3692941ead (commitcomment-20490835)
2017-01-16 17:40:41 +03:00
Carsten Brandt
c1c11d06ae Revert "Fixed some comment issues (#13392) [skip ci]"
This reverts commit 652d05f0b8.

`@property` comments are used to document the property that is
defined by a getter/setter if the method description does not fit.
2017-01-16 00:00:29 +01:00
João Pedro Pereira
3692941ead Fixes #11464: Foreign key name is not provided by schema 2017-01-16 00:27:20 +03:00
Alexander Makarov
3f66f1907f Removed unused method 2017-01-16 00:08:28 +03:00
Alexander Makarov
ebe30bd5ee Exposed number normalization as StringHelper::normalizeNumber() 2017-01-15 22:46:25 +03:00
Alexander Makarov
eee7b9663c Merge branch 'master' into fix-numbervalidator-comma-decimal-separator 2017-01-15 22:41:09 +03:00
Tetyuev Pavel
3a1cd7f3aa Fixes #13287: Fixed translating "and" separator in UniqueValidator error message 2017-01-15 22:05:45 +03:00