Exemplo n.º 1
0
 /**
  * Test miscellaneous compatibility functions.
  */
 public function testCompatibilityFunctions()
 {
     /* Aggregate functions */
     $this->assertEquals(1 | 2 | 4, MySQLite::mysql_bit_or(1, 2, 4));
     /* Comparison functions */
     $this->assertEquals(1, MySQLite::mysql_least(1, 2, 3, 4));
     try {
         MySQLite::mysql_least();
         $this->fail("Least with no arguments is not valid");
     } catch (\InvalidArgumentException $e) {
         /* Expected */
     }
     /* Flow control functions */
     $this->assertEquals("foo", MySQLite::mysql_if(true, "foo", "bar"));
     $this->assertEquals("bar", MySQLite::mysql_if(false, "foo", "bar"));
     /* Numeric functions */
     $this->assertEquals(10, MySQLite::mysql_sqrt(100));
 }