Esempio n. 1
0
         die("<b style='color:red'>Error CANNOT:" . SmartTest::instance()->canwe);
     }
     SmartTest::instance()->progress();
 } catch (Exception $e) {
     die("<b style='color:red'>Error CANNOT:" . SmartTest::instance()->canwe);
 }
 SmartTest::instance()->progress();
 $cheese = new Cheese();
 $cheese->setName("bluecheese");
 $cheeseid = $cheese->save();
 if (!$cheeseid) {
     die("<b style='color:red'>Error CANNOT:" . SmartTest::instance()->canwe);
 }
 $anothercheese = new Cheese();
 $cheese->add($anothercheese);
 $cheese->attach($anothercheese);
 $a1 = $cheese->getRelatedCheese();
 $a2 = $cheese->children();
 if (!is_array($a1) || is_array($a1) && count($a1) !== 0) {
     die("<b style='color:red'>Error CANNOT:" . SmartTest::instance()->canwe);
 }
 SmartTest::instance()->progress();
 if (!is_array($a2) || is_array($a2) && count($a2) !== 0) {
     die("<b style='color:red'>Error CANNOT:" . SmartTest::instance()->canwe);
 }
 SmartTest::instance()->progress();
 //now scan the logs for database modifications
 $logs = strtolower(implode(",", RedBean_DBAdapter::getLogs()));
 if (strpos("alter", $logs) !== false) {
     die("<b style='color:red'>Error CANNOT:" . SmartTest::instance()->canwe);
 }