Hi, thanks for getting back to me.

I definitely have all my models listed in the fixtures collection.
What we just discovered after a lot of testing is that it had to do
with $useTable being set to false. For some reason that just throws
everything out of whack. If anybody gets this in the future, remember
that when using fixtures/designing models that you don't need to put
$useTable=false in, as you're technically using test tables!

Cheers.

On Aug 5, 5:41 pm, jharris <funeralm...@gmail.com> wrote:
> My best guess, without seeing your test case or fixtures, is that you
> need to add the fixture to your $fixtures var in your test case.
>
> i.e.,
>
> class MenuItemTestCase extends CakeTestCase {
>   var $fixtures = array('app.menu_item', 'app.alias');
>
> }
>
> After doing that, they should load into the test DB. Whether or not
> you choose to load them manually or automatically (default) is up to
> you. I'm fairly new to unit testing but it's been my experience so far
> that if a fixture model is related in any way to another model, you'll
> need to include that in your $fixtures var as well. In my case, I have
> to include every model into the $fixtures var.
>
> hth,
> jeremy
>
> On Aug 4, 7:43 am, generaltao <general...@gmail.com> wrote:
>
>
>
> > Hi all,
>
> > Having a strange problem with test cases here. We have two tables in
> > question in this one example -> Alias and MenuItem.
>
> > - Alias belongsTo MenuItem
> > - MenuItem hasMany Alias
>
> > I am running model test cases on Alias itself. Problem is that if I
> > define the "MenuItem hasMany Alias" relationship in the MenuItem
> > itself I get a full-stop error saying
>
> > "Database table aliases for model Alias was not found."
>
> > This is quite obviously bizarre, especially because the prob seems to
> > come from MenuItem model itself. Specific points that are bizarre
> > about this
>
> > 1) For some reason it seems to outright forget to use
> > test_suite_aliases instead of Alias (I have no tables defined for
> > Alias, hence using fixtures!)
>
> > 2) I never say in my fixtures to import the model! I was under the
> > impression you needed to do "var $import" in the fixture to tell it to
> > import model, records, etc. but I'm not doing so in either fixture
> > here. The only thing I have in my fixtures is the standard $name,
> > $records, and $fields.
>
> > Can anyone shed some light on this situation? Why is it "forgetting"
> > to use test_suite_alias if the hasMany is defined in the model? Why is
> > it using model stuff to begin with?
>
> > Cheers!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to