56 Commits

Author SHA1 Message Date
161526cd41 HTTPS everywhere (#19503) 2022-08-03 12:32:18 +03:00
8784331022 Fix #18385: Add ci-oracle and fix tests
* Add github action for testing oci8 Oracle.
* Fix CommandTest::testQueryCache.
* Fix tests CommandTest::testBindParamsNonWhere.
* Fix test CommandTest::testInsert.
* Fix test CommanTest::testInsertExpression.
* Fix test CommandTest::testInsertSelectAlias.
* Fix test CommandTest::testBindParamValue.
* Fix tests CommandTest::testBatchInsertDataTypesLocale.
* Fix test CommandTest::testNoTablenameReplacement.
* Fix test CommandTest::testCreateTable.
* Fix test CommandTest::testsInsertQueryAsColumnValue.
* Fix tests CommandTest::testAlterTable.
* Fix test CommandTest::testCreateView.
* Fix test CommandTest::testTransaction.
* Fix test ConnectionTest::testTransactionShortcutCorrect.
* Fix test ConnectionTest::testTransactionShortcutCustom.
* Fix test ConnectionTest::testEnableQueryLog.
* Fix test QueryBuilder::testAddDropDefaultValue.
* Fix test QueryTest::testUnion.
* Fix test QueryTest::testExpressionInFrom.
* Fix test SchemaTest::testFindUniqueIndexes.
* Fix test QueryBuilderTest::testGetColumnType.
* Fix test ActiveRecordTest::testFind.
* Fix test ExistValidatorTest::testExpresionInAttributeColumnName.
* Fix test UniqueValidatorTest::testExpressionInAttributeColumnName.
* Fix ActiveRecordTest testCastValues(), testDefaultValues.
* Fix test UniqueValidatorTest::testValidateAttributeDefault.
* Fix test UniqueValidatorTest::testValidateEmptyAttributeInStringField.
* Fix test UniqueValidatorTest::testValidateEmptyAttributeInIntField.
* Fix test ActiveRecordTest::testBit.
* Fix test ActiveRecordTest::testBooleanAttribute.
* Fix test ActiveRecordTest::testJoinWithAlias.
* Fix test SchemaTest::testColumnSchema.
* Fix test CommandTest:: testBatchInsertSQL.
* Skip CommandTest::testColumnCase.
* Fix test ConnectionTest::testQuoteValue.
* Should be fixed tests conditionsProvider in QueryBuilderTest.
* Fix ActiveRecordTest.php
* Fix test UniqueValidatorTest.
* Fix test QueryBuilderTest::testUpsert.
* Skip SchemaTest::testCompositeFK.
2020-11-23 23:12:01 +03:00
89ded8c82a Fix #18000: PK value of Oracle ActiveRecord is missing after save 2020-05-02 02:17:27 +03:00
f165b6b31f Fix #17679: Fix Oracle exception "ORA-01461: can bind a LONG value only for insert into a LONG column" when inserting 4k+ string 2020-03-02 23:26:53 +03:00
cdd40b8dfb Fix #17504: Fix upsert when $updateColumns = true but there are no columns to update in the table 2019-08-21 11:56:20 +03:00
b4cb42fb9d Fix of Oracle tests for proper skipping (#17019)
PHPUnit must get the data that will be passed to the tests, before executing them. That's why you can't prevent the dataProvider to be executed using `$this->markTestSkipped()` inside a test. Instead, you must use a skipping inside data provider when the test cannot be executed.

Now Oracle tests are skipped without fails when Oracle isn't installed:
```
$ vendor/bin/phpunit --filter=BuildLikeCondition --group=oci --verbose

...

There was 1 skipped test:

1) yiiunit\framework\db\oci\QueryBuilderTest::testBuildLikeCondition
Test for yiiunit\framework\db\oci\QueryBuilderTest::testBuildLikeCondition skipped by data provider
Could not execute Connection::quoteValue() method: Connection::dsn cannot be empty.
```
2019-01-05 16:52:01 -05:00
3555633223 Fixes #14289: Added yii\db\Command::executeResetSequence() to work with Oracle 2018-06-27 22:29:50 +03:00
ac687aab29 Fixed yii\db\Command::upsert() for Cubrid/MSSQL/Oracle 2018-02-24 19:59:12 +03:00
df91a9608f Fixes #14638: Added yii\db\SchemaBuilderTrait::tinyInteger() 2018-02-12 12:01:21 +03:00
de1750228d Fixes #13879: Added upsert support for yii\db\QueryBuilder and yii\db\Command 2018-02-09 01:05:50 +03:00
40b038379f Fixes #13019: Support JSON in SchemaBuilderTrait 2018-02-06 16:35:49 +03:00
2992b9b09d Refactored tests with PHPUnit assert methods (#15260) 2017-11-30 22:10:31 +03:00
4e176ca325 Fixes #15108: Fixed yii\db\Schema::getSchemaNames() for MSSQL and added tests for all DBMSes 2017-11-07 19:20:14 +03:00
7e7faeebd1 Fixed excess escaping in Command::batchInsert() (#13236) 2017-10-23 22:43:39 +03:00
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
c8856ccd4e Fix merging issues & CS 2017-06-17 01:02:01 +03:00
f820d2ca36 Merge branch 'master' into db-constraints 2017-06-16 16:52:43 +03:00
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.
2017-06-12 12:25:45 +03:00
47f837db0b Fix constraint tests 2017-05-15 20:55:26 +03:00
73ac13e6d7 Implement retrieving dbms constraints 2017-05-15 20:55:25 +03:00
2d0e3fb9ef Fixed Oracle SQL queries with IN condition and more than 1000 parameters 2017-05-01 15:59:37 +03:00
3f8e8a89eb Used more specific unit test assertions in framework tests 2017-03-14 09:45:31 +03:00
a9fb0171f7 Fixes #13745: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in MSSQL and bug fixes in yii\db\QueryBuilder::buildLikeCondition() 2017-03-11 22:36:01 +03:00
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
fab53b4a6e Fixes #13582: Added tests for all yii\db\QueryBuilder::resetSequence implementations, fixed SQLite implementation 2017-02-20 23:04:04 +03:00
ef4dadf437 Fixes #13592: Fixes Oracle’s yii\db\oci\Schema::setTransactionIsolationLevel() 2017-02-19 17:32:51 +03:00
b8bf0d0c0c added hint into foreign keys query for oracle 11g optimisation
update oci tests
improved varible name

Closes #13122
2016-12-10 20:26:22 +02:00
24809c5d73 fixed group annotations for #12889 2016-11-10 23:46:05 +01:00
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
01c4dde202 Added tests for column schema builder comment() method 2016-08-05 02:22:46 +03:00
86f17c8dad added tests classes for db related tests 2016-06-20 23:07:07 +02:00
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
77b29bf927 Added tests to ColumnSchemaBuilderTest in order to verify custom column types work OK 2016-05-22 12:03:44 +03:00
b08c82c5fe Driver specific QueryBuilderTest::testCommentColumn() - improved to use replaceQuotes() 2016-04-20 09:40:21 +03:00
0fe27b9d3b Refactored code in PR #9441 2016-04-19 17:48:25 +03:00
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
91018f6c38 Corrected MSSQL driver name. Fixed array addition to not overwrite matching keys. 2016-02-26 12:44:20 -08:00
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
db5399b124 Added $expectedColumnSchemaBuilder back to test data 2016-02-22 05:28:54 -08:00
3761682edf Upgraded some tests. Fixed MySQL test fixtures to create all tables with InnoDB. 2016-02-22 04:53:14 -08:00
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
eaeb926768 Adds char datatype to framework 2016-02-20 01:52:23 -08:00
5cecb09c1b Fixes #9443: Added unsigned() to ColumnSchemaBuilder 2015-12-26 15:20:21 +03:00
7c9b7c77a7 Added tests for dropTable, truncateTable and renameTable 2015-11-20 16:16:44 +03:00
2d8106a39c Fixed testCreateTable and testAlterTable in CommandTest for MSSQL and OCI 2015-10-21 00:19:48 +03:00
a8ec3ebe14 add oracle support (need tested) 2015-08-19 17:10:10 +03:00
316e95b81d Remove length from SchemaBuilderTrait::text.
close #9307
2015-08-05 22:50:46 +02:00
56902298b4 fixed wrong expectation in QueryBuilder test 2015-08-04 12:58:03 +02:00
0d778d0570 adjusted querybuilder tests to match implementation 2015-08-04 12:15:00 +02:00
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