The Memcached extension does not provide enough information to PHP's
Reflection API to allow mock objects to be generated correctly. We'll
skip the affected tests until php-memcached-dev/php-memcached#126 has
been resolved.
Because getMockForModel() does not go through the test datasource
injection in ClassRegistry::init() we need to duplicate the basics of
that logic here. Thankfully, we already have a mock so we can do that
datasource switching without reflection. Of course this means there will
be limitations to how/when this will work, but I feel those scenarios
can probably be solved by not using mocks, or by mocking out the
problematic methods. This set of changes makes getMockForModel() work
with secondary datasources, as one would expect it to do, but I'm not
sure it ever did.
Refs #4694
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
This reverts commit 8507ef83f1.
Incorrect header was used for this test, Cake cannot safely determine correct header.
To get CakePHP to respond with json, you can modify the angular common headers.
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.
Since both metadata and word ending in metadata have caused issues in
the past, uninflecting them seems like the best option. This will also
cover cases like ProfileData not being inflected to ProfileDatum which
seems like an improvement to me.
Fixes#4419
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.
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
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.
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