@@ -23,25 +23,25 @@ public function controller_test_data()
2323 {
2424 return array (
2525 array (1 , '' , '' , false , null , null , 302 ), // non-ajax
26- array (2 , 'delete ' , 'delete ' , true , true , '{} ' , 200 ), // ajax delete success (confirm fail)
27- array (2 , 'delete ' , 'delete ' , true , false , 'NO_AUTH_OPERATION ' , 403 ), // ajax delete fail
26+ array (2 , 'delete ' , '' , true , true , '{} ' , 200 ), // ajax delete success (confirm fail)
27+ array (2 , 'delete ' , '' , true , false , 'NO_AUTH_OPERATION ' , 403 ), // ajax delete fail
2828 array (2 , 'delete ' , 'delete ' , true , true , 'trigger_error ' , 200 ), // ajax delete success (confirm true)
2929 array (3 , 'duplicate ' , 'set_duplicate ' , true , true , 'true ' , 200 ), // ajax set duplicate success
30- array (3 , 'duplicate ' , 'set_duplicate ' , true , false , 'false ' , 200 ), // ajax set duplicate fail
30+ array (3 , 'duplicate ' , '' , true , false , 'false ' , 200 ), // ajax set duplicate fail
3131 array (4 , 'removevote ' , 'remove_vote ' , true , true , 'true ' , 200 ), // ajax set title success
32- array (4 , 'removevote ' , 'remove_vote ' , true , false , '"You do not have the necessary permissions to complete this operation." ' , 200 ), // ajax set title fail
32+ array (4 , 'removevote ' , '' , true , false , '"You do not have the necessary permissions to complete this operation." ' , 200 ), // ajax set title fail
3333 array (5 , 'rfc ' , 'set_rfc ' , true , true , 'true ' , 200 ), // ajax set rfc success
34- array (5 , 'rfc ' , 'set_rfc ' , true , false , 'false ' , 200 ), // ajax set rfc fail
35- array (6 , 'status ' , 'set_status ' , true , true , 'true ' , 200 ), // ajax set status success
36- array (6 , 'status ' , 'set_status ' , true , false , 'false ' , 200 ), // ajax set status fail
34+ array (5 , 'rfc ' , '' , true , false , 'false ' , 200 ), // ajax set rfc fail
35+ array (6 , 'status ' , 'change_status ' , true , true , 'true ' , 200 ), // ajax set status success
36+ array (6 , 'status ' , '' , true , false , 'false ' , 200 ), // ajax set status fail
3737 array (7 , 'ticket ' , 'set_ticket ' , true , true , 'true ' , 200 ), // ajax set ticket success
38- array (7 , 'ticket ' , 'set_ticket ' , true , false , 'false ' , 200 ), // ajax set ticket fail
38+ array (7 , 'ticket ' , '' , true , false , 'false ' , 200 ), // ajax set ticket fail
3939 array (8 , 'title ' , 'set_title ' , true , true , 'true ' , 200 ), // ajax set title success
40- array (8 , 'title ' , 'set_title ' , true , false , 'false ' , 200 ), // ajax set title fail
40+ array (8 , 'title ' , '' , true , false , 'false ' , 200 ), // ajax set title fail
4141 array (9 , 'vote ' , 'vote ' , true , true , 'true ' , 200 ), // ajax set title success
42- array (9 , 'vote ' , 'vote ' , true , false , '"You do not have the necessary permissions to complete this operation." ' , 200 ), // ajax set title fail
42+ array (9 , 'vote ' , '' , true , false , '"You do not have the necessary permissions to complete this operation." ' , 200 ), // ajax set title fail
4343 array (10 , 'implemented ' , 'set_implemented ' , true , true , 'true ' , 200 ), // ajax set implemented success
44- array (10 , 'implemented ' , 'set_implemented ' , true , false , 'false ' , 200 ), // ajax set implemented fail
44+ array (10 , 'implemented ' , '' , true , false , 'false ' , 200 ), // ajax set implemented fail
4545 );
4646 }
4747
@@ -58,7 +58,7 @@ public function test_controller($idea_id, $mode, $callback, $is_ajax, $authorise
5858 ->will ($ this ->returnValue (array ('idea_id ' => $ idea_id , 'idea_author ' => 2 )));
5959
6060 // mock a result from each method called by the idea controller
61- $ this ->ideas ->expects ($ this ->any ( ))
61+ $ this ->ideas ->expects (( $ callback !== '' ? $ this ->once () : $ this -> never () ))
6262 ->method ($ callback )
6363 ->will ($ this ->returnValue ($ authorised ));
6464
0 commit comments