2424use mod_ratingallocate \db as this_db ;
2525use mod_ratingallocate \task \cron_task ;
2626use PHPUnit \Framework \Attributes \CoversClass ;
27+ use PHPUnit \Framework \Attributes \CoversFunction ;
2728
2829/**
2930 * mod_ratingallocate cron tests
3940 * @covers \mod_ratingallocate\task\cron_task
4041 */
4142#[CoversClass(cron_task::class)]
43+ #[CoversFunction('execute ' )]
4244final class cron_test extends \advanced_testcase {
4345
4446 /** @var $teacher */
@@ -131,7 +133,7 @@ private function run_cron() {
131133 /**
132134 * Assert, that the algorithm status is not_started and the algorithm has created no allocation.
133135 */
134- private function assert_not_started () {
136+ private function assert_not_started (): void {
135137 global $ DB ;
136138 $ record = $ DB ->get_record (this_db \ratingallocate::TABLE , []);
137139 $ ratingallocate = \mod_ratingallocate_generator::get_ratingallocate_for_user ($ this , $ record , $ this ->teacher );
@@ -143,7 +145,7 @@ private function assert_not_started() {
143145 /**
144146 * Assert, that the algorithm status is running and the algorithm has created no allocation.
145147 */
146- private function assert_running () {
148+ private function assert_running (): void {
147149 global $ DB ;
148150 $ record = $ DB ->get_record (this_db \ratingallocate::TABLE , []);
149151 $ ratingallocate = \mod_ratingallocate_generator::get_ratingallocate_for_user ($ this , $ record , $ this ->teacher );
@@ -155,7 +157,7 @@ private function assert_running() {
155157 /**
156158 * Assert, that the algorithm status is failure and the algorithm has created no allocation.
157159 */
158- private function assert_failure () {
160+ private function assert_failure (): void {
159161 global $ DB ;
160162 $ record = $ DB ->get_record (this_db \ratingallocate::TABLE , []);
161163 $ ratingallocate = \mod_ratingallocate_generator::get_ratingallocate_for_user ($ this , $ record , $ this ->teacher );
@@ -167,7 +169,7 @@ private function assert_failure() {
167169 /**
168170 * Assert, that the algorithm status is finished and the algorithm has created 4 allocations.
169171 */
170- private function assert_finish () {
172+ private function assert_finish (): void {
171173 global $ DB ;
172174 $ record = $ DB ->get_record (this_db \ratingallocate::TABLE , []);
173175 $ ratingallocate = \mod_ratingallocate_generator::get_ratingallocate_for_user ($ this , $ record , $ this ->teacher );
@@ -179,7 +181,7 @@ private function assert_finish() {
179181 /**
180182 * Assert, that the algorithm status is still finished and the algorithm has created no allocation.
181183 */
182- private function assert_already_finish () {
184+ private function assert_already_finish (): void {
183185 global $ DB ;
184186 $ record = $ DB ->get_record (this_db \ratingallocate::TABLE , []);
185187 $ ratingallocate = \mod_ratingallocate_generator::get_ratingallocate_for_user ($ this , $ record , $ this ->teacher );
@@ -195,7 +197,7 @@ private function assert_already_finish() {
195197 * @param int $algorithmstarttime the start time of the algorithm.
196198 */
197199 private function create_ratingallocate ($ ratingperiodended ,
198- $ algorithmstatus = algorithm_status::NOTSTARTED , $ algorithmstarttime = null ) {
200+ $ algorithmstatus = algorithm_status::NOTSTARTED , $ algorithmstarttime = null ): void {
199201 global $ DB ;
200202
201203 $ this ->resetAfterTest ();
0 commit comments