From 059e0d95d0c28bc5060e87e146eaf7411f51bf90 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Thu, 27 Apr 2023 03:47:30 +0300 Subject: skeleton commit; based on an anom project --- tests/service/lorem-md.php | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 tests/service/lorem-md.php (limited to 'tests/service/lorem-md.php') diff --git a/tests/service/lorem-md.php b/tests/service/lorem-md.php new file mode 100755 index 0000000..c7b8d0f --- /dev/null +++ b/tests/service/lorem-md.php @@ -0,0 +1,71 @@ + $title, + 'intro' => $intro, + 'body' => $body + ]; + +} + +$rand_content = lorem_md(); + + +for ($i=0; $i < LIMIT ; $i++) { + + $rand_content = lorem_md(); + + $id = Registry::use('database')->query( + "INSERT INTO lesson (title, course_id, intro, `body`, `status`) + VALUES (:title, :courseid, :intro, :body, :status)", + [ + ':title' => $rand_content['title'], + ':courseid' => rand(3,11), + ':intro' => $rand_content['intro'], + ':body' => $rand_content['body'], + 'status' => rand(0,1) + ] + )->lastInsertID(); + + Registry::use('database')->runQuery( + "INSERT INTO lesson_privilege (lesson_id, privilege_id) + VALUES (:lesson_id, :privilege_id)", + [ + ':lesson_id' => $id, + ':privilege_id' => rand(1,2) + ] + ); + +} + + +?> + +done! \ No newline at end of file -- cgit v1.2.3