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
╃巡洋艦㊣
586684b050
2.0.5 bf7edc5
9 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
╃巡洋艦㊣
1468bd4d3d
version 2.0.1 84b42ab
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
Alexander Makarov
06fdb79730
Added support for arbitrary number of parameters for NOT, AND, OR in filter methods of Query
11 years ago
Alexander Makarov
ab799d8ea9
Fixes #2911 : Removed `tbl_` default for table prefix
11 years ago
Alexander Makarov
8cd247730a
Query::filter() adjustments
11 years ago
Alexander Makarov
3c1a8141fd
fixes #2002
11 years ago
Alexander Makarov
19327ebd14
Added tests for Query::filter()
11 years ago
SonicGD
b5f8a4dc22
Reformat code te be PSR-2 compatible
11 years ago
Carsten Brandt
795c74100d
reverted #1598 and added a test for it
11 years ago
Carsten Brandt
9448c3d471
added unit tests for active dataprovider and fixed query tests
11 years ago
Alexander Makarov
ee2af2661c
Removed unneeded use statements
11 years ago
Alexander Makarov
1f6a823073
Short array syntax
11 years ago
Carsten Brandt
949dda5fdb
tagged tests with @group tags
11 years ago
Carsten Brandt
544e412af8
unit test cleanup
11 years ago
Alexander Makarov
0596fa82fd
code style fixes
11 years ago
Qiang Xue
f2e57b2eec
Fixed test breaks.
11 years ago
Alexander Makarov
7cd9123c3b
Tests cleanup
...
- Better names
- Removed not used MySQLTestCase
- Moved base testcase for DB to db namespace
- Minor style fixes
12 years ago
resurtm
ea68bd3a55
CS fixes.
12 years ago
Rusinov Maxim
d712605a71
Added and resolved Sqlite tests #15 .
12 years ago
Zander Baldwin
4be9e195c2
Add Newlines
...
Appended newlines to every PHP document that did not have a newline as the last character in the file.
12 years ago
Qiang Xue
06feccff8b
refactored query builder.
...
finished Sort.
12 years ago
Qiang Xue
d15378ef43
moved db tests.
12 years ago
Qiang Xue
8517ee9e50
reorganized DB classes.
12 years ago