Пример #1
0
 public function testAddTableWithDecimals()
 {
     $e = null;
     try {
         $this->_conn->selectValues("SELECT * FROM big_numbers");
     } catch (Exception $e) {
     }
     $this->assertInstanceOf('Horde_Db_Exception', $e);
     $m = new GiveMeBigNumbers($this->_conn);
     $m->up();
     $this->_conn->insert('INSERT INTO big_numbers (bank_balance, big_bank_balance, world_population, my_house_population, value_of_e) VALUES (1586.43, 1000234000567.95, 6000000000, 3, 2.7182818284590452353602875)');
     $b = (object) $this->_conn->selectOne('SELECT * FROM big_numbers');
     $this->assertNotNull($b->bank_balance);
     $this->assertNotNull($b->big_bank_balance);
     $this->assertNotNull($b->world_population);
     $this->assertNotNull($b->my_house_population);
     $this->assertNotNull($b->value_of_e);
     $m->down();
     $e = null;
     try {
         $this->_conn->selectValues("SELECT * FROM big_numbers");
     } catch (Exception $e) {
     }
     $this->assertInstanceOf('Horde_Db_Exception', $e);
 }
Пример #2
0
 public function testAddTableWithDecimals()
 {
     $e = null;
     try {
         $this->_conn->selectValues("SELECT * FROM big_numbers");
     } catch (Exception $e) {
     }
     $this->assertInstanceOf('Horde_Db_Exception', $e);
     $m = new GiveMeBigNumbers();
     $m->up();
     $result = BigNumber::create(array('bank_balance' => '1586.43', 'big_bank_balance' => "1000234000567.95", 'world_population' => '6000000000', 'my_house_population' => '3', 'value_of_e' => "2.7182818284590452353602875"));
     $this->assertInstanceOf('BigNumber', $result);
     $b = BigNumber::find('first');
     $this->assertNotNull($b->bank_balance);
     $this->assertNotNull($b->big_bank_balance);
     $this->assertNotNull($b->world_population);
     $this->assertNotNull($b->my_house_population);
     $this->assertNotNull($b->value_of_e);
     $m->down();
     $e = null;
     try {
         $this->_conn->selectValues("SELECT * FROM big_numbers");
     } catch (Exception $e) {
     }
     $this->assertInstanceOf('Horde_Db_Exception', $e);
 }