# ./symfony test:unit

Propel-Exception: Unable to execute DELTE ALL statement [...] Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails.

WHY ist a UNIT TEST reaching out to a REAL data base?
And who in their right mind would create a different data base schema for the tests?
This was with a clone of the real thing. Removing the FK results in double PK-errors...

  • 1
    "if it makes a network call - it's no longer a unit test"
  • 0
  • 0
    Is this symphony or laravel? For my integration tests, they’re ran of an SQLite database instead of dev and production which use MySQL. If laravel, make sure to “use DatabaseTransactions” and “use DatabaseMigrations”. Run php artisan migrate:fresh and give another try
  • 0
    @dUcKtYpEd it's a symfony 1.4 app, that I'm currently porting to 1.5 (unofficial symfony1 fork by the friendsofsymfony account on github) to support php7

    And I have no idea, what the original author was doing back in 2008. He had already left the company when I started here a couple of years ago...
  • 1
    @Sefie aww man I have no experience with symfonies unit testing. It’s one hell of a framework. Emphasis on the hell
Add Comment