Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

SoftDeleteBehavior & Unit Testing = Error: Table users for model User was not found in datasource test. #138

@ravage84

Description

@ravage84

I ran into the following problem using the SoftDeleteBehavior:

When a model has an association with another one and you want to unit test one of them, you will run into an error message like:

Error: Table users for model User was not found in datasource test.

I created a test app to showcase the problem:
https://github.com/ravage84/softdeletebbehavior-prob

Way to reproduce:

  • Checkout repo
  • Create DBs for default & test datasource
  • Setup database config
  • php console\cake.php schema create
  • php console\cake.php test app Model/Post --stderr

Tested with CakePHP 2.6.1, 2.6.5, 2.5.8 & 2.4.10.using the dev-master of CakeDCs SoftDeleteBehavior or @dereuromark 's version at https://github.com/dereuromark/cakephp-tools/blob/2.5/Model/Behavior/SoftDeleteBehavior.php

The problem was already mentioned here:
dereuromark/cakephp-tools#135

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions