Is there any way to test controllers without writing selenium tests? Selenium testing is good, but executing it takes a long time.
Possible example of how do I see it:
class SomeController extends CController {
public function actionHello() {
// some complex logic
$this->render('hello', array('var1' => $var1, 'var2' => $var2));
}
}
// and this is a test
class SomeControllerTest extends ControllerTestCase {
public function testActionHello() {
$this->assertEquals($this->var1, 'value of var1');
$this->assertEquals($this->var2, 'value of var2');
}
}
It’s just an idea, what do you think about it? Do you test your controller logic? Share your ideas please!