# |
Apr 22nd 2017, 16:24 |
dereuromark |
hah ok :slightly_smiling_face: |
# |
Apr 22nd 2017, 16:24 |
admad |
@dereuromark on mobile :) |
# |
Apr 22nd 2017, 16:01 |
dereuromark |
@admad Are you around? I have seen your i18n extractor and reader. |
# |
Apr 22nd 2017, 15:25 |
chrisso |
`Argument 1 passed to Cake\ORM\Behavior::__construct() must be an instance of Cake\ORM\Table, none given, called in /home/vagrant/Apps/tools.dev/tests/TestCase/Model/Behavior/CsvImportBehaviorTest.php on line 28 and defined in [/home/vagrant/Apps/tools.dev/vendor/cakephp/cakephp/src/ORM/Behavior.php, line 152]` |
# |
Apr 22nd 2017, 15:23 |
chrisso |
I have buildt anything into the testcase yet, just baked it so far. |
# |
Apr 22nd 2017, 15:22 |
chrisso |
I had, but don't need it. Any thought why I still get errors on __construct() ? |
# |
Apr 22nd 2017, 15:22 |
chrisso |
When I run ImportBehavior test, it keeps telling me __construct() has to be an instance of Cake/ORM/Table. I don't have __construct() in my behavior class. |
# |
Apr 22nd 2017, 15:06 |
chrisso |
I see @jojomartius ;) |
# |
Apr 22nd 2017, 14:23 |
jojomartius |
and it cake2 it was easy to load data from a second database, cake3 can only load db structur from a second database :S |
# |
Apr 22nd 2017, 14:22 |
jojomartius |
mh yes, that worked for me some time, but some day i saw that for me its easier if i've one database that containing the test data and my cake3 and my older cake2 app can run against the same set of data |
# |
Apr 22nd 2017, 14:21 |
chrisso |
I'm working with a test app now to do some test codes. Trying to make faker work. |
# |
Apr 22nd 2017, 14:20 |
chrisso |
I'm just at the beginning of testing, so has no experience with it. I guess using actual data might save time, but you are able to produce the same fixture with the TestFixture |
# |
Apr 22nd 2017, 14:17 |
jojomartius |
and its also not good if different systems have the same requirements to handle that data |
# |
Apr 22nd 2017, 14:17 |
jojomartius |
definding records in the fuxture itself is not good if its complex test data |
# |
Apr 22nd 2017, 14:16 |
jojomartius |
yes |
# |
Apr 22nd 2017, 14:15 |
chrisso |
You want to retreive actual data from main db when doing tests? |
# |
Apr 22nd 2017, 14:13 |
jojomartius |
but anyway maybe we should bring something to load fixtures from db back in the system :-d its not good when people like me writing stuff like this |
# |
Apr 22nd 2017, 14:13 |
chrisso |
Some might think, I don't ;) |
# |
Apr 22nd 2017, 14:12 |
jojomartius |
stupid thing.. i know |
# |
Apr 22nd 2017, 14:11 |
chrisso |
Ah, allright :slightly_smiling_face: |
# |
Apr 22nd 2017, 14:11 |
jojomartius |
and of course that function triggeres a find :) |
# |
Apr 22nd 2017, 14:11 |
jojomartius |
i wrote a little helper to load the fixtures record from the database :) |
# |
Apr 22nd 2017, 14:11 |
chrisso |
What was the issue? |
# |
Apr 22nd 2017, 14:10 |
jojomartius |
:P yes.... but i figured it out a second ago... :) |
# |
Apr 22nd 2017, 14:10 |
chrisso |
@jojomartius No worries, just harder to get help :P |
# |
Apr 22nd 2017, 13:55 |
dereuromark |
hiromi2424 we talked about translating PO via db backend the other day right? I started to publish the plugin, in case you are interested |
# |
Apr 22nd 2017, 13:49 |
jojomartius |
and intrestingly calling the same two lines from my controller is doing it in the correct order |
# |
Apr 22nd 2017, 13:46 |
jojomartius |
the issue is, that from my point of view it should first execute the method setRequestingiCompany (there is set some local variables to make sure the user that is requesting is there and in the beforefind i set some extra conditions to make sure he cant see something bad |
# |
Apr 22nd 2017, 13:44 |
jojomartius |
sorry for this@chrisso |
# |
Apr 22nd 2017, 13:44 |
jojomartius |
:P |
# |
Apr 22nd 2017, 13:31 |
chrisso |
@jojomartius You should gist your code, or at least use ``` before and after your code in sublime. Hard reading. |
# |
Apr 22nd 2017, 13:16 |
jojomartius |
no idea? |
# |
Apr 22nd 2017, 12:56 |
slackebot1 |
$this->assertEquals(8, $routes->count()); //$this->Routes->prepareFilter($routes, $filter_id); } And the only thing i did is a vardump in the setRequestingCompany Method as well as in the beforeFind event, and of course i want to get first the execution of my setRequestingCompany, but for some reason its the otherway around... did I something wrong? |
# |
Apr 22nd 2017, 12:56 |
jojomartius |
hey, i worked with models in cakephp3 for quite a while, now i thought testing it would be maybe a nice thing :P unfortunatly everything crahes... after some time of debugging i wondered why ... and it looks like the execution order is a bit different like i expect... public function testAsFirstCompany() { $this->assertTrue( $this->Routes->setRequestingCompany(10) ); $routes = $this->Routes->find();//->contain(['Compan |
# |
Apr 22nd 2017, 11:32 |
ra7bi |
@dereuromark Thanks |
# |
Apr 22nd 2017, 11:15 |
dereuromark |
your IDE should show you in yellow whats wrong - you are missing the obvious classes to be included via use statements |
# |
Apr 22nd 2017, 10:49 |
ra7bi |
``` Argument 1 passed to App\Model\Table\EventsTable::beforeMarshal() must be an instance of App\Model\Table\Event, instance of Cake\Event\Event given, ``` what does this error mean ? My code is ``` public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options) { if (isset($data['start_date'])) { $data['start_date'] = Time::parseDate($data['start_date'], 'YYYY-M-d HH:mm:ss'); } } ``` |
# |
Apr 22nd 2017, 10:22 |
ra7bi |
can i overwrite view template in some input ? |
# |
Apr 22nd 2017, 10:22 |
ra7bi |
i'v create custom view template , in somehow i want to change css class for some element |
# |
Apr 22nd 2017, 10:22 |
ra7bi |
hey |
# |
Apr 22nd 2017, 09:43 |
junior |
once you get a hold of it will make sense :slightly_smiling_face: |