Running codeception in advanced app


(Marcelo de Andrade) #1

I have a database, with a tbl_user created. And when i start codecept:




#/tests/codeception/backend

codecept run



i receive the error bellow, trying drop down my table. Whats going wrong?




  [yii\db\IntegrityException]                                                                                                                 

  SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`id5_portal`.`  

  tbl_finlegado_cliente_usuario`, CONSTRAINT `FK_USER` FOREIGN KEY (`user_id`) REFERENCES `tbl_user` (`id`))                                  

  The SQL being executed was: DELETE FROM `tbl_user`                                                                                          

                                                                                                                                              




Exception trace:

 () at /var/www/CliPainel/vendor/yiisoft/yii2/db/Schema.php:628

 yii\db\Schema->convertException() at /var/www/CliPainel/vendor/yiisoft/yii2/db/Command.php:791

 yii\db\Command->execute() at /var/www/CliPainel/vendor/yiisoft/yii2/test/ActiveFixture.php:114

 yii\test\ActiveFixture->resetTable() at /var/www/CliPainel/vendor/yiisoft/yii2/test/ActiveFixture.php:76

 yii\test\ActiveFixture->load() at /var/www/CliPainel/vendor/yiisoft/yii2/test/FixtureTrait.php:93

 tests\codeception\common\_support\FixtureHelper->loadFixtures() at /var/www/CliPainel/tests/codeception/common/_support/FixtureHelper.php:38

 tests\codeception\common\_support\FixtureHelper->_beforeSuite() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Subscriber/Module.php:32

 Codeception\Subscriber\Module->beforeSuite() at n/a:n/a

 call_user_func() at /var/www/CliPainel/vendor/symfony/event-dispatcher/EventDispatcher.php:181

 Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() at /var/www/CliPainel/vendor/symfony/event-dispatcher/EventDispatcher.php:46

 Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/SuiteManager.php:157

 Codeception\SuiteManager->run() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Codecept.php:175

 Codeception\Codecept->runSuite() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Codecept.php:158

 Codeception\Codecept->run() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Command/Run.php:263

 Codeception\Command\Run->runSuites() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Command/Run.php:192

 Codeception\Command\Run->execute() at /var/www/CliPainel/vendor/symfony/console/Command/Command.php:259

 Symfony\Component\Console\Command\Command->run() at /var/www/CliPainel/vendor/symfony/console/Application.php:841

 Symfony\Component\Console\Application->doRunCommand() at /var/www/CliPainel/vendor/symfony/console/Application.php:192

 Symfony\Component\Console\Application->doRun() at /var/www/CliPainel/vendor/symfony/console/Application.php:123

 Symfony\Component\Console\Application->run() at /var/www/CliPainel/vendor/codeception/codeception/codecept:27







                                                                                                                                              

  [PDOException]                                                                                                                              

  SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`id5_portal`.`  

  tbl_finlegado_cliente_usuario`, CONSTRAINT `FK_USER` FOREIGN KEY (`user_id`) REFERENCES `tbl_user` (`id`))                                  

                                                                                                                                              




Exception trace:

 () at /var/www/CliPainel/vendor/yiisoft/yii2/db/Command.php:781

 PDOStatement->execute() at /var/www/CliPainel/vendor/yiisoft/yii2/db/Command.php:781

 yii\db\Command->execute() at /var/www/CliPainel/vendor/yiisoft/yii2/test/ActiveFixture.php:114

 yii\test\ActiveFixture->resetTable() at /var/www/CliPainel/vendor/yiisoft/yii2/test/ActiveFixture.php:76

 yii\test\ActiveFixture->load() at /var/www/CliPainel/vendor/yiisoft/yii2/test/FixtureTrait.php:93

 tests\codeception\common\_support\FixtureHelper->loadFixtures() at /var/www/CliPainel/tests/codeception/common/_support/FixtureHelper.php:38

 tests\codeception\common\_support\FixtureHelper->_beforeSuite() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Subscriber/Module.php:32

 Codeception\Subscriber\Module->beforeSuite() at n/a:n/a

 call_user_func() at /var/www/CliPainel/vendor/symfony/event-dispatcher/EventDispatcher.php:181

 Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() at /var/www/CliPainel/vendor/symfony/event-dispatcher/EventDispatcher.php:46

 Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/SuiteManager.php:157

 Codeception\SuiteManager->run() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Codecept.php:175

 Codeception\Codecept->runSuite() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Codecept.php:158

 Codeception\Codecept->run() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Command/Run.php:263

 Codeception\Command\Run->runSuites() at /var/www/CliPainel/vendor/codeception/codeception/src/Codeception/Command/Run.php:192

 Codeception\Command\Run->execute() at /var/www/CliPainel/vendor/symfony/console/Command/Command.php:259

 Symfony\Component\Console\Command\Command->run() at /var/www/CliPainel/vendor/symfony/console/Application.php:841

 Symfony\Component\Console\Application->doRunCommand() at /var/www/CliPainel/vendor/symfony/console/Application.php:192

 Symfony\Component\Console\Application->doRun() at /var/www/CliPainel/vendor/symfony/console/Application.php:123

 Symfony\Component\Console\Application->run() at /var/www/CliPainel/vendor/codeception/codeception/codecept:27




run [-c|--config CONFIG] [--report] [--html [HTML]] [--xml [XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-sg|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--no-rebuild] [--] [<suite>] [<test>]