Commit Graph

3198 Commits

Author SHA1 Message Date
Carsten Brandt
1d4eb072d3 readded comments to phpmd rules #13139 2016-12-05 22:01:05 +01:00
Bizley
5092c9666d Code Climate PHPMD settings (#13139)
* codeclimate phpmd rulesets

* PHPMD ruleset

* phpmd_ruleset moved

* Delete phpmd_ruleset.xml

* ruleset moved
2016-12-05 21:52:39 +01:00
SilverFire - Dmitry Naumenko
0261a5498f Simplified ListViewTest 2016-12-05 22:27:38 +02:00
SilverFire - Dmitry Naumenko
25eafa560e Merge branch '11627-document-and-test-empty-listview' of git://github.com/mytskine/yii2 into mytskine-11627-document-and-test-empty-listview
Conflicts:
	framework/widgets/BaseListView.php
	tests/framework/widgets/ListViewTest.php
2016-12-05 22:19:02 +02:00
Boudewijn Vahrmeijer
7dac3ed1ca Kirkhansen 9053 add radio button column (#13126)
* 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
2016-12-05 13:58:11 +01:00
Alexander Makarov
a056281fa0 Attempt to make tests pass on travis environment 2016-12-04 00:58:40 +03:00
Robert Korulczyk
35998449eb Add yii\filters\HostControl::$fallbackHostInfo (#13117) 2016-12-03 08:25:39 +02:00
Carsten Brandt
7fead4f011 Merge pull request #12959 from yiisoft/bash-completion
Added bash completion file for ./yii commands
2016-12-03 01:25:06 +01:00
Carsten Brandt
187c44e43e implement suggestion for unknown command in console application
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.
2016-12-03 01:17:50 +01:00
SilverFire - Dmitry Naumenko
4454d05410 Added ZSH completion, moved scripts to a separate directory 2016-12-03 00:36:40 +01:00
Carsten Brandt
beb140446b added test for helpcontroller list action 2016-12-03 00:36:40 +01:00
Carsten Brandt
612afdbc66 Merge pull request #13111 from yiisoft/js-tests
Making JS tests ready to go into master.
2016-12-02 22:35:35 +01:00
Alexander Makarov
e1b0cb4343 Merge branch 'master' into aria-required-and-aria-invalid-input-attributes 2016-12-02 23:38:55 +03:00
SilverFire - Dmitry Naumenko
437825be70 Implemented Container::setDependencies(), Container::setDefinitions
Closes #11758
Closes #13029
2016-12-02 15:08:24 +02:00
Klimov Paul
c17766181f Added QueryInterface::emulateExecution()
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 #12390
fixes #6373
close #12708
2016-12-02 13:28:51 +01:00
Alexander Makarov
ed8acc8e03 #12399 adjustments 2016-12-02 01:44:57 +03:00
a.kompaniets
fb779e3ec6 Fixes #12399: Added ActiveField::addAriaAttributes property for aria-required and aria-invalid attributes rendering 2016-12-02 01:44:34 +03:00
SG5
1141fc81a7 Fixes #12735: Fixed yii\console\controllers\MigrateController creating multiple primary keys for field bigPrimaryKey:unsigned 2016-12-02 01:03:24 +03:00
zalatov
deea3cf798 Fixes #12854: Added RangeNotSatisfiableHttpException to cover HTTP error 416 file request exceptions 2016-12-02 00:51:49 +03:00
Boudewijn Vahrmeijer
5784dd1dbf fix travis 2016-12-01 22:48:40 +01:00
Alexander Makarov
b17dfa03a2 Fixes #10488: Fixed incorrect behavior of yii\validation\NumberValidator when used with locales where decimal separator is comma 2016-12-02 00:04:55 +03:00
Vladimir Khramov
dd94ead358 Initial work on #10488 2016-12-02 00:01:51 +03:00
Boudewijn Vahrmeijer
9218adcec2 fixes after @samdark review 2016-12-01 15:34:03 +01:00
Boudewijn Vahrmeijer
7f537d684e Custom ID generation for Pjax widgets to solve unstable ajax calls (issue #12969)
Implements the solution proposed in the following comment:
https://github.com/yiisoft/yii2/pull/12977#issuecomment-260123078
2016-12-01 14:27:20 +01:00
Alexey Rogachev
8ea1f510af Implemented Javascript test suite
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.
2016-12-01 11:25:18 +01:00
Carsten Brandt
47ece37b5a Merge branch 'prepare-travis-for-js'
* prepare-travis-for-js:
  remove CUBRID env from travis it is unused
  Install APC on Ubuntu trusty
  Fix MySQL database setup for ubuntu trusty
  Switch travis OR from precise to trusty
2016-12-01 11:12:44 +01:00
Alexey Rogachev
e94ca4793b Install APC on Ubuntu trusty
Trusty does not have APC preinstalled (see
https://github.com/travis-ci/travis-ci/issues/5618,
https://github.com/travis-ci/travis-ci/issues/6853) so we need to
install it manually using PECL. `yes ''` allows to skip prompts and fill
it with default values.
2016-12-01 11:10:13 +01:00
Carsten Brandt
081ee7c5b1 Implemented shortcut methods for returning JSON and XML (#13101)
fixes #13036
2016-12-01 10:33:49 +01:00
Carsten Brandt
6782954c6a improved test coverage of HostFilter
PR #13063
2016-12-01 01:31:30 +01:00
Klimov Paul
7da77c3d5a created HostControl filter to prevent Host header attacks
fixes #13050
close #13063
2016-12-01 00:59:26 +01:00
Klimov Paul
18b0dab360 Fixed yii\console\controllers\AssetController::adjustCssUrl() breaks URL reference specification (url(#id)) 2016-11-29 10:24:39 +02:00
Robert Korulczyk
2d91723934 Add support for creating protocol-relative URLs.
Improve phpdoc for protocol-relative URL creation.
Remove useless `is_string()` check.
2016-11-29 09:53:51 +02:00
Tim Beks
f23dc5aee9 Add attribute to set the openlog $option attribute for SyslogTarget
Fixes issue #13074
close #13075
2016-11-29 00:00:24 +01:00
Fabian Peter Hammerle
46da2df98d yii\db\mysql\Schema::loadColumnSchema sets enumValues attribute incorrectly if enum definition contains comma
(i.e. "enum('a','B','c,D')" -> ['a','B','c','D'] instead of expected ['a','B','c,D'])
2016-11-29 00:21:44 +02:00
SilverFire - Dmitry Naumenko
63e650952b Updated tests for HtmlHelper::textarea() 2016-11-29 00:06:20 +02:00
Elvira Sheina
0545bb6936 Fixed truncateHtml leaving extra tags (#7727) 2016-11-28 20:29:20 +05:00
Alexey Rogachev
e705519c5a Fixes #13071: Help option for commands was not working in modules 2016-11-27 16:14:08 +03:00
yamaha252
22b2a78a0a Added test for unique validator with empty values
close #7007
2016-11-27 02:37:12 +01:00
Alexander Makarov
41b3f0db0b Fixed driver name in MSSQL test 2016-11-22 23:34:35 +03:00
Carsten Brandt
a837c59182 improved error message for Instance::ensure() when component does not exist (#12967)
fixes #7333
2016-11-22 17:49:55 +01:00
Boudewijn Vahrmeijer
aba42fce4d Squash merge rebased branch nadar-patch-4 2016-11-22 17:01:38 +01:00
Herbert Maschke
b58fee7d37 Fixes #13035: Use ArrayHelper::getValue() in SluggableBehavior::getValue() 2016-11-22 13:20:45 +03:00
Alexey Rogachev
6428fab406 Closes #9162: Added support of closures in value for attributes in yii\widgets\DetailView (#13013)
#9162: Added support of closures in `value` for attributes in `yii\widgets\DetailView`
2016-11-18 11:31:40 +03:00
Alexey Rogachev
ea251e24ba Closes #7420: Attributes for prompt generated with renderSelectOptions of \yii\helpers\Html helper 2016-11-17 16:43:19 +02:00
Carsten Brandt
059a80b47f renamed Cache::$ttl to Cache::$defaultDuration
better naming as discussed in #12990
2016-11-15 23:54:12 +01:00
Walt Sorensen
f76f0cff6c Test against the current hhvm version (#12971)
* Test against the current hhvm version

This provides the current HHVM version (3.15.2 as of this PR) and will track with each release (i.e. will be 3.16 when 3.16 is released.

If testing against HHVM LST versions is desired follow this guide. https://docs.travis-ci.com/user/languages/php#HHVM-versions

Should be able to change to container based Trusty after Q1-17 https://blog.travis-ci.com/2016-11-08-trusty-container-public-beta/

* Try to create travis user for trusty hhvm and grant permissions

remove conditionals for apc and memcache

* more tweaks to grant privileges

* try 127.0.0.1 rather than localhost

* grant after db create

* try a different create user grant privileges form

* try to specify postgresql: "9.3" for hhvm

* need to look more into specifying postgresql: "9.3"

hhvm issues

* addon with no dash postgresql: "9.3"

* requested change && not ||

* redis-server isn't needed here

* Apply @cebe's patch for pgsql test failure

* Update .travis.yml

* Update CommandTest.php

* Update CommandTest.php

* Update CommandTest.php

try to fix hhvm tests

* Update CommandTest.php
2016-11-15 16:50:41 +01:00
Carsten Brandt
6caedd1ff6 added test for MySQL index hints, #10869 2016-11-15 14:10:41 +01:00
SDKiller
556e9cf99b Updates after PR review (related #6809) 2016-11-14 23:53:09 +01:00
SDKiller
8df1017f42 Default cache ttl (duration) property (fixes #6809) 2016-11-14 23:53:09 +01:00
Klimov Paul
1157657cab Fixed incorrect order of migrations history in case yii\console\controllers\MigrateController::$migrationNamespaces is in use 2016-11-14 14:24:53 +02:00