Klimov Paul
d8e6a89af9
fixed tests without assettions
8 years ago
Klimov Paul
dee88787fc
compatibility with PHPUnit 6.x added
8 years ago
usix298
13c2f5370f
Fixed formatting in tests [skip ci]
8 years ago
Alexander Makarov
3f8e8a89eb
Used more specific unit test assertions in framework tests
8 years ago
gagatust
6397791513
Fixed whitespaces to match code style [skip ci]
8 years ago
Nikolay Oleynikov
323568c2e9
Remove trailing spaces from sources and tests ( #13621 ) [skip ci]
8 years ago
SilverFire - Dmitry Naumenko
88f2348ed5
Fixed `ActiveRecord::unlinkAll()` to respect `onCondition()`
...
Closes #12213
8 years ago
Klimov Paul
50b668eee8
redundant code removed
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
p.chapl
3e1588b5b9
Added unit tests for #9561
...
canGetProperty and canSetProperty on ActiveRecord checks attributes
close #11087
8 years ago
SilverFire - Dmitry Naumenko
8eaf4e2ffe
#12544 - Added mote test cases for `AssetBundleTest::testRegisterFileAppendTimestamp()`
8 years ago
Klimov Paul
ea03f56d42
`BaseActiveRecord` methods `canGetProperty()` and `canSetProperty()` improved to handle attribute list fetching failure.
8 years ago
Klimov Paul
75439d367d
Fixed `canGetProperty()` and `canSetProperty()` returns `false` for `yii\db\BaseActiveRecord` attributes
8 years ago
Klimov Paul
143f9070af
Fixed `yii\db\BaseActiveRecord::updateAttributes()` change `isNewRecord` state for the new model
8 years ago
Laszlovl
0f640c7138
Make sure inverseOf relations are also populated during dynamic relational queries
...
Refs #6347
8 years ago
Carsten Brandt
a46e88dea5
fixed inverseof test assertation
...
fixed wrong test to actually test what it should.
current assertation is a duplicate.
thanks to @laszlovl for spotting it.
pr #8497
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
Carsten Brandt
37d2373911
added tests for #9047
...
1. verify it only affects composite primary key situation
2. add failing test for composite primary key situation with join
9 years ago
Carsten Brandt
fd68e6814e
added failing test for #11088
9 years ago
Ivaylo Ushev
5921865459
Fixed : #11270 - Error when link record in one to many relation. ( #11301 )
...
Fixed : #11270 - Error when link record in one to many relation.
9 years ago
Carsten Brandt
ce35739469
joinWith implementation cleanup
9 years ago
Carsten Brandt
3f8df39f45
more tests for joinWith alias
...
also test on joining the same relation twice
9 years ago
Carsten Brandt
94571e2c23
improved tests for ActiveQuery::joinWith alias
9 years ago
Carsten Brandt
5f19e7aa41
Added Alias Syntax for joinWith()
...
Add alias syntax to joinWith(), e.g. joinWith('author a').
No need to know the table name for defining an alias for the relation.
fixes #2377 , alternative to #8788 , which allows later implementation of
getting alias and column name ambiguation.
depends on #10813 to be merged first.
9 years ago
Carsten Brandt
157d6c79cc
fixes #4972 by adding and `alias()` to `ActiveQuery`
...
allows defining an alias without knowing the model table name.
9 years ago
nainoon
076329bfba
add test for join with alias
...
close #8788
9 years ago
Alexander Makarov
615a29f04e
More fixes for MSSQL tests
9 years ago
Alexander Makarov
8765cae71c
Reverted #9656 because of BC break (reverted from commit 4a464afe9b
)
9 years ago
Sam Mousa
4a464afe9b
Fixes #9656 : `yii\db\BaseActiveRecord` refactored in order to getting, setting and unsetring attribute values using the same approach
9 years ago
Alexander Makarov
357bce51bb
Tests for #9006
9 years ago
Carsten Brandt
d0c6cb7700
abort removing duplicate records when pk is not in result set
...
in this cases it does not make sense to remove duplicates as the result is not on record level anymore.
This could be the case after GROUP BY has been applied.
fixes #8772
9 years ago
Klimov Paul
a849e815df
Fixed `yii\db\ActiveQuery` produces incorrect SQL for aggregations, when `sql` field is set
9 years ago
Klimov Paul
51a442d6c8
Fixed `yii\db\ActiveRecord` does not updates attribute specified at `optimisticLock()` after save
9 years ago
Klimov Paul
6d96d3cbee
Fixed `yii\db\BaseActiveRecord::updateCounters()` fails for new record saved with counter attribute not set
10 years ago
Alexander Makarov
6949992246
Simplified tests directory structure a bit
10 years ago
Jan Waś
9e6b7dea24
add an unit test, which fails for postgresql and oracle
10 years ago
John Was
4f49feee8d
fixes #7757 : in oci schema fix query results row keys case when PDO::ATTR_CASE is set to PDO::CASE_LOWER
...
added test to check support for setting PDO::ATTR_CASE and fetching table schemas
fixed fetching table schemas for mysql when PDO::ATTR_CASE is set
added tests for oci
fixed fetching composite fks for oci
improvements in oci schema parsing
removed autoIncrement detection fro oci and added test to verify that
implement batchInsert for oci
fix detecting IntegrityException for oci
fixed creating raw sql by skipping object and resource params
fix command test failing for sqlite
10 years ago
Jose Lorente
98759201ac
Fixed bug #7271 . Classes that call '*::populateRecord()' after retrieving data from ddbb call now the method on the class of the model returned by '*::instantiate()'. Tests for mysql, elasticsearch and mongodb attached.
10 years ago
Carsten Brandt
1b4d894c9d
created test for #5341
10 years ago
Qiang Xue
aa8c013ebf
Fixes #3197 : Using `ActiveQuery::indexBy()` may cause relational AR queries to generate incorrect relational results
10 years ago
Qiang Xue
b9c97ff2aa
Fixes #4938 : When `yii\db\ActiveQuery` is used to build sub-queries, its WHERE clause is not correctly generated
10 years ago
Qiang Xue
2150fa3239
Fixes #4970 : `joinWith()` called by a relation was ignored by `yii\db\ActiveQuery`
10 years ago
Stephen Seliuk
70ed5d5c01
Test for fix
10 years ago
Carsten Brandt
c4dc9470be
created a test case to verify #4682
10 years ago
Qiang Xue
1b4a9b62cd
Fixes #3568 : When the primary query sets `asArray`, it is not respected by the `via` relational query
10 years ago
Alexander Makarov
0c14f47f9a
Fixes #3793 : Changed inline autocomplete hints style to get more IDEs support
10 years ago
Carsten Brandt
0208f289c3
fixed test breaks
10 years ago
Carsten Brandt
d92281dcda
refactored ActiveRecord::unlinkAll() to work will noSQL
...
issue #3520
10 years ago
Alexander Makarov
0003b10b02
ElasticSearch tests fix
10 years ago