/**
  * @test
  */
 public function checkPresenterInstanceValidValues()
 {
     $this->assertAttributeEmpty('presenterInstance', $this->model);
     $this->model->present();
     $this->assertAttributeInstanceOf(Presenter::class, 'presenterInstance', $this->model);
 }
Ejemplo n.º 2
0
//
//$lamp = new Button(new Lamp);
//
//echo $lamp->switchDevice();
//var_dump($lamp);
//echo $lamp->switchDevice();
//var_dump($lamp);
//echo $lamp->switchDevice();
//var_dump($lamp);
//echo $lamp->switchDevice();
/* ------------------------------------------------- *\
    Chainer les méthodes
\* ------------------------------------------------- */
class ModelExample
{
    public function select($args)
    {
        return $this;
        // retourne l'objet dans le script
    }
    public function where($field, $operator, $value)
    {
        return $this;
    }
    public function get()
    {
        return "results";
    }
}
$modelExample = new ModelExample();
echo $modelExample->select('foo')->where('id', '=', 1)->get();