Hello

I'm newbie for CakePHP, and have been working for 2,5y with Rails.
We currently have an application developed from scratch by another
team... the code is not very maintainable, and i'd like to refactore
it in order to use Cake.
Before really playing with controllers, views , i wanted to unit test
all my models, having relations between them.

I just have a question about how to use assertTrue in one pass to test
the resultset coming from a query on my Model1, having a hasMany
relation to Model2

When my Model1 did not have any relation i could do :
$conditions = array(
            'id' => 1
        );
$result = $this->Model1Test->find($conditions, array('id', 'title'));
        $expected = array(
            array('Model1Test' => array( 'id' => 1, 'title' => 'First
Article' ))
        );

        $this->assertEqual($result, $expected);

Now Model1 as a relation hasMany to Model2, i'd like to be able to add
Model2's rows in my $expected variable...

Thanks

L

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

Reply via email to