# |
Jul 18th 2017, 11:55 |
neon1024 |
https://github.com/cakephp/cakephp/blob/master/src/TestSuite/TestCase.php#L330-L373 |
# |
Jul 18th 2017, 11:54 |
neon1024 |
Especially considering -> https://stackoverflow.com/a/1732454/234451 |
# |
Jul 18th 2017, 11:54 |
neon1024 |
I’m surprised that the CakeTestCase uses regex to assert on html |
# |
Jul 18th 2017, 11:48 |
neon1024 |
Turns out mocking a Table class is easy now, that’s good news. I had a real challenge last time, in Cake 2 I think, with it needing connection mocks and schema mocks and all kinds of things |
# |
Jul 18th 2017, 11:44 |
neon1024 |
Yes true, can’t argue with that, usually insightful too |
# |
Jul 18th 2017, 11:44 |
admad |
I may not be nice but i am fair :P |
# |
Jul 18th 2017, 11:44 |
neon1024 |
Perhaps my next nonsensical claim can revolve around how hard it is to mock a table class |
# |
Jul 18th 2017, 11:41 |
neon1024 |
At least the test suite is picking up these things |
# |
Jul 18th 2017, 11:40 |
neon1024 |
I’m learning new stuff today. As I’m refactoring an old plugin. There seem to be lots of assumptions in the code |
# |
Jul 18th 2017, 11:40 |
cleptric |
:scream: watch out for that!!! |
# |
Jul 18th 2017, 11:39 |
neon1024 |
Like you’re a nice guy? |
# |
Jul 18th 2017, 11:39 |
admad |
@neon1024 you make one more nonsensical claim and i'll bring back the slapper :slightly_smiling_face: |
# |
Jul 18th 2017, 11:39 |
neon1024 |
Thanks @cleptric |
# |
Jul 18th 2017, 11:38 |
neon1024 |
Oh right, perhaps I should type hint for that instead of ContextInterface |
# |
Jul 18th 2017, 11:36 |
cleptric |
That depends on the context class you’re using. `entity()` only exists in the `EntityContext` class |
# |
Jul 18th 2017, 11:35 |
neon1024 |
I need to parse the entity set to the form in my helper to know which fields to create in the helper |
# |
Jul 18th 2017, 11:34 |
neon1024 |
But it lacks an accessor method |
# |
Jul 18th 2017, 11:34 |
neon1024 |
Presumably because it’s now set to `_form` https://github.com/cakephp/cakephp/blob/master/src/View/Form/FormContext.php#L55 |
# |
Jul 18th 2017, 11:34 |
neon1024 |
In my helper I used this method and now it’s gone? `Error: Call to undefined method Cake\View\Form\FormContext::entity()` |
# |
Jul 18th 2017, 11:02 |
cleptric |
:slightly_smiling_face: |
# |
Jul 18th 2017, 11:02 |
neon1024 |
Ahh, good spot! Thanks @cleptric |
# |
Jul 18th 2017, 11:01 |
cleptric |
But in the core it’s `protected` |
# |
Jul 18th 2017, 10:59 |
neon1024 |
Still in the core, https://github.com/cakephp/cakephp/blob/master/src/View/Helper.php#L58 |
# |
Jul 18th 2017, 10:59 |
neon1024 |
Well that’s an interesting PHPCS error `45 | ERROR | Public member variable "_defaultConfig" must not contain a leading underscore` especially for a helper with the CakePHP coding standard |
# |
Jul 18th 2017, 10:29 |
jojomartius |
hey, i've database issue with CakePHP 2. I managed to connect to an Oracle Database - unfortunately in Oracles SQL "User" is a reservered word. Is it possible to change ne name of the Model which is used by the AuthComponent. Currently cake creates an SQL Query that's basic like this SELECT .. FROM users User WHERE ... and that second word user, makes it impossible to run on oracle :S |
# |
Jul 18th 2017, 10:17 |
neon1024 |
My colleague found a good post on it if anyone is interested, https://lornajane.net/posts/2014/php-5-6-and-the-splat-operator |
# |
Jul 18th 2017, 10:17 |
neon1024 |
`return new $class(...$config);` |
# |
Jul 18th 2017, 10:17 |
neon1024 |
First time using the splat operator! |
# |
Jul 18th 2017, 10:06 |
neon1024 |
Ahh, my bad. I just realised that I’m implementing my own `_create()` method where I can process that array |
# |
Jul 18th 2017, 10:05 |
neon1024 |
Mine doesn’t, as I prefer more explicit params |
# |
Jul 18th 2017, 10:04 |
neon1024 |
So am I right in thinking that this forces each class which is put into the registry to take it’s configuration as an array? https://github.com/cakephp/cakephp/blob/master/src/Core/ObjectRegistry.php#L93 |
# |
Jul 18th 2017, 09:50 |
dereuromark |
You should be able to use a ArrayDatasource or sth here |
# |
Jul 18th 2017, 09:38 |
johnwayne |
I am now making so that I am collecting ids from my array and make where in $thoseIds - than I am getting "normal" cakephp pagination (if you have understood me :) ) |
# |
Jul 18th 2017, 09:36 |
johnwayne |
@dereuromark 3.3.2 |
# |
Jul 18th 2017, 09:31 |
slackebot |
!tell johnwayne about v |
# |
Jul 18th 2017, 09:31 |
slackebot |
Command sent from Slack by dereuromark: |
# |
Jul 18th 2017, 09:24 |
johnwayne |
Is there an easy way to make pagination from an array wich look 100% like cakephp object compatibile with pagination |
# |
Jul 18th 2017, 09:16 |
MartOn |
dakota - I will see.. First I will look into tests and see if its tested |
# |
Jul 18th 2017, 09:13 |
dakota |
If you figure it out, would you be able to add something to the docs? :slightly_smiling_face: |
# |
Jul 18th 2017, 09:12 |
dakota |
Probably is, most of the 2.x tree methods are well tested, but poorly documented |
# |
Jul 18th 2017, 09:12 |
MartOn |
I will se if this is tested in tests |