Exemple #1
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->testable = new TestObj();
     $this->testable->test = "testing";
     $this->testable->setProtected("protectedValue");
     $this->testable->setPrivate("privateValue");
     $this->testable->setPrivWithoutGetter("noGetter");
     $this->object = new Accessor($this->testable);
 }
Exemple #2
0
     * @param int $id
     * @return \TestObj
     */
    public static function getCopy($id)
    {
        return parent::getCopy(array('Id' => $id));
    }
    protected static function splitedTbName($n, $isCache)
    {
        return 'VeriCodes';
        //		if($isCache)return 'cache_'.($n%10);
        //		else return 'test_id_v';
    }
}
try {
    $oo = TestObj::getCopy(1);
    $oo->load();
    $oo->registerOn('updateOk', TestObj::onAfterSave);
    //$oo->setField('v', 'val123');
    //$oo->update();
    echo "test.php:";
    echo Sooh\DB\Broker::lastCmd() . "\n";
    $r = $oo->dump();
    var_dump($r);
    echo "<hr>";
    //echo "[done-".$oo->getField('Cellphone')."]";
} catch (\Sooh\DB\Error $e) {
    echo $e->getCode() . ":" . $e->getMessage() . "<br><pre>\n" . $e->strLastCmd . "<br>\n" . $e->getTraceAsString();
} catch (\ErrorException $e) {
    echo $e->getCode() . ":" . $e->getMessage() . "<br><pre>\n" . $e->getTraceAsString();
}