Generating the various permutations a priori is incredibly expensive
with sets of attributes. Using nested loops that look for matches is
more efficient.
Add replacments for `.*` and `.+` in preg:/ prefixed attribute matchers
so they do not greedily eat all content. This also requires that preg:/
based attribute matchers *must* be quoted.
Fixes#3072
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.
Otherwise there can be significant differences in behavior between using
an unmodifiedcomponent in testAction and using a mock as the config will not be
propogated from the controller
Getting the following warning:
ReflectionException: Class Mock_Foo_e187b1d1 does not have a
constructor, so you cannot pass any constructor arguments
Is a much less obvious way of saying "the class you're trying to mock
doesn't exist". Be more explicit
Add setter method as changing ComponentCollection's constructor now is
not possible. This fixes issues where components that rely on
Collection->getController() in their constructor can work properly.
Fixes#3946
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`.
Mocked components should be enabled so they receive callbacks. This
allows more realistic integration tests using testAction(). Stop
disabling the constructor as it causes a number of errors with
components that use components.
Fixes#3842
Doing a class_exists() check is a simple way to check for PHPUnit being
installed via an autoloader. It also keeps things compatible with
a Vendor dir installation.
Fixes#3721
Previously, the field order was effectively taken from the last record in the fixture, but the values were ordered according to the array_unique call above - primarily determined by the first record in the fixture. If these two orders differed, values were added under the wrong keys.