Example #1
0
 /**
  * Test the update() method
  */
 public function update_test()
 {
     $this->set_mock_returned_data(array('Model' => array('id' => 123, 'color' => 'purple')));
     CURL::reset();
     $object = $this->update();
     $data = CURL::get_mock_data();
     $this->should_not('update with the same data', $data);
     $this->color = 'purple';
     CURL::reset();
     $object = $this->update();
     $data = CURL::get_mock_data();
     $this->should('update with new data', $data);
     $data = Data::from_json(CURL::get_mock_data());
     $this->should('use the correct database', $this->get_database() == $data[Remote::DB]);
     CURL::reset();
     $object = $this->update();
     $data = CURL::get_mock_data();
     $this->should_not('update with the same data', $data);
 }