Inheritance: extends Phalcon\Mvc\Model
Exemple #1
0
 public function testGettersAndSetters()
 {
     $this->specify("Model getters and setters don't work", function () {
         $robot = Boutique\Robots::findFirst();
         $testText = "executeSetGet Test";
         $robot->assign(["text" => $testText]);
         expect($robot->text)->equals($testText . $robot::SETTER_EPILOGUE);
         expect($robot->text)->equals($robot->getText());
         $testText = "executeSetGet Test 2";
         $robot->text = $testText;
         expect($robot->text)->equals($testText . $robot::SETTER_EPILOGUE);
         expect($robot->text)->equals($robot->getText());
         $robot = new Boutique\Robots();
         $robot->serial = '1234';
     }, ['throws' => [Exception::class, "Property 'serial' does not have a setter."]]);
 }