I am new to unit testing and readying to use test generation supported by netbeans as described in here . It tells to use @assert annotation.
However I am confused here whether,
If all functions to be tested how I can test functions without returning any values.I am using codeigniter, so consider following function which does only loading a view.
public function index(){ $this->load->view('signup'); }
Also say I have a function like this in a codeigniter model, is there anyway to creat tests.
public function save($users_name,$users_email){ $userData = array('users_name'=>$users_name, 'users_email'=>$users_email); $this->db->insert('users',$userData); $user_id = $this->db->insert_id(); return $user_id; }
I do appreciate if someone could please guide me on above , subjected to using automatic test generation supported by netbeans php ide with or without @assert annotation.
Thank you
GUIR
You don't have to use @assert at all. You can write your test case files by yourself. (Even if you don't have NetBeans.)
$user_id
value before test execution.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.