public function testSetMemberCalledCurrencyToACurrencyDoesntMakeARowOfNulls() { $opportunity = new Opportunity(); $opportunity->name = 'Thingo'; $opportunity->stage->value = 'Starting Up'; $opportunity->closeDate = '2008-10-05'; $opportunity->amount->value = 69.0; $opportunity->amount->currency->code = 'BTC'; $opportunity->amount->currency->rateToBase = 1.0; $this->assertTrue($opportunity->save()); $opportunity->delete(); $this->assertEquals(1, ZurmoRedBean::getCell('select count(*) from currency')); $currency = Currency::getByCode('BTC'); $currency->delete(); $currency->forget(); $this->assertEquals(0, ZurmoRedBean::getCell('select count(*) from currency')); }