On 9/28/06, nate <[EMAIL PROTECTED] > wrote:

No real way to spot the issue without a little more context.  Can you
show where $status comes from?

It's coming from a unit test callint the model Function. Here's the actual test.

	function testUpdateContents()
	{
		$data = array(
				'Item' => array(
							'0' => array(
									'item_id' => 2,
									'quantity' => 10,
									'discount_percent' => 15),
							'1' => array(
									'item_id' => 3,
									'quantity' => 12,
									'discount_percent' => 3)));
		debug('$data:');
		debug($data);
		
		$this->assertTrue($this->model->updateContents
($this->validQuoteId, $data));
		$this->model->cacheQueries = false;
		$cart = $this->model->getContents($this
->validQuoteId);
		$this->model->cacheQueries = true;
		
		$this->assertEqual($cart[
'ItemsQuote']['0']['item_id'
], 2);
		$this->assertEqual($cart[
'ItemsQuote']['0']['quantity'
], 10);
		$this->assertEqual($cart[
'ItemsQuote']['0']['item_discount_percent'
], 15);
		$this->assertEqual($cart[
'ItemsQuote']['0']['item_total'
], 465.00);
		$this->assertEqual($cart[
'ItemsQuote']['0']['item_total_discount'
], 69.75);
		
		$this->assertEqual($cart[
'ItemsQuote']['1']['item_id'
], 3);
		$this->assertEqual($cart[
'ItemsQuote']['1']['quantity'
], 12);
		$this->assertEqual($cart[
'ItemsQuote']['1']['item_discount_percent'
], 3);
		$this->assertEqual($cart[
'ItemsQuote']['1']['item_total'
], '528.00');
		$this->assertEqual($cart[
'ItemsQuote']['1']['item_total_discount'
], 15.84);
		
		$this->assertEqual($cart[
'quote_sub_total'], '993.00');
		$this->assertEqual($cart[
'quote_total_discount'], 85.59);
		$this->assertEqual($cart[
'quote_net_value'], '907.41');
		
		$this->assertEqual($cart[
'quote_total_tax'], 190.56);
		
		$this->assertEqual($cart[
'quote_total_price'], '1,097.97');
		
		$this->assertEqual($cart[
'Quote']['status'], 0
);
		
		$this->assertTrue($this->model->updateContents
($this->validQuoteId, $data, 
2));
		$this->model->cacheQueries = false;
		$cart = $this->model->getContents($this
->validQuoteId);
		debug('$cart:');
		debug($cart);
		$this->model->cacheQueries = true;
		$this->assertEqual($cart[
'Quote']['status'], 2
);
	}



Have you tried writing the value of
$status to the screen right before the call to saveField? 

Yes, and it  comes out at whatever  I have it set at in the unit test.

 Do you have
DEBUG up to 2, to see the SQL that is being generated.

Yes  also, the generated SQL gives the folowing no matter what the calue of status:

UPDATE `quotes` SET `status` = '1',`modified` = '2006-09-28 22:18:01' WHERE `id` = '21'

I'm at a loss with this one.

Sonic


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to