Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed help on writing php testing files to test my PHP controller class
    primarykey
    data
    text
    <p>followed by my previous website development,we have built several controller classs corresponding to entities that will appear in our website development.and our website is very simple:just a shopping website for customers to book bus for travel.</p> <p>Now I am assigned a challenging task that need to be done,that is ,for a single controller class,I need to write a test case to test whether it is working properly.</p> <p>For example,we have a controller class called "JobsController",like:</p> models = array( 'jobs' => new Jobs() ); } function __destruct() { parent::__destruct(); } function addJob( $name , $desc ) { if( $name == '' ) { return false; }; $params = array( 'name' => $name , 'description' => $desc ); return $this->models['jobs']->add( $params ); } function modifyJob( $jid , $name , $desc ) { if( $jid == '' || $name == '' ) { return false; }; $params = array( 'name' => $name , 'description' => $desc ); return $this->models['jobs']->modify( $jid , $params ); } function removeJob( $jid ) { if( $jid == '' ) { return false; }; return $this->models['jobs']->remove( $jid ); } function getJob( $jid ) { return $this->models['jobs']->getInfo( $jid ); } function getAllJobs() { return $this->models['jobs']->getAll(); } } ?> <p>and all other Controller class are almost the same,just with name changes.</p> <p>Now I really need you guys help me a bit how on to write a simple php file to test whether this Controller Class is working properly.After studying your code,I could get my hands on it to work with the rest controllers myself.</p> <p>Many thank!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload