Exemplo n.º 1
0
 asrt(setget("x2010-10-11 12:10:11"), "x2010-10-11 12:10:11");
 asrt(setget("a"), "a");
 asrt(setget("."), ".");
 asrt(setget("\""), "\"");
 asrt(setget("just some text"), "just some text");
 asrt(setget(true), "1");
 asrt(setget(false), "0");
 asrt(setget("true"), "true");
 asrt(setget("false"), "false");
 asrt(setget("null"), "null");
 asrt(setget("NULL"), "NULL");
 asrt(setget(null), null);
 asrt(setget(0) == 0, true);
 asrt(setget(1) == 1, true);
 asrt(setget(true) == true, true);
 asrt(setget(false) == false, true);
 testpack("test views");
 class Fm implements RedBean_IBeanFormatter
 {
     public function formatBeanTable($table)
     {
         return "prefix_{$table}";
     }
     public function formatBeanID($table)
     {
         return $table . "__id";
     }
     public function getAlias($a)
     {
         return '__';
     }
Exemplo n.º 2
0
 /**
  * Test NULL.
  * 
  * @return void
  */
 public function testNull()
 {
     asrt(setget("NULL"), "NULL");
     asrt(setget("NULL"), "NULL");
     asrt(setget("0123", 1), "0123");
     asrt(setget("0000123", 1), "0000123");
     asrt(setget(NULL), NULL);
     asrt(setget(0) == 0, TRUE);
     asrt(setget(1) == 1, TRUE);
     asrt(setget(TRUE) == TRUE, TRUE);
     asrt(setget(FALSE) == FALSE, TRUE);
     // minor test sqltest
     $a = R::getWriter()->sqlStateIn('000', array());
     // Unknown state must return FALSE.
     asrt($a, FALSE);
     try {
         R::getWriter()->esc('`aaa`');
         fail();
     } catch (\Exception $e) {
         pass();
     }
     asrt($e instanceof RedException, TRUE);
 }
Exemplo n.º 3
0
 /**
  * Test NULL.
  * 
  * @return void
  */
 public function testNull()
 {
     asrt(setget("NULL"), "NULL");
     asrt(setget("NULL"), "NULL");
     asrt(setget(NULL), NULL);
     asrt(setget(0) == 0, TRUE);
     asrt(setget(1) == 1, TRUE);
     asrt(setget(TRUE) == TRUE, TRUE);
     asrt(setget(FALSE) == FALSE, TRUE);
 }