コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }