From 5aaa598fc539f8f1c0d2e4379f654e60f78a8f2b Mon Sep 17 00:00:00 2001 From: njero Date: Fri, 10 Aug 2007 05:08:31 +0000 Subject: [PATCH] More tests around the hasOne problem --- tests/TicketNjeroTestCase.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/TicketNjeroTestCase.php b/tests/TicketNjeroTestCase.php index 0e2f6639f..2e5781829 100644 --- a/tests/TicketNjeroTestCase.php +++ b/tests/TicketNjeroTestCase.php @@ -138,6 +138,11 @@ class Doctrine_TicketNjero_TestCase extends Doctrine_UnitTestCase $policy->save(); $q = new Doctrine_Query(); + + # If I use + # $p = $q->from('PolicyN p') + # this test passes, but there is another issue just not reflected in this test yet, see "in my app" note below + $p = $q->from('PolicyN p, p.RateN r, r.PolicyCodeN y, r.CoverageCodeN c, r.LiabilityCodeN l') ->where('(p.id = ?)', array('1')) ->execute() @@ -146,8 +151,16 @@ class Doctrine_TicketNjero_TestCase extends Doctrine_UnitTestCase $this->assertEqual($p->rate_id, 1); $this->assertEqual($p->RateN->id, 1); $this->assertEqual($p->RateN->policy_code, 1); - $this->assertEqual($p->RateN->coverage_code, 3); + $this->assertEqual($p->RateN->coverage_code, 3); # fail $this->assertEqual($p->RateN->liability_code, 1); + $c = $p->RateN->coverage_code; + $c2 = $p->RateN->CoverageCodeN->code; + $c3 = $p->RateN->coverage_code; + + $this->assertEqual($c, $c2); # fail + $this->assertEqual($c, $c3); # in my app this fails as well, but I can't reproduce this + #echo "Values " . serialize(array($c, $c2, $c3)); + } } ?>