Commit Graph

41 Commits

Author SHA1 Message Date
Alexander Makarov
3f8e8a89eb Used more specific unit test assertions in framework tests 2017-03-14 09:45:31 +03:00
Sergey Makinen
9a915ba10c Fixes #8120: Fixes LIKE special characters escaping for Cubrid/MSSQL/Oracle/SQLite in yii\db\QueryBuilder 2017-02-24 01:24:06 +03: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
Boudewijn Vahrmeijer
45d670c995 Update ConnectionTest.php 2017-02-18 15:49:24 +01:00
Vovan-VE
3538bde085 Add test case for #13340 and update CHANGELOG 2017-02-10 11:24:20 +08:00
Alexander Makarov
1cc327f108 Run common batch insert tests for SQLite 2017-01-28 14:41:57 +03:00
João Pedro Pereira
3692941ead Fixes #11464: Foreign key name is not provided by schema 2017-01-16 00:27:20 +03: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
Carsten Brandt
24809c5d73 fixed group annotations for #12889 2016-11-10 23:46:05 +01:00
Robert Korulczyk
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
Boudewijn Vahrmeijer
560e3eb0a3 Unit tests created for ActiveQuery (#12889)
* setup ActiveQueryTest

* basic unit tests for ActiveQuery are created:
- all protected & public methods are covered
- method return types are tested
- some functions are already full tested, others are supplied with @todo

* fix driver for mssql

* fix ::class to className()

* remove OCI tests
2016-11-01 20:48:58 +01:00
Alexander Makarov
01c4dde202 Added tests for column schema builder comment() method 2016-08-05 02:22:46 +03:00
Carsten Brandt
86f17c8dad added tests classes for db related tests 2016-06-20 23:07:07 +02:00
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
2016-06-20 19:26:43 +02:00
SilverFire - Dmitry Naumenko
77b29bf927 Added tests to ColumnSchemaBuilderTest in order to verify custom column types work OK 2016-05-22 12:03:44 +03:00
SilverFire - Dmitry Naumenko
8c2a70b3e7 Moved TraversableObject to yiiunit\data\base namespace 2016-04-26 13:30:37 +03:00
SilverFire - Dmitry Naumenko
e2e4f76229 Updated SqliteQueryBuilderTest to work with Composite in conditions
Updated code style, CHANGELOG
2016-04-25 23:36:41 +03:00
Carsten Brandt
8d8cd1a26d adjusted dbms specific tests 2016-04-22 12:56:56 +02:00
SilverFire - Dmitry Naumenko
b08c82c5fe Driver specific QueryBuilderTest::testCommentColumn() - improved to use replaceQuotes() 2016-04-20 09:40:21 +03:00
SilverFire - Dmitry Naumenko
8999e66e71 Fixed SqliteQueryBuilderTest 2016-04-19 18:40:05 +03:00
SilverFire - Dmitry Naumenko
c9dfc90be0 Merge branch 'methods_for_schema_builder' of https://github.com/vaseninm/yii2 into vaseninm-methods_for_schema_builder 2016-04-19 12:21:33 +03:00
Chris Harris
0b2db6f18a Fixing tests 2016-03-21 04:29:45 -07:00
Chris Harris
91018f6c38 Corrected MSSQL driver name. Fixed array addition to not overwrite matching keys. 2016-02-26 12:44:20 -08:00
Chris Harris
732a51b551 All common column definitions and expected outputs now in QueryBuilderTest::columnTypes(). DbmsSpecificQueryBuilderTest::columnTypes() adds DBMS specific column definitions. 2016-02-26 03:53:05 -08:00
Chris Harris
0a336df6ba Check return value of strncmp. Corrected SQLite expected schema test data. 2016-02-22 09:30:04 -08:00
Chris Harris
13823834e2 Start of new tests 2016-02-22 08:39:41 -08:00
Chris Harris
db5399b124 Added $expectedColumnSchemaBuilder back to test data 2016-02-22 05:28:54 -08:00
Chris Harris
3761682edf Upgraded some tests. Fixed MySQL test fixtures to create all tables with InnoDB. 2016-02-22 04:53:14 -08:00
Chris Harris
81ff4752d9 Added CHECK modifier to PK schema pattern. Modified UNSIGNED tests to not include modifier by default (i.e. only present when testing DBMSes that support it). 2016-02-22 04:06:17 -08:00
Chris Harris
eaeb926768 Adds char datatype to framework 2016-02-20 01:52:23 -08:00
romeOz
9ed8b80493 Added tests for #9790 2015-11-11 21:04:18 +03:00
Carsten Brandt
3826b6f4a3 added test for #9869 2015-10-09 16:30:18 +02:00
AIZAWA, Hina
0f2a77ed36 Fixes #9442: Fixed yii\db\Migration::renameTable() caused fatal error when using SQLite driver 2015-08-18 11:52:48 +03:00
Matvey Vasenin
afda00d434 add sqllite dummy 2015-08-17 14:44:53 +03:00
Nikola Kovacs
316e95b81d Remove length from SchemaBuilderTrait::text.
close #9307
2015-08-05 22:50:46 +02:00
Carsten Brandt
56902298b4 fixed wrong expectation in QueryBuilder test 2015-08-04 12:58:03 +02:00
Carsten Brandt
0d778d0570 adjusted querybuilder tests to match implementation 2015-08-04 12:15:00 +02:00
Carsten Brandt
681db52ba6 refactored SchemaBuilder
- rename class to ColumnSchemaBuilder as this is more appropriate
- changed internal organisation to match how the rest of schema related classes work
  - the ColumnSchemaBuilder is now created the same way as QueryBuilder is
- removed static call magic and method annotations, now real methods are called as they are
- the whole code works on objects in a db context now instead of setting database connection in global state
- trait is now used by Migration by default but can be used in other contexts as well

Migration usage is now as follows:

```php
$this->createTable('example_table', [
  'id' => $this->primaryKey(),
  'name' => $this->string(64)->notNull(),
  'type' => $this->integer()->notNull()->defaultValue(10),
  'description' => $this->text(),
  'rule_name' => $this->string(64),
  'data' => $this->text(),
  'created_at' => $this->datetime()->notNull(),
  'updated_at' => $this->datetime(),
]);
```
2015-08-03 23:25:50 +02:00
Carsten Brandt
7150e830d9 do not use reserved php words as function in schemabuilder
there is a reason for them to be reserved, we should not add such workarounds to still use them.

close #9283
2015-08-03 11:21:58 +02:00
Matvey Vasenin
b456f699cc Implemented SchemaBuilder 2015-07-08 15:38:21 +03:00
Alexander Makarov
6949992246 Simplified tests directory structure a bit 2015-04-16 12:10:01 +03:00