Development

#3483 (sfPropelActAsTaggableBehaviorPlugin's unit tests fail)

You must first sign up to be able to contribute.

Ticket #3483 (closed defect: fixed)

Opened 6 days ago

Last modified 2 days ago

sfPropelActAsTaggableBehaviorPlugin's unit tests fail

Reported by: georgsorst Assigned to: xavier
Priority: minor Milestone:
Component: sfPropelActAsTaggablePlugin Version: 1.0.13
Keywords: sfPropelActAsTaggableBehaviorPlugin taggable unit test Cc:
Qualification: Accepted

Description

The plugin's unit tests fail. This seems to have three causes.

First off, since the test script has to be copied from the plugin's test folder to the project's one the $sf_root_dir is defined incorrectly.

Then the test script is not able to get a database connection, failing with "No connection params set for default", even if a default database is defined.

Thirdly the objects created by _create_object() and _create_object_2() are not modified after creation and thus not saved so they cannot be retrieved afterwards so no tag operations can be performed on them. A simple fix is to just modify any column / property of the objects which of course requires that they have another colum besides their id.

I have attached a patch that fixes these issues as long as the test classes ("Post" and "Link" by default) have a "name" column.

Attachments

sfPropelActAsTaggableBehavior_test-unit.patch (1.5 kB) - added by georgsorst on 05/06/08 16:09:14.
Fix for sfPropelActAsTaggableBehavior's unit tests

Change History

05/06/08 16:09:14 changed by georgsorst

  • attachment sfPropelActAsTaggableBehavior_test-unit.patch added.

Fix for sfPropelActAsTaggableBehavior's unit tests

05/06/08 16:56:47 changed by xavier

Hi georgsorst,

Which version of Symfony are you using for running these tests ?

The documentation of the plugin has to be fixed (I'll do it for the next release), because the tests can be runned directly with the command:

$ ./php ./plugins/sfPropelActAsTabbaleBehaviorPlugin/tests/unit/sfPropelActAsTaggableBehaviorTest.php

which runs smoothly.

cheers,

Xavier

05/06/08 18:11:47 changed by georgsorst

Thanks for the swift reply Xavier!

I'm using 1.0.14 currently, but I've had the same errors with 1.0.13. Calling the tests directly results in the same errors except for the first one. As for the database error my configuration might be wrong. Could you probably post your config/databases.yml or whatever file might have an influence on that?

Also, if we figure out where the bugs come from, could you probably update the documentation as far as the tests are concerned before the next release? It seems like a small thing to do but not having this information already cost me quite some time.

Thanks so far.

05/10/08 03:56:07 changed by xavier

  • status changed from new to closed.
  • resolution set to fixed.
  • qualification changed from Unreviewed to Accepted.

fixed in [8887].