SilverFire - Dmitry Naumenko
55f1f34e44
Added test to verifiy #15731
7 years ago
SilverFire - Dmitry Naumenko
c297986066
Fixed Query::select()
...
fixes #15728
7 years ago
SilverFire - Dmitry Naumenko
1b3526d8db
Fixed `yii\db\Query::select()` to override existing selects
...
Fixes #15676 , fixes #15674
7 years ago
Alexander Makarov
5e8fd58ddb
15630 fixed like escaping ( #15642 )
...
* Tests for like escaping.
* Fix for like condition escaping
* Fixed PHPDocs
* Simplify tests
7 years ago
Alexander Makarov
00c0bb5804
Added test for #15630 ( #15639 )
7 years ago
SilverFire - Dmitry Naumenko
5bd6ed5684
Fixed issues in accidental merge of unfinished #15398
7 years ago
Vladimir Reznichenko
ecf3ef8bf9
Use root NS specification for opcoded functions
7 years ago
wapmorgan
5afe0a0d36
Fixes #15047 : `yii\db\Query::select()` and `yii\db\Query::addSelect()` now check for duplicate column names
7 years ago
Alexander Makarov
17186b24c1
Fixed test
7 years ago
Alexander Makarov
b979b2aa88
Fixes #15355 : Additional test and fix
7 years ago
Alexander Makarov
ba931fa21d
Fixes #15356 : Fixed multiple bugs in `yii\db\Query::getTablesUsedInFrom()`
7 years ago
vladis
6c731d46d0
#15356 : Initial version of `yii\db\Query::getTablesUsedInFrom()` fix and tests
7 years ago
Гордиенко Владислав Юрьевич
dc019856b7
Fixes #15355 : Fixed `yii\db\Query::from()` does not work with `yii\db\Expression`
7 years ago
Gabriel Caruso
2992b9b09d
Refactored tests with PHPUnit assert methods ( #15260 )
7 years ago
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".
7 years ago
Robert Korulczyk
1501c659ac
Add empty lines before return statements. ( #14682 ) [skip ci]
7 years ago
Robert Korulczyk
b99e955627
Fix CS ( #14665 )
...
* Run php-cs-fixer.
* Enable phpdoc_types rule.
7 years ago
Carsten Brandt
c9347b0a57
Fixed ambiguous column error on indexBy with JOIN
...
fixes #13859
close #14431
7 years ago
Carsten Brandt
173108b5b0
Move getTablesUsedInFrom() from ActiveQuery to Query
...
enable this feature on the Query level
close #14431
7 years ago
Robert Korulczyk
ba0ab403b5
Added php-cs-fixer coding standards validation to Travis CI ( #14100 )
...
* php-cs-fixer: PSR2 rule.
* php-cs-fixer: PSR2 rule - fix views.
* Travis setup refactoring.
* Add php-cs-fixer to travis cs tests.
* Fix tests on hhvm-3.12
* improve travis config
* composer update
* revert composer update
* improve travis config
* Fix CS.
* Extract config to separate classes.
* Extract config to separate classes.
* Add file header.
* Force short array syntax.
* binary_operator_spaces fixer
* Fix broken tests
* cast_spaces fixer
* concat_space fixer
* dir_constant fixer
* ereg_to_preg fixer
* function_typehint_space fixer
* hash_to_slash_comment fixer
* is_null fixer
* linebreak_after_opening_tag fixer
* lowercase_cast fixer
* magic_constant_casing fixer
* modernize_types_casting fixer
* native_function_casing fixer
* new_with_braces fixer
* no_alias_functions fixer
* no_blank_lines_after_class_opening fixer
* no_blank_lines_after_phpdoc fixer
* no_empty_comment fixer
* no_empty_phpdoc fixer
* no_empty_statement fixer
* no_extra_consecutive_blank_lines fixer
* no_leading_import_slash fixer
* no_leading_namespace_whitespace fixer
* no_mixed_echo_print fixer
* no_multiline_whitespace_around_double_arrow fixer
* no_multiline_whitespace_before_semicolons fixer
* no_php4_constructor fixer
* no_short_bool_cast fixer
* no_singleline_whitespace_before_semicolons fixer
* no_spaces_around_offset fixer
* no_trailing_comma_in_list_call fixer
* no_trailing_comma_in_singleline_array fixer
* no_unneeded_control_parentheses fixer
* no_unused_imports fixer
* no_useless_return fixer
* no_whitespace_before_comma_in_array fixer
* no_whitespace_in_blank_line fixer
* not_operator_with_successor_space fixer
* object_operator_without_whitespace fixer
* ordered_imports fixer
* php_unit_construct fixer
* php_unit_dedicate_assert fixer
* php_unit_fqcn_annotation fixer
* phpdoc_indent fixer
* phpdoc_no_access fixer
* phpdoc_no_empty_return fixer
* phpdoc_no_package fixer
* phpdoc_no_useless_inheritdoc fixer
* Fix broken tests
* phpdoc_return_self_reference fixer
* phpdoc_single_line_var_spacing fixer
* phpdoc_single_line_var_spacing fixer
* phpdoc_to_comment fixer
* phpdoc_trim fixer
* phpdoc_var_without_name fixer
* psr4 fixer
* self_accessor fixer
* short_scalar_cast fixer
* single_blank_line_before_namespace fixer
* single_quote fixer
* standardize_not_equals fixer
* ternary_operator_spaces fixer
* trailing_comma_in_multiline_array fixer
* trim_array_spaces fixer
* protected_to_private fixer
* unary_operator_spaces fixer
* whitespace_after_comma_in_array fixer
* `parent::setRules()` -> `$this->setRules()`
* blank_line_after_opening_tag fixer
* Update finder config.
* Revert changes for YiiRequirementChecker.
* Fix array formatting.
* Add missing import.
* Fix CS for new code merged from master.
* Fix some indentation issues.
7 years ago
Alex-Code
7c6620a65f
Fixes #13846 : Fixed `Query::count()` issue with `orderBy`
7 years ago
Klimov Paul
d8e6a89af9
fixed tests without assettions
8 years ago
Alexander Makarov
3f8e8a89eb
Used more specific unit test assertions in framework tests
8 years ago
Sergey Makinen
a9fb0171f7
Fixes #13745 : `SQLSTATE[HY093]: Invalid parameter number: parameter was not defined` in MSSQL and bug fixes in `yii\db\QueryBuilder::buildLikeCondition()`
8 years ago
p.chapl
5488fc6e28
fixes #13221
...
Make \yii\db\QueryTrait::limit and \yii\db\QueryTrait::offset methods works with \yii\db\Expression
8 years ago
Pavel Chaplygin
25e6eb04a5
refs #11122 : Fixed can not use `orderBy` with aggregate functions ( #12772 )
...
* refs #11122 : Fixed can not use `orderBy` with aggregate functions like `count`, `max` etc.
* Update QueryTest.php
8 years ago
Brandon Kelly
350e93e626
Fixes #12612 : Query conditions added with `yii\db\Query::andWhere()` now get appended to the existing conditions if they were already being joined with the `and` operator
8 years ago
Alexander Makarov
b78d6367ba
Removed duplicate assertion from tests, divided test method into two
8 years ago
Alexander Makarov
837b33767c
Fixes #11697 : Added `filterHaving()`, `andFilterHaving()` and `orFilterHaving()` to `yii\db\Query`
...
Signed-off-by: Alexander Makarov <sam@rmcreative.ru>
8 years ago
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
8 years ago
SilverFire - Dmitry Naumenko
95152f3c2c
Fixed consistency of `indexBy` handling for `yii\db\Query::column()`
...
Closes #12649
8 years ago
SilverFire - Dmitry Naumenko
7f69b71d60
Updated QueryTest. Verified `andFilterWhere` to work with nested operator format conditions
...
Closes #5365
8 years ago
Carsten Brandt
8ba032d147
refactored database tests
...
- changed test class naming for easier copying and searching of classes
- made base tests abstract and made MySQL an equal citisen in the test
hierarchie
- added missing db specific test classes
8 years ago
Carsten Brandt
4411a74ebd
proper fix for #9425 , adjust changes from #11363
...
includes tests and fix that works in all cases.
9 years ago
Lennart van den Dool
f8a844a90f
Query helper method for filter values containing operators
...
Basic implementation proposal for yiisoft/yii2#2022
Shortcomings/todo's:
* filtering on non-scalars (where IN statements) not supported
* Numeric properties with a corresponding validation rule will yield
errors when they contain an alphanumeric operator. These properties'
rules should be defined as 'string' or 'safe'.
* no implementation example in Gii code (yet).
close #8505
9 years ago
Andrew Nester
61df727eaf
Expression objects for orderBy should be handled in QueryBuilder
...
fixes #10535
close #10637
- Added test to prove orderBy accepts \yii\db\Expression
9 years ago
romeOz
9ed8b80493
Added tests for #9790
9 years ago
John Was
01345874a3
add working QueryBuilder test for Oracle
10 years ago
Alexander Makarov
6949992246
Simplified tests directory structure a bit
10 years ago
Klimov Paul
a8f4e8bee4
`yiiunit\framework\db\QueryTest::testCount()` fixed to be more generic
10 years ago
Klimov Paul
2ebe355e8d
`yiiunit\framework\db\QueryTest` fixed to be run for 'mysql' only
10 years ago
Klimov Paul
b8081b59b3
Fixed `yii\db\Query::count()` fails for query containing 'having' without 'group by'
10 years ago
Qiang Xue
aead65f2d2
Fixes #7515 : Added support to use `indexBy()` together with `column()` in query builder
10 years ago
Qiang Xue
09b00c5cd0
Reverted #4098 .
10 years ago
Qiang Xue
dfadb6a917
Fixes #4098 : `yii\db\Query::addSelect()` should include `*` when it is called the first time
10 years ago
Alex-Code
80067204c8
test for addSelect method.
11 years ago
Qiang Xue
0fa19291f1
refactored filterWhere().
11 years ago
Carsten Brandt
03e208e59d
removed wrong test
11 years ago
Carsten Brandt
c572c23c2f
adjusted tests
11 years ago
Carsten Brandt
96f1c4c10b
renamed Query::filter() to Query::filterWhere()
11 years ago