public function testTest() { Doctrine_Manager::getInstance()->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true); try { $user = new Ticket_1658_User(); $user->password = '******'; $this->fail(); } catch (Doctrine_Exception $e) { $this->pass(); $this->assertEqual($e->getMessage(), 'Set password called'); } try { $user = new Ticket_1658_User(); $user->fromArray(array('password' => 'test')); $this->fail(); } catch (Doctrine_Exception $e) { $this->pass(); $this->assertEqual($e->getMessage(), 'Set password called'); } Doctrine_Manager::getInstance()->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, false); }
public function testTest() { Doctrine_Manager::getInstance()->setAttribute('auto_accessor_override', true); try { $user = new Ticket_1658_User(); $user->password = '******'; $this->fail(); } catch (Doctrine_Exception $e) { $this->pass(); $this->assertEqual($e->getMessage(), 'Set password called'); } try { $user = new Ticket_1658_User(); $user->fromArray(array('password' => 'test')); $this->fail(); } catch (Doctrine_Exception $e) { $this->pass(); $this->assertEqual($e->getMessage(), 'Set password called'); } Doctrine_Manager::getInstance()->setAttribute('auto_accessor_override', false); }