Commit Graph

698 Commits

Author SHA1 Message Date
SilverFire - Dmitry Naumenko
e9a96ee834 Replced InvalidParamException with \yii\console\Exception in Request::resolve() 2017-02-21 08:24:15 +02:00
SilverFire - Dmitry Naumenko
86b08e29d2 Enhanced yii\console\Request::resolve() to prevent passing parameters, that begin from digits
Closes #8641
2017-02-20 23:17:40 +02:00
SilverFire - Dmitry Naumenko
f496567735 Fixed yii\web\CacheSession::destroySession() to work correctly when session is not written yet
Fixes #13537
2017-02-20 22:34:40 +02:00
Bob Olde Hampsink
fab53b4a6e Fixes #13582: Added tests for all yii\db\QueryBuilder::resetSequence implementations, fixed SQLite implementation 2017-02-20 23:04:04 +03:00
Bob Olde Hampsink
56c65f6079 Fixes #13577: Implemented yii\db\mssql\QueryBuilder::resetSequence() 2017-02-20 14:54:33 +03:00
Nikolay Oleynikov
7d82bbcd37 Fixes #13467: yii\data\ActiveDataProvider no longer queries models if models count is zero 2017-02-20 12:00:00 +03:00
Dmitry Klyukin
ecd2dc0d1b Model loadMultiple test (#13585) 2017-02-19 20:40:45 +03:00
Nikolay Oleynikov
323568c2e9 Remove trailing spaces from sources and tests (#13621) [skip ci] 2017-02-19 17:34:22 +03:00
Sergey Makinen
ef4dadf437 Fixes #13592: Fixes Oracle’s yii\db\oci\Schema::setTransactionIsolationLevel() 2017-02-19 17:32:51 +03:00
Nikolay Oleynikov
e8f8ba2129 Remove excessive use statement (#13604) 2017-02-18 21:56:56 +03:00
Dmitry Naumenko
569bc89eaf Merge pull request #13340 from Vovan-VE/usemaster-improve
Exception within useMaster() completely disables slaves
2017-02-18 18:12:13 +02:00
Boudewijn Vahrmeijer
45d670c995 Update ConnectionTest.php 2017-02-18 15:49:24 +01:00
Nikolay Oleynikov
a26d28f8e3 Fixes #13576: Added support of srcset to yii\helpers\Html::img() 2017-02-18 02:23:20 +03:00
Carsten Brandt
22972b86db update date formatter test for intl
some tests where not run with intl extension enabled.
2017-02-16 16:20:07 +01:00
Bizley
54278fc842 asTime fixed for time-only values
close #13348
fixes #13343
2017-02-16 16:07:52 +01:00
Elvira Sheina
3a4505ac08 Fixes #11230: Include defaultRoles in yii\rbac\DbManager->getRolesByUser() results 2017-02-15 01:26:33 +03:00
Vovan-VE
3538bde085 Add test case for #13340 and update CHANGELOG 2017-02-10 11:24:20 +08:00
Paul Klimov
95b7ffc066 Fix #13278: DbQueryDependency created (#13384)
`DbQueryDependency` created
2017-02-09 12:30:53 +02:00
Carsten Brandt
e82b40abee avoid duplicate slashes on empty values
fixes #13522
close #13525
2017-02-08 09:41:04 +01:00
Carsten Brandt
456d23272c added failing test for #13522
regression after 2.0.11 release.
2017-02-08 09:40:53 +01:00
Carsten Brandt
fba4e43469 added failing test for #13533
issue #13533
PR #13534
2017-02-08 09:10:19 +01:00
Robert Korulczyk
4c46c6a096 Improve messages test on HHVM. (#13520) 2017-02-06 09:54:13 +01:00
Carsten Brandt
25b78aa615 Fixes #13508: Fixed duplicate attachment of behavior BC break
Fixes BC break introduced in
954c771fdb (diff-d45d5e14cbb9739c2e1c63b53ba5e363L669)
2017-02-04 15:47:04 +03:00
Bizley
1749c46c5d Fixes #11502: Fixed yii\console\controllers\MessageController to properly populate missing languages in case of extraction with "db" format 2017-02-02 02:50:34 +03:00
Carsten Brandt
a7f8d0efb4 added test for #12697 2017-01-31 13:42:38 +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
Carsten Brandt
4187718c14 added missing groups to tests 2017-01-30 23:03:11 +01: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
Alexander Makarov
c4175be7a3 Adjusted command test for incorrect inserts to use data provider 2017-01-29 00:22:10 +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
Alexander Makarov
1cc327f108 Run common batch insert tests for SQLite 2017-01-28 14:41:57 +03:00
Dmitriy Bashkarev
be4ebdd049 Fixes #13134: Added logging URL rules (bashkarev) 2017-01-27 19:03:45 +03:00
Herbert Maschke
d4d6c1dabf Tests for 13393 (#13439)
* add some unit tests regarding redirection for ResponseTest

* also tests yii\web\controller redirect
2017-01-24 16:58:01 +03:00
Herbert Maschke
a6da9d5da8 Added unit tests regarding redirection for ResponseTest (#13437) 2017-01-24 15:05:28 +03:00
Klimov Paul
c73de31a90 Fixed yii\web\MultipartFormDataParser adds an extra newline to every value 2017-01-23 13:18:31 +02:00
Robert Korulczyk
507cc52658 Allow omit default params on URL creation
Fixes #10970
2017-01-22 22:19:13 +02:00
Elvira Sheina
b82caa97e8 Fixes #7820: Add or relation for targetAttribute in yii\validators\UniqueValidator 2017-01-22 19:45:18 +03:00
SilverFire - Dmitry Naumenko
3d549374bf Added BlameableBehaviorTest 2017-01-22 16:21:53 +02: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
eee7b9663c Merge branch 'master' into fix-numbervalidator-comma-decimal-separator 2017-01-15 22:41:09 +03:00
Klimov Paul
d4ac47abe7 Added yii\validators\EachValidator::$stopOnFirstError allowing addition of more than one error 2017-01-13 17:59:10 +02:00
Klimov Paul
b93856cdfd Unit test for yii\caching\DbDependency added 2017-01-13 12:16:37 +02:00
Klimov Paul
3946ac0dab Added yii\widgets\InputWidget::$field field, allowing access to the related yii\widget\ActiveField instance 2017-01-13 11:36:33 +02:00
Robert Korulczyk
6d277ddafb Tests for create URLs with multiple domain rules. (#13351) 2017-01-08 21:58:33 +03:00
a.kompaniets
50f3012f68 fixed currency format with custom decimal fraction
fixes #12345
close #12648
2017-01-03 00:03:40 +01:00
Carsten Brandt
a51dadc866 added test for #12345 2017-01-03 00:03:40 +01:00
Vladimir
f3bc11c724 Implement #13219: Ability to not shuffle masters connections (#13241)
* Implement #13219: Ability to not shuffle masters connections

* Enh: add master connection getter

* Add test case for #13241 which implements #13219

* Doc comments [skip ci]

* Doc comments

* Fix: wrong return value when no masters

* Revert `getMasterPdo()` 4a786c7e10

* Fix: try to fix too slow test

* Refact: fix Single Responsibility; Fix possible BC break

* Update Connection.php

* Update Connection.php

* Update Connection.php

* Update Connection.php

* Updated CHANGELOG

* Fix: grammatic mistake

* Refact: property renamed from `randomizeMasters` to `shuffleMasters`

* Refact: split and try to simplify tests
2017-01-02 02:15:13 +01:00