Codeception seeInDatabase() doesn't work for me

后端 未结 2 517
猫巷女王i
猫巷女王i 2021-01-15 12:47

I am really stuck with this acceptance test.

My code is this

$I->click(\'Submit\');
$I->see(\'Client Added\');
$I->seeInDatabase(\'customers         


        
2条回答
  •  鱼传尺愫
    2021-01-15 13:47

    According the documentation

    cleanup: true - all db queries will be run in transaction, which will be rolled back at the end of test.

    So normally something like this should work (functional.suite.yml)

    class_name: TestGuy
    modules:
        enabled: [Filesystem, TestHelper, Laravel4, Db]
        config:
            Laravel4:
                cleanup:false
    

    But in my case didn't solve anything. So I forced it by altering line 59 in /Module/Laravel4.php

    cleanup = true
    
    TO
    
    cleanup  = false
    

    And finally, I have a fix for this issue, although its not the ideal because of composer updates.

提交回复
热议问题