Commit graph

1026 commits

Author SHA1 Message Date
mark_story
39011cd9d8 Fix Model::isUnique() not working as a validator.
While it *did* work for single fields, isUnique could not be used to
validate the uniqueness across multiple fields as documented. Because
validation methods pass arguments in an order the validator did not
expect the validation method would not work correctly.

Fixes #4571
2014-10-09 22:49:17 -04:00
mark_story
0ff9545e5a Add test for find() and array conditions.
Add a test for conditions using an array with only one element.

Closes #4848
2014-10-09 19:58:18 -04:00
ADmad
94e718372a Make CakeSession::read() return null for all failure cases. 2014-10-09 19:27:27 +05:30
mark_story
af43bc1706 Merge branch 'master' into 2.6 2014-09-25 22:39:51 -04:00
mark_story
1877cab341 Fix UUID primary key columns not being reflected properly.
When UUID columns are converted into varchar(36) they should also be
default = null, null = false.

Fixes #4695
2014-09-23 22:16:18 -04:00
ADmad
3fb252ad2f Merge branch 'master' into 2.6 2014-09-13 00:37:16 +05:30
euromark
04ef39217f Take care of more int casts. 2014-09-10 16:29:23 +02:00
mark_story
734bb9223b Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/Core/App.php
	lib/Cake/VERSION.txt
2014-09-06 23:04:20 -04:00
José Lorenzo Rodríguez
b5bfbfcf15 Merge pull request #4223 from chinpei215/2.6-issue2529-fix
Fix different format of $results in afterFind
2014-09-03 10:39:37 +02:00
ADmad
d60cd3ab2f Revert "Merge pull request #4405 from php-engineer/master-session-bugfix"
This reverts commit 5863adda42, reversing
changes made to 4c37cf6d4b.

There was no real issue. The lack of session cookie in CLI makes writing
tests a bit tricky which caused the confusion. Refs #4405, #4451.
2014-09-01 00:17:53 +05:30
mark_story
7c316bbc56 Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/basics.php
2014-08-30 21:28:11 -04:00
Jeremy Harris
2dac6d29c2 Clearing HABTM (unique) when HABTM array is empty, refs #2461 2014-08-28 17:52:13 -05:00
chinpei215
010bbc6764 Resolve ambiguous column names for Sqlite 2014-08-27 16:06:28 +09:00
chinpei215
c06b7162ef Resolve ambiguous column names 2014-08-27 15:32:57 +09:00
chinpei215
31204832c2 Ensure that afterFind is called when using 'joins' with 'recursive' = -1 2014-08-27 15:16:13 +09:00
chinpei215
b74774bb0c hasOne/belongsTo associations should contain associated records in afterFind
Before 1fe943d6f1,
afterFind() is called twice with belongsTo/hasOne associations.
Although $results also doesn't contain associated records on first time,
it contains them on second time.

After 1fe943d6f1,
it doesn't work if associated records are used in afterFind.
This commit fixes it.
2014-08-27 09:32:00 +09:00
Stefan Dickmann
66ccfaf5e2 session bugfix 2014-08-26 17:47:45 +02:00
euromark
cc0acd1556 Fix CS. 2014-08-25 16:54:12 +02:00
mark_story
7936b5e764 Fix CURRENT_TIMESTAMP being stored as a default value.
When reflecting timestamp columns in MySQL current_timestamp comes back
as the default value. This causes insertion errors later on as
'current_timestamp' is an invalid value for timestamp columns.

Refs #4184
2014-08-25 11:17:11 +02:00
ADmad
9d53a1e9ce Merge branch 'master' into 2.6 2014-08-15 12:37:13 +05:30
Brian Porter
9b9600fe18 CakeSchema naming fallback.
Abstracts the `require_once` of the schema file so it can be done twice. The added second call is a fallback for the previous APP_DIR-based naming to provide backwards compatibility.

Removes now-obsolete CakeSchema tests that involved `Configure::read('App.dir')`. The CakeSchema::name is now always static (and predictable) in the default case.
2014-08-11 10:40:57 -05:00
chinpei215
c246695518 Fix different format of $results in afterFind
Refs #2529

As of this commit, we can get consistent format of $resutls in afterFind.
And we can keep backward compatibility if Model::$useConsistentAfterFind is set to false.
2014-08-11 01:19:40 +09:00
chinpei215
c227c14bf2 Fix afterFind() called twice with hasMany relationship
It occurs when a model and the children models are related to a same model.
For example, such as the following:

* User hasMany Comment
* User hasMany Article
* Article hasMany Comment
2014-08-11 00:12:03 +09:00
mark_story
9c3089796f Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/Model/Model.php
2014-08-08 23:28:06 -04:00
mark_story
d114fa1431 Update join building to not error out on empty conditions.
When conditions are empty we can assume one of two things:

* The person made a mistake.
* The person is doing the join conditions in the where clause.

In both cases we should attempt to generate proper SQL.

Fixes #4189
2014-08-08 10:02:09 -04:00
José Lorenzo Rodríguez
64e74cbaac Merge pull request #4175 from chinpei215/master-issue2268-fix
Fix afterFind() called twice with belongsTo and hasOne relationships
2014-08-06 10:48:45 +02:00
chinpei215
1fe943d6f1 Fix afterFind() called twice with belongsTo and hasOne relationships
Refs #2268
2014-08-06 07:27:04 +09:00
chinpei215
cb376bf420 Add some more transaction tests
And remove 2 else clauses.
2014-08-03 22:34:11 +09:00
chinpei215
799500ce6d Fix transactions do not get rollbacked in saveAssociated/saveMany
Refs #2849
2014-08-02 10:12:33 +09:00
chinpei215
3d77ce5d34 Fix serveral tests pass regardless of whether data is valid or not 2014-08-02 09:55:29 +09:00
mark_story
051d78c1a5 Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/Model/Model.php
2014-07-16 23:11:58 -04:00
chinpei215
ca93bbcd15 Fix CS 2014-07-14 01:21:09 +09:00
chinpei215
ace30fdd8a Fix a race condition problem
Prevents Model::save() from generating a query with WHERE 1 = 1 on race condition.

Refs #3857
2014-07-12 23:27:39 +09:00
mark_story
03c2a8b722 Unify datetime column default values between MySQL and Postgres.
Datetime columns should have 'default' => null, in both Postgres and
MySQL.

Fixes #3837
2014-07-11 23:10:16 -04:00
ADmad
e410501791 Fix CS errors. 2014-07-03 23:13:55 +05:30
mark_story
2bcd817367 Merge branch 'master' into 2.6 2014-07-03 11:13:06 -04:00
euromark
974ca851c2 Correct doc blocks according to cs guidelines.
Remove superfluous empty lines.
2014-07-03 15:36:42 +02:00
Haithem BEN GHORBAL
31615ce415 add 'atomic' option to "save()" API
This commit adds a transaction context to 'save()' API in order to rollback
possible modifications done in some 'Model.beforeSave' listener callback.
This will allow cakephp 2.x to behave like 3.0 .
It uses try/catch to better handle transaction.
Previous save() API is renamed to protected _doSave() method.
A new save() method is created for transaction handling.
'atomic' option is disabled for internal 'save()' call.
2014-06-03 09:37:17 +02:00
Haithem BEN GHORBAL
a8e410ee20 fix save with habtm returning false 2014-05-28 18:17:16 +02:00
Schlaefer
815838f150 replaces validator 'between' with 'lengthBetween' 2014-05-13 10:46:25 +02:00
Schlaefer
4848b63189 closes #3303 RFC: Rename Validator::between() into Validator::length() 2014-05-13 09:31:03 +02:00
ADmad
d466e00644 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Model/Datasource/DboSource.php
	lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
	lib/Cake/Utility/Folder.php
	lib/Cake/VERSION.txt
2014-05-04 14:35:36 +05:30
euromark
7a287a6942 More coding standard corrections. 2014-04-29 14:19:33 +02:00
euromark
8e0f15b3d6 Revert the removal of a BC relevant part. 2014-04-10 20:11:58 +02:00
euromark
0ece694a75 microptimize options and default merge and other string key array merges 2014-04-08 01:25:14 +02:00
Jose Lorenzo Rodriguez
343d3279b9 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Test/Case/Utility/FileTest.php
	lib/Cake/VERSION.txt
2014-04-06 21:50:41 +02:00
euromark
0d09a54033 more missing doc block tags added 2014-04-02 03:02:37 +02:00
euromark
44952b06a4 cs 2014-04-02 02:23:43 +02:00
mark_story
ff73229ab8 Fix failing tests.
Not everyone uses the same database names as me.
2014-03-24 10:04:19 -04:00
mark_story
2fe8c4050b Insert manual joins *after* generated joins.
Re-order query joins to make manually added joins be performed after
generated joins. This removes the need to workaround the current join
order, or redefine all association joins when you want to add an
additional join on a leaf table.

Refs #2179
Refs #2346
2014-03-23 21:09:08 -04:00
mark_story
6c3bc48ce0 Merge branch 'master' into 2.5 2014-03-06 17:45:00 -05:00
ndm2
70a1b87db6 Fix wrong test model association class name 2014-03-01 23:01:33 +01:00
ndm2
008ad3237c Fix verification of expected invocations #2919 2014-03-01 19:06:17 +01:00
mark_story
2c5d96e916 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Model/Datasource/DboSource.php
2014-02-16 14:24:19 -05:00
mark_story
96a37d5917 Fix temporary associations that replace fields not being restored.
When binding temporary associations, fields should be restored
in the afterFind as the association will have become unbound.

Fixes #2816
2014-02-11 21:56:05 -05:00
mark_story
be8ebfc005 Merge branch 'master' into 2.5 2014-02-05 09:22:46 -05:00
José Lorenzo Rodríguez
e36c954da7 Merge pull request #2693 from ADmad/2.5-session-start
Don't start a session if it's known to be empty.
2014-02-01 04:08:48 -08:00
Rachman Chavik
59549b7ebe Fix: Changing boolean to integer for Postgres
Closes #2751, CakeDC/migrations#149
2014-01-31 15:14:20 +07:00
mark_story
c1ab6fa9d1 Merge branch 'master' into 2.5 2014-01-30 10:13:37 -05:00
Mark Story
5629dfdcc3 Merge pull request #2728 from joostdekeijzer/2721-fix-in-translatebehavior
Fix Model::field() and  TranslateBehavior::beforeFind() not working together.

Fixes #2721
2014-01-29 06:40:27 -08:00
joostdekeijzer
987187ef8c Fix #2721 in TranslateBehavior::beforeFind() supporting both Model::field('fieldname') and Model::read('fieldname') 2014-01-29 13:37:47 +01:00
joostdekeijzer
827c815cf1 correct property comment 2014-01-29 12:25:09 +01:00
ADmad
c093804b35 Merge branch 'master' into 2.5 2014-01-26 17:39:50 +05:30
mark_story
61dd1c3f9d Fix trailing whitespace. 2014-01-21 20:23:12 -05:00
ADmad
84932fcc4a Don't start a session if it's known to be empty.
If an app only reads/checks the session there's no need to start a
session to know that the read/checked session value is empty.

Fixes #1981
2014-01-22 01:17:16 +05:30
mark_story
55e1619c59 Fix issue with find(count) and TranslateBehavior.
Fixes #2667
2014-01-18 21:54:09 -05:00
Rob McVey
7a27650297 Test case that demonstrates issue with count and Translate 2014-01-18 21:49:07 -05:00
mark_story
75dd2ff1fb Merge branch 'master' into 2.5 2014-01-16 15:20:40 -05:00
euromark
690f54ad9d more corrections in order 2014-01-10 00:33:27 +01:00
euromark
3ff23c732f unify and correct assert order 2014-01-10 00:18:08 +01:00
euromark
738b34c2d0 Correct assert param order 2014-01-09 16:50:27 +01:00
mark_story
b20ca3f4e0 Fix errors with postgres tests. 2014-01-08 09:42:13 -05:00
mark_story
3763350667 Add test for issue #2595
Fold conditions that did the same thing and add a test case.

Closes #2595
2014-01-06 21:21:13 -05:00
mark_story
3cee3b0e99 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/VERSION.txt
2013-12-30 21:28:22 -05:00
Rachman Chavik
c48afae2dc Add test to prove issue when saving invalid tree data 2013-12-27 12:35:28 +07:00
mark_story
1daa27c0d7 Add tests for uncovered case of :0 replacements.
There were previously no tests for the :0, :1 style replacement markers
in DboSource. In fact I didn't even know it was a 'feature'.
2013-12-24 13:13:05 -05:00
mark_story
7e5c0f7185 Merge branch 'master' into 2.5 2013-12-20 14:15:35 -05:00
OKINAKA Kenshin
3433e10fbd Fix Postgres for bigint primary key. 2013-12-18 14:58:18 +09:00
mark_story
c2b8778ce8 Merge branch 'master' into 2.5 2013-12-14 17:45:49 -05:00
Mark Story
384c3a815d Merge pull request #2350 from tuffz/formatting_app_uses_blocks
formatting app::uses blocks
2013-12-14 12:37:02 -08:00
mark_story
3b867a048e Add test for saveMany + validate=false.
Closes #2468
2013-12-11 12:43:18 -05:00
José Lorenzo Rodríguez
6358741944 Merge pull request #2449 from cakephp/fix-session-cyclic-error
Fixed error in CakeSession that would call start() in an infinite loop
2013-12-09 02:18:21 -08:00
mark_story
48d2618c62 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/Routing/Router.php
2013-12-08 21:25:59 -05:00
mark_story
abf4af14a8 Change quotes to keep postgres happy. 2013-12-08 11:58:26 -05:00
mark_story
530c95725f Attempt to fix errors with postgres tests. 2013-12-08 11:46:17 -05:00
Rachman Chavik
98e645a1ea Add test to prove issues with deleteAll with $order set 2013-12-08 16:39:56 +07:00
Jose Lorenzo Rodriguez
848a0ce217 Fiexed error in CakeSession that would call start() in an infinite loop
when the session is marked as invalid
2013-12-07 22:25:33 +01:00
ADmad
f3900e89fd Fixed bug where deleteAll tried to delete same id multiple times.
Ensure find done in deleteAll only returns distinct ids. A wacky
combination of association and conditions can sometimes generate
multiple rows per id.
2013-12-03 22:18:17 +05:30
mark_story
97ab2c0e9b Merge branch 'imsamurai-2.5' into 2.5
Add unsigned integer support to MySQL. Unsigned integers have not been
added to other databases as they either do not support them (postgres,
sqlserver) or they are 'faked' and don't do anything (sqlite).

Fixes #2321
2013-11-27 20:12:28 -05:00
imsamurai
62a53d26bb fix typo 2013-11-22 16:17:25 +02:00
mark_story
71312932e8 Merge branch 'master' into 2.5 2013-11-21 21:46:21 -05:00
José Lorenzo Rodríguez
df5fc2304a Merge pull request #2289 from bar/2.5-optimize-dbosource
First part of the DboSource cleanup.
2013-11-21 01:02:36 -08:00
mark_story
ec38ee1c48 Only enable cacheSources if both the datasource + model agree on it.
This prevents models from flipping cacheSources on when the datasource
has it disabled already.

Refs #2364
2013-11-19 17:36:20 -05:00
ADmad
dda6080579 Merge branch 'master' into 2.5 2013-11-19 00:27:12 +05:30
Eric Büttner
1e3865acc7 formatting app::uses blocks (refs #2265) 2013-11-18 11:56:00 +01:00
imsamurai
20dc92291e fix broken test 2013-11-17 23:34:22 +02:00
imsamurai
0286e4120d fix code style 2013-11-17 23:12:51 +02:00
imsamurai
8bcfe452da not add unsigned to not numeric fields, fix broken test, add new test 2013-11-17 23:10:53 +02:00
imsamurai
2f6122cb01 add unsigned property in Model::describe 2013-11-17 22:37:01 +02:00
imsamurai
00fb663f90 remove numeric from unsigned config 2013-11-17 21:23:13 +02:00
mark_story
016c3aed44 Add test for saveAssociated and expression objects.
Add a test for #1514. This issue was fixed during recent refactorings.

Closes #1514
2013-11-16 10:51:14 -05:00
Mark Story
17ae40f0ce Merge pull request #2319 from ravage84/php-5-removal
Removed "PHP 5" from file header DocBlocks
2013-11-14 06:41:31 -08:00
imsamurai
f1a2c1a75c add decimal type for unsigned 2013-11-14 10:56:51 +02:00
imsamurai
15805e668e fix phpcs errors 2013-11-14 02:39:16 +02:00
imsamurai
87fef89737 fix phpcs errors 2013-11-14 02:19:31 +02:00
imsamurai
fd64d952b5 change position from afterDefault to beforeDefault during to wrong order, add test 2013-11-14 01:36:27 +02:00
imsamurai
e35823e72a fix tests, add numeric type for unsigned 2013-11-14 01:33:11 +02:00
imsamurai
5a40944a6f fix test name testBuildColumn3 to testBuildColumnUnsigned 2013-11-14 01:20:21 +02:00
imsamurai
2fcb4c3c6c - change check to strict for options of $fieldParameters
- add `types` parameter and strict check if it present in `$fieldParameters` (if it present and not contain column type field parameter will be skipped)
- add `noVal` parameter to `$fieldParameters` if it present and not empty value of this parameter from column will be ignored
- add `unsigned` column type for integer, float and biginteger. If it set to `true` an 'UNSIGNED' will be add in sql column part, if not set or set not to `true` this parameter will be skipped
2013-11-14 01:11:30 +02:00
Marc Würth
7018997979 Fixed some copyright and license statements in the file header DocBlocks 2013-11-14 00:07:03 +01:00
Marc Würth
7cfa0116f4 Removed "PHP 5" from file header DocBlocks
This statement does not serve a purpose anymore.
In a long forgotten world it indicated the main version number of PHP which the code in the file was compatible to.
http://pear.php.net/manual/en/standards.sample.php
But since PHP 5.1 and later this is only marginally true.
Thus I propose to remove it from CakePHP.
2013-11-13 22:58:39 +01:00
Marc Würth
ce47890e98 Replaced all remaining license references to the Open Group Test Suite License with the MIT License 2013-11-13 18:52:06 +01:00
Ber Clausen
b35c9671ad Explicitly build SQL statements, calling buildAssociationQuery(). 2013-11-11 23:27:50 -03:00
Ber Clausen
64f34b75a2 Fix a couple of failing tests. 2013-11-11 23:27:50 -03:00
Ber Clausen
53c6df554c Remove unused $resultSet argument from generateAssociationQuery(). 2013-11-11 23:27:50 -03:00
ADmad
d9ca148499 Merge branch 'master' into 2.5
Conflicts:
	CONTRIBUTING.md
	lib/Cake/Model/Model.php
	lib/Cake/VERSION.txt
2013-10-30 02:34:09 +05:30
Robert Sworder
456645d7ad Update tests for incorrect containable behaviour if a model only finds 1 field. 2013-10-25 15:15:52 +01:00
Marc Würth
3773311cc0 Normalized associated models in unbindModel.
Resolves #1764

 Had to cast $models to an array since ``Hash::normalize()`` doesn't support strings which ``Set::normalize()`` does (but which is deprecated).
 Reused existing tests.
2013-10-24 15:28:31 +02:00
Frank de Graaf
ab89f6ec97 Makes DboSource less string dependent. 2013-10-22 16:43:32 +02:00
mark_story
5a394c379a Merge branch 'master' into 2.5 2013-10-14 22:57:50 -04:00
Mark Story
ce74153389 Merge pull request #1691 from uzyn/2.5-decimal
Add support for decimal type in Schema.

Fixes #3171
2013-10-14 08:36:15 -07:00
euromark
1cb24ae537 CS fixes using phpcs-fixer auto-correction. 2013-10-12 01:27:00 +02:00
Jose Lorenzo Rodriguez
df549898ad Merge remote-tracking branch 'origin/2.5' into k-halaburda-master 2013-10-12 01:05:02 +02:00
Jose Lorenzo Rodriguez
9673048c30 Merge branch 'master' of github.com:k-halaburda/cakephp into k-halaburda-master 2013-10-12 01:03:20 +02:00
Jose Lorenzo Rodriguez
63b65e2f69 Fixing CS 2013-10-12 00:58:14 +02:00
José Lorenzo Rodríguez
8cdbafd312 Merge pull request #1631 from ovidiupruteanu/patch-2
flushMethodCache not working if called before cacheMethod
2013-10-11 15:56:19 -07:00
Bryan Crowe
81c2e9db84 Capitalize UUID acronym 2013-10-08 21:46:30 -04:00
euromark
b5bd087bc5 Replace deprecated methods. 2013-10-08 20:23:57 +02:00
Bryan Crowe
c1dd0e4393 Changed url to URL where appropriate 2013-10-07 23:17:58 -04:00
euromark
381a8c1216 Simplify test. 2013-10-08 00:47:47 +02:00
euromark
35ca40635e Add doc block 2013-10-08 00:32:11 +02:00
euromark
c621985f69 Fix whitelist to be modifiable from behaviors to work with validate. 2013-10-07 23:45:27 +02:00
euromark
7b57df5554 Correct method names and missing parent calls. 2013-10-07 20:24:28 +02:00
ovidiupruteanu
dd3b1e41bc Test case for DboSource::flushMethodCache 2013-10-01 21:34:40 +03:00
U-Zyn Chua
e527506c39 MySQL: Numeric data type now supported under decimal column. #3171 2013-09-28 23:05:53 +08:00
U-Zyn Chua
c74c8d49a1 Decimal support for SQLite. #3171 2013-09-28 14:36:55 +08:00
U-Zyn Chua
e0eb8f8e18 Added decimal CakeSchema test case and DatatypeFixture. #3171 2013-09-28 14:29:39 +08:00
U-Zyn Chua
a1a3e70039 Decimal support for PostgreSQL. #3171 2013-09-28 14:07:00 +08:00
mark_story
5e9b22271a Merge branch 'master' into 2.5 2013-09-27 22:26:33 -04:00
U-Zyn Chua
7fb51ab50f Decimal support for MySQL. #3171 2013-09-28 09:23:46 +08:00
euromark
9a86f7e883 correct spelling mistake 2013-09-27 20:28:03 +02:00
Frank de Graaf
41a7739b69 Merge pull request #1686 from andydhobbs/ticket-4108
Fixes bad merge of #1683.

Refs #4108.
2013-09-27 05:53:10 -07:00
Andy Hobbs
56f1c9b8b5 Ticket 4108
- updated DboSourceTest::testFieldsCacheKeyWithSchemanameChange() to skip for Postgres and Sqlserver
2013-09-27 13:03:32 +01:00
Renan Gonçalves
bd1c0b18ff Merge pull request #1679 from dereuromark/master-cleanup-tests
Don't use comp. wrappers anymore.
2013-09-27 04:10:39 -07:00
mark_story
cc5795c67d Merge branch 'master' into 2.5 2013-09-26 10:07:10 -04:00
Andy Hobbs
0f7d6a90a1 Ticket 4108
- Added schemaName to DboSource::fields() method cache key to fix bug with changing schema name
2013-09-26 11:56:14 +01:00
euromark
9844da8e99 Don't use comp. wrappers anymore. 2013-09-25 20:58:29 +02:00
mark_story
d2577fac60 Merge branch 'master' into 2.5 2013-09-21 20:01:50 -04:00
euromark
f62f46562c add missing create() for creating a new record. 2013-09-19 00:23:56 +02:00
euromark
17bd465cae simplify tests 2013-09-19 00:17:21 +02:00
ADmad
1d89ee1c6d Fixed TreeBehavior::recover() when using scope. Fixes #4062. 2013-09-19 00:39:19 +05:30
mark_story
a7a6fcae8a Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/VERSION.txt
2013-09-17 10:11:24 -04:00
euromark
e3a3946e89 address casting cs 2013-09-17 15:15:25 +02:00
euromark
382f75dbfc cs corrections, bool to boolean and int to integer. 2013-09-17 14:44:34 +02:00
mark_story
a2bd91638e Merge branch 'master' into 2.5 2013-09-12 19:47:13 -04:00
euromark
beff12d8a5 add missing params for parent call 2013-09-10 21:19:30 +02:00
Ber Clausen
0a52061d86 Update afterFind() callback signature to be PHP5.4+ compliant. 2013-09-10 14:15:01 -03:00
Ber Clausen
867d4b312d Update afterSave() callback signature to be PHP5.4+ compliant. 2013-09-09 21:34:11 -03:00
Ber Clausen
98a32c334a Fix CS. 2013-09-09 21:25:22 -03:00
mark_story
5210f831c8 Add test for insertMulti with id in the last spot.
Both tests work, so there are no changes to the implementation.

Closes #4048
2013-09-09 19:43:15 -04:00
mark_story
2fc3222322 Fix whitespace. 2013-09-09 12:20:54 -04:00
ovidiupruteanu
7019c79b81 Quoting test for null value and string column 2013-09-09 17:14:09 +03:00
ADmad
c27aa99af9 Merge branch 'master' into 2.5 2013-09-08 20:36:40 +05:30
Mark Story
66394f2201 Merge pull request #1610 from bar/php54-callback-signatures
Update Model/Behaviors callback signature to be PHP5.4+ compliant.

This may require updates to userland behaviours.
2013-09-05 11:11:15 -07:00
mark_story
6a6371b2d4 Fix CROSS JOINs
While seldomly used, CROSS joins should not generate invalid SQL.

Fixes #4050
2013-09-05 12:45:48 -04:00
Ber Clausen
c524645738 Update Model/Behaviors callback signature to be PHP5.4+ compliant. 2013-09-05 11:17:02 -03:00
mark_story
59bb05b433 Merge branch 'master' into 2.5
Conflicts:
	lib/Cake/VERSION.txt
2013-09-02 11:35:09 -04:00
euromark
eb71eeeac5 add scope for generateTreeList - resolves ticket 4028 2013-09-01 01:02:26 -07:00
mark_story
130ccf4714 Merge branch '2.4' into 2.5 2013-08-28 12:35:17 -04:00
mark_story
f18d354f55 Merge branch 'master' into 2.4 2013-08-28 12:35:07 -04:00
mark_story
c1ae41da51 Correctly generate bigint primary keys in sqlite.
generate bigint primary keys correctly. Autoincrement cannot be set as
it only works with INTEGER columns[1]. I decided to use some string
manipulations as the entire SQL generation bits are a bit janky and I've
already re-written them for 3.0.

[1] https://www.sqlite.org/autoinc.html

Closes #GH-1552
2013-08-27 18:11:04 -04:00
Chen Cohen
a0014e7a30 Ticket 4011 - Adding matchers support for Hash::remove() and Hash::insert() 2013-08-24 02:02:01 +03:00
mark_story
53d265cfba Merge branch 'master' into 2.4 2013-08-23 12:56:43 -04:00
euromark
036954b52d remove duplicate newlines according to CS 2013-08-20 20:27:06 +02:00
k-halaburda
9ad75e078a Successfully :) 2013-08-19 08:29:39 +02:00
k-halaburda
9536b3cacd Successfully 2013-08-19 08:11:45 +02:00
mark_story
0f2d59d987 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Network/CakeResponse.php
	lib/Cake/TestSuite/CakeTestCase.php
2013-08-18 23:10:08 -04:00
mark_story
675f828e16 Remove insertQuery and deleteQuery.
These properties were never implemented and are misleading when people
try to use them.

Closes #3997
2013-08-18 21:37:37 -04:00
k-halaburda
2166b397bc Successfully 2013-08-18 17:43:26 +02:00
k-halaburda
39f9d40be4 Fixed formaiing and Successfully 2013-08-18 17:41:43 +02:00
k-halaburda
2a27b37a43 New line on end 2013-08-18 17:37:34 +02:00
euromark
47e8e0c57a simplyfy test and correct some test param orders 2013-08-16 20:51:11 +02:00
mark_story
3244b9e3d7 Merge branch 'master' into 2.4 2013-08-16 14:47:01 -04:00
euromark
6cf147e8c8 unify null checks - avoid method call in favor of strict check 2013-08-16 20:12:49 +02:00
k-halaburda
391d997c27 Fixed some formatting 2013-08-16 10:02:50 +02:00
k-halaburda
180ecb7929 Fixed some formatting 2013-08-16 10:02:11 +02:00
k-halaburda
f5daf1c8aa Fixed some formatting 2013-08-16 09:51:01 +02:00
k-halaburda
d7dab3282f Remove added fixtures and use existing. Updated one old test to add data from afterFind callback 2013-08-16 09:28:32 +02:00
Mischa ter Smitten
0e49a23065 Makes the locale test not always pass, be verbose when it is skipped. 2013-08-14 22:32:04 +02:00
k-halaburda
1d9bce34d4 Formatting issues 2013-08-13 13:01:38 +02:00
k-halaburda
2235a0e677 Formatting issues 2013-08-13 13:00:12 +02:00
k-halaburda
50cf070727 Formatting issues 2013-08-13 12:59:30 +02:00
k-halaburda
a6efcae625 Deleted rows in ModelReadTest 2013-08-13 12:32:36 +02:00
k-halaburda
39b202a4a9 Added some tests to related models afterFind callback 2013-08-13 10:04:17 +02:00
k-halaburda
8e40a3a3d3 Added some tests for related models afterFind callback 2013-08-13 09:29:14 +02:00
Jose Lorenzo Rodriguez
9d07fc4330 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Console/ShellDispatcher.php
	lib/Cake/Utility/CakeNumber.php
	lib/Cake/View/Elements/sql_dump.ctp
2013-08-11 23:31:10 +02:00
euromark
1339a9dfe1 coding standards according to new sniffer rules 2013-08-08 01:03:21 +02:00
ADmad
38b050a711 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Console/Command/ConsoleShell.php
2013-08-04 19:26:55 +05:30
Christian Winther
cd44c2afae Merge pull request #1472 from ADmad/bugfix/3948
Fixed bug when using multi model fieldList and whitelists for all models...
2013-08-03 05:56:22 -07:00
euromark
6c1e60953b fix cs 2013-08-03 03:02:52 +02:00
ADmad
473e4f991f Fixed bug when using multi model fieldList and whitelists for all models are not provided.
Fixes #3948
2013-08-03 02:49:41 +05:30
Christian Winther
227f9aaa88 Merge pull request #1440 from Phally/master-postgres-fails
Adds order to the test models to make the results more predictable.
2013-08-01 02:38:33 -07:00
Mark Story
7269568ae6 Merge pull request #1460 from ravage84/cakeschematest-setup+teardown
Removed unused setup & teardown methods
2013-07-28 17:54:33 -07:00
Marc Würth
3a4f7815e8 Removed unused setup & teardown methods from MyAppSchema in CakeSchemaTest 2013-07-29 01:55:32 +02:00
Marc Würth
1cac1846a3 Added missing calls to setUp & tearDown in tests 2013-07-29 01:52:39 +02:00
Phally
db1876d837 Adds order to the test models to make the results more predictable.
Even though there was some code in place to prevent results in random
order from PostgreSQL we were still experiencing this with Jenkins
and Travis.

This commit removes the old code that handled this. From now on this
will be handled differently. Every test model will order by its
primary key. You can disable this by changing the order property
of the model to `null`: `$testModel->order = null`.
2013-07-19 22:31:09 +02:00
ADmad
d161b21ae1 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Controller/Component/AuthComponent.php
2013-07-14 10:58:55 +05:30
euromark
a643295e4c remove @access and unnecessary $name 2013-07-08 15:50:50 +02:00
ADmad
4ded269549 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Controller/Component/Auth/BlowfishAuthenticate.php
	lib/Cake/VERSION.txt
2013-07-07 12:22:12 +05:30
euromark
af455b4121 correct return types in doc blocks 2013-07-05 17:19:22 +02:00
euromark
ba02678693 doc block corrections 2013-07-05 16:17:23 +02:00
euromark
e7f380d2b7 doublespace to single space 2013-07-05 14:36:40 +02:00
mark_story
c597855fe4 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Test/Case/Network/CakeRequestTest.php
2013-07-03 14:21:09 -04:00
euromark
a90cb29c0f simplify else cases 2013-07-03 01:14:41 +02:00
euromark
7cb19b97db coding standards and simplification of else cases as well as some minor fixes 2013-07-03 00:52:48 +02:00
mark_story
f09693f6e8 Merge branch 'master' into 2.4 2013-06-29 23:26:26 -04:00
Marc Würth
9591f55394 Annotated testReconnect 2013-06-27 17:15:56 +02:00
Marc Würth
2609016dfe Changed http links to lighthouse, groups.google and github to https
Because they get redirected anyway and we should follow good practices.
Also in many cases similar URLs were already using https
2013-06-25 22:58:30 +02:00
Juan Basso
19c94d0211 Fixed default datestyle for postgres tests 2013-06-25 00:15:03 -04:00
Juan Basso
accc98f55d Resetting the datestyle to not affect other tests 2013-06-24 23:36:40 -04:00
mark_story
dcf7df39d2 Merge branch 'master' into 2.4 2013-06-21 17:47:37 -04:00
mark_story
94815a74f1 Add ordering to prevent occasional pgsql failures. 2013-06-21 17:47:08 -04:00
ADmad
12da3b1f27 Merge branch 'master' into 2.4 2013-06-16 13:07:44 +05:30
mark_story
1c358c0f53 Add tests for Model::clear() 2013-06-14 09:21:20 -04:00
Rik van der Heijden
e7d2892e81 Fixed unit-test locales 2013-06-11 20:18:40 +02:00
mark_story
cd3c54bb9d Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/VERSION.txt
2013-06-10 22:12:10 -04:00
euromark
42777b7809 incorrect tab to space - whitespace coding standards 2013-06-09 21:01:01 +02:00
euromark
4518624187 more whitespace coding standard corrections 2013-06-09 17:39:48 +02:00
ADmad
636cc8c103 Merge branch 'master' into 2.4 2013-06-09 18:08:32 +05:30
euromark
394bf1054d remove name attribute where not necessary, clean up doc blocks 2013-06-08 04:29:08 +02:00
Jose Lorenzo Rodriguez
f14c55916f Repeating previous change for SQLite, so it passes on PHP 5.5 2013-06-06 18:12:07 +02:00
Jose Lorenzo Rodriguez
04a6bfbda6 Fixing postgres test for PHP 5.5 2013-06-06 17:55:55 +02:00
Jose Lorenzo Rodriguez
51af8800f2 Rewriting assertion to account for the actual case and not breaking in
PHP 5.5
2013-06-06 17:45:52 +02:00
mark_story
cbf3228c34 Fix inconsistent name/alias usage.
TranslateBehavior should always use name instead of alias when
creating/updating/saving new translate records. It already uses name
when finding translations and the mismatch was causing translations to
not be found when saved from an aliased model.

Thanks to Joost de Keijzer for providing the initial patch.

Fixes #3865
2013-06-02 13:50:23 -04:00
ADmad
3303a2cda1 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php
	lib/Cake/Console/Templates/skel/Config/Schema/i18n.php
	lib/Cake/Console/Templates/skel/Config/Schema/sessions.php
	lib/Cake/Console/Templates/skel/Config/acl.ini.php
	lib/Cake/Console/Templates/skel/Config/acl.php
	lib/Cake/Console/Templates/skel/Config/bootstrap.php
	lib/Cake/Console/Templates/skel/Config/core.php
	lib/Cake/Console/Templates/skel/Config/database.php.default
	lib/Cake/Console/Templates/skel/Config/email.php.default
	lib/Cake/Console/Templates/skel/Config/routes.php
	lib/Cake/Console/Templates/skel/Console/Command/AppShell.php
	lib/Cake/Console/Templates/skel/Console/cake.bat
	lib/Cake/Console/Templates/skel/Console/cake.php
	lib/Cake/Console/Templates/skel/Controller/AppController.php
	lib/Cake/Console/Templates/skel/Controller/PagesController.php
	lib/Cake/Console/Templates/skel/Model/AppModel.php
	lib/Cake/Console/Templates/skel/View/Errors/error400.ctp
	lib/Cake/Console/Templates/skel/View/Errors/error500.ctp
	lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php
	lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/default.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/error.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp
	lib/Cake/Console/Templates/skel/View/Pages/home.ctp
	lib/Cake/Console/Templates/skel/index.php
	lib/Cake/Console/Templates/skel/webroot/index.php
	lib/Cake/Console/Templates/skel/webroot/test.php
2013-06-02 18:03:59 +05:30
Marc Würth
4c9f0414cb Improved the DocBlocks and other code cleanup
Fixed @license tag, url comes first
Whitespace and other minor code cleanup
Added some docblocks
2013-05-31 00:11:19 +02:00
Christian Winther
ef8603e1a7 Add unit test 2013-05-28 12:02:58 +00:00
ADmad
fb86859585 Merge branch 'master' into 2.4 2013-05-19 14:37:41 +05:30
euromark
97c2cb367d CS fixes 2013-05-17 10:36:17 +02:00
ADmad
a10275fb8b Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php
2013-05-05 14:36:46 +05:30
Rik van der Heijden
dddf8aafb9 Fixed curly brackets at a few class definitions 2013-05-04 13:23:58 +02:00
ADmad
db26e24cb7 Remove error setting when reading/deleting non-existent key.
Fixes #3813
2013-05-04 03:16:33 +05:30
mark_story
d4036310e4 Update limit() for Postgres
It should work like the parent class.
2013-05-02 23:27:26 -04:00
mark_story
00569ea405 Update limit() for Sqlite.
It should behave as the parent class does.
2013-05-02 23:25:13 -04:00
mark_story
2096d3f632 Clamp limit values to be unsigned integers.
This solves large page numbers potentially turning into scientific
notation when being formatted into queries. It also further safeguards
against SQL manipulation.

Refs #GH-1263
2013-05-02 22:36:50 -04:00
ADmad
19f8274a95 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/VERSION.txt
2013-04-25 03:06:04 +05:30
euromark
48fa358260 Remove leftover param that is now wrongly triggering "strict" 2013-04-22 11:36:17 +02:00
ADmad
06a5c509c0 Merge branch 'master' into 2.4 2013-04-21 19:15:55 +05:30
Ceeram
842b1802d9 add assert that habtm save does not return false 2013-04-19 19:37:23 +02:00
mark_story
0f3d28c6ea Fix condition parsing in mysql specific cases.
When using collation + array values the incorrect operator would be
used. IN should be used over =.

Fixes #3772
2013-04-18 21:52:22 -04:00